MSP-7470 Init user auth

This commit is contained in:
Синельник Тимур Романович committed 2026-04-01 10:05:20 +03:00
1 parent b67eb8137c
commit eb6326c343
35 files changed
+1059 -142

No files matched your search

+30 -1
View File
@@ -1,9 +1,38 @@
package domain
type AuthData struct {
type AuthenticateAppResponse struct {
Authenticated bool
ErrorReason string
AuthData *AppAuthData
}
type AppAuthData struct {
AppName string
SystemId int
DomainId int
ServiceId int
ApplicationId int
}
type ApplicationToken struct {
AppToken string
AppName string
}
type UserToken struct {
Token string
}
type AuthenticateUserResponse struct {
Authenticated bool
ShouldSkip bool
ErrorReason string
AuthData *UserAuthData
}
type UserAuthData struct {
SkipAppAuth bool
Identity string
IdentityHeader string
ExtraHeaders map[string][]string
}
+6 -1
View File
@@ -1,6 +1,8 @@
package domain
import "context"
import (
"context"
)
type EndpointMeta struct {
Inner bool
@@ -9,6 +11,9 @@ type EndpointMeta struct {
PathSchema string
// Вызываемый метод
Endpoint string
// Нормализованный путь, для известных путей берётся объявляемый метод, для неизвестных - вызываемый
// Удаляет '/' из начала пути
NormalizedEndpoint string
}
type endpointMetaKey struct{}
-30
View File
@@ -1,30 +0,0 @@
package domain
type AuthenticateRequest struct {
Token string
}
type AuthenticateResponse struct {
Authenticated bool
ErrorReason string
AuthData *AuthData
}
type AuthorizeRequest struct {
ApplicationId int
HttpMethod string
Endpoint string
}
type AuthorizeResponse struct {
Authorized bool
}
type AdminAuthorizeRequest struct {
AdminId int
Permission string
}
type AdminAuthorizeResponse struct {
Authorized bool
}