forked from mtusi2026/mtusi2026lab2
Реализация на 4
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user