Documentation
¶
Index ¶
- Variables
- func GetServiceKey(ctx context.Context) (string, error)
- func HasBerlogaJWT(ctx context.Context) bool
- func HasServiceKey(ctx context.Context) bool
- func HasTalentOAuth(ctx context.Context) bool
- func SetPlayer(ctx context.Context, player Player) context.Context
- func SetServiceKey(ctx context.Context, key string) context.Context
- func SetUser(ctx context.Context, user User) context.Context
- type AuthType
- type Authenticator
- type CredentialsAuthError
- type Player
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var (
)Functions ¶
func GetServiceKey ¶
GetServiceKey возвращает сервисный ключ из контекста или ошибку ErrMissingServiceKey.
func HasBerlogaJWT ¶
HasBerlogaJWT сообщает имеется ли успешная аутентификация BerlogaJWT в контексте.
func HasServiceKey ¶
HasServiceKey сообщает имеется ли успешная аутентификация сервисным ключом в контексте.
func HasTalentOAuth ¶
func SetServiceKey ¶
SetServiceKey создает контекст авторизованный аутентификатором ServiceKey.
Types ¶
type AuthType ¶
type AuthType string
var Unauthenticated AuthType = ""
func GetAuthType ¶
AuthType возвращает текущий тип аутентификации. Возможные значения:
- Unauthenticated
- AuthTalentOAuth
- AuthBerlogaJWT
- AuthServiceKey
type Authenticator ¶
type Authenticator interface {
Auth(ctx context.Context, credentials string) (context.Context, error)
}
func BerlogaJWT ¶
func BerlogaJWT(jwkset jwk.Set) Authenticator
BerlogaJWT создает JWT аутентификатор на основе JWKSet.
func ServiceKey ¶
func ServiceKey(key string) Authenticator
ServiceKey создает аутентификатор по сервисному ключу Берлоги.
func TalentOAuth ¶
func TalentOAuth(jwkset jwk.Set) Authenticator
type CredentialsAuthError ¶
type CredentialsAuthError struct {
Err error
}
Предоставленные учетные данные не прошли аутентификацию.
func (*CredentialsAuthError) Error ¶
func (e *CredentialsAuthError) Error() string
Click to show internal directories.
Click to hide internal directories.