Реализация на 4

This commit is contained in:
Grbisba
2026-11-05 14:24:40 +03:00
parent 20f2f00a60
commit 8d44c74535
85 changed files with 3601 additions and 1109 deletions
+26 -44
View File
@@ -7,9 +7,7 @@ import (
"github.com/google/uuid"
"gitea.privcloud.tech/mtusi2026/internal/pkg/authidentity"
"gitea.privcloud.tech/mtusi2026/internal/pkg/authprovider"
"gitea.privcloud.tech/mtusi2026/internal/pkg/role"
"gitea.privcloud.tech/mtusi2026/internal/pkg/types/role"
)
// ---- Tokens ----
@@ -92,53 +90,37 @@ type RevokeRefreshTokensByUserID struct {
// ---- Auth ----
type Session struct {
ExpiresAt time.Time
Token string
TokenType string
User User
}
type Login struct {
Email string
Username string
Password string
}
type LoginResult struct {
ExpiresAt time.Time
TokenType string
User User
Tokens Tokens
}
// UserCredentials is internal authentication data, never a public user response.
type UserCredentials struct {
User User
PasswordHash string `json:"-"`
}
type Logout struct {
Token string
}
type Register struct {
Email string
Password string
RepeatPassword string
}
// ---- Auth Identities ----
type AuthIdentity struct {
ID uuid.UUID
Role role.Role
UserID uuid.UUID
Provider authprovider.Type
Identifier string
PasswordHash *string
Status authidentity.Status
CreatedAt time.Time
UpdatedAt time.Time
}
type UpdateAuthIdentity struct {
ID uuid.UUID
Role *role.Role
Provider *authprovider.Type
Identifier *string
PasswordHash *string
Status *authidentity.Status
UpdatedAt time.Time
}
type UpdateAuthIdentityPasswordHash struct {
ID uuid.UUID
PasswordHash string
UpdatedAt time.Time
}
type UpdateAuthIdentityStatus struct {
ID uuid.UUID
Status authidentity.Status
UpdatedAt time.Time
}
type GetAuthIdentityByRoleAndUserID struct {
Role role.Role
UserID uuid.UUID
}