MSP-8974 review fixes
This commit is contained in:
1 parent
1ea3ef186c
commit
7bac2e403f
20 files changed
+189
-466
No files matched your search
+10
-10
@@ -28,16 +28,16 @@ var (
|
||||
|
||||
// nolint:gochecknoglobals
|
||||
var (
|
||||
UnknownAuditEventErrorCode = 1
|
||||
ErrOauthAuthorizationCode = 2
|
||||
ErrUnauthenticatedCode = 3
|
||||
ErrTooManyLoginRequestsCode = 4
|
||||
ErrOauthIsMissedCode = 5
|
||||
ErrAlreadyExistsCode = 6
|
||||
ErrNotFoundCode = 7
|
||||
ErrUnknownClientCode = 8
|
||||
ErrInvalidCode = 9
|
||||
ErrInvalidPasswordCode = 10
|
||||
UnknownAuditEventErrorCode = 601
|
||||
ErrOauthAuthorizationCode = 602
|
||||
ErrUnauthenticatedCode = 603
|
||||
ErrTooManyLoginRequestsCode = 604
|
||||
ErrOauthIsMissedCode = 605
|
||||
ErrAlreadyExistsCode = 606
|
||||
ErrNotFoundCode = 607
|
||||
ErrUnknownClientCode = 608
|
||||
ErrInvalidCode = 609
|
||||
ErrInvalidPasswordCode = 610
|
||||
)
|
||||
|
||||
type UnknownAuditEventError struct {
|
||||
|
||||
@@ -4,6 +4,17 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
SessionStatusAllowed = "ALLOWED"
|
||||
SessionStatusAllowedRus = "Активная"
|
||||
|
||||
SessionStatusExpired = "EXPIRED"
|
||||
SessionStatusExpiredRus = "Истекшая"
|
||||
|
||||
SessionStatusRevoked = "REVOKED"
|
||||
SessionStatusRevokedRus = "Отмененная"
|
||||
)
|
||||
|
||||
type Session struct {
|
||||
Id int // Идентификатор сессии
|
||||
UserId int // Идентификатор пользоватеккля
|
||||
@@ -35,3 +46,15 @@ type SessionResponse struct {
|
||||
type RevokeRequest struct {
|
||||
Id int `validate:"required"` // Идентификатор сессии
|
||||
}
|
||||
|
||||
func (s Session) StatusRus() string {
|
||||
switch s.Status {
|
||||
case SessionStatusAllowed:
|
||||
return SessionStatusAllowedRus
|
||||
case SessionStatusExpired:
|
||||
return SessionStatusExpiredRus
|
||||
case SessionStatusRevoked:
|
||||
return SessionStatusRevokedRus
|
||||
}
|
||||
return ""
|
||||
}
|
||||
Reference in new issue
Block a user