Documentation ¶
Index ¶
Constants ¶
View Source
const ( QuotaTargetSrv quota.TargetSrv = "auth" QuotaTarget quota.Target = "session" )
Variables ¶
View Source
var ( ErrUserTokenNotFound = errors.New("user token not found") ErrInvalidSessionToken = usertoken.ErrInvalidSessionToken )
Typed errors
Functions ¶
This section is empty.
Types ¶
type CreateTokenErr ¶
CreateTokenErr represents a token creation error; used in Enterprise
func (*CreateTokenErr) Error ¶
func (e *CreateTokenErr) Error() string
type IDService ¶
type IDService interface { // SignIdentity signs a id token for provided identity that can be forwarded to plugins and external services SignIdentity(ctx context.Context, identity identity.Requester) (string, error) // RemoveIDToken removes any locally stored id tokens for key RemoveIDToken(ctx context.Context, identity identity.Requester) error }
type JWTVerifierService ¶
type JWTVerifierService = jwt.JWTService
type RevokeAuthTokenCmd ¶
type RevokeAuthTokenCmd struct {
AuthTokenId int64 `json:"authTokenId"`
}
type RotateCommand ¶
type TokenExpiredError ¶
func (*TokenExpiredError) Error ¶
func (e *TokenExpiredError) Error() string
func (*TokenExpiredError) Unwrap ¶
func (e *TokenExpiredError) Unwrap() error
type TokenRevokedError ¶
type TokenRevokedError = usertoken.TokenRevokedError
type UserTokenBackgroundService ¶
type UserTokenBackgroundService interface { registry.BackgroundService }
type UserTokenService ¶
type UserTokenService interface { CreateToken(ctx context.Context, user *user.User, clientIP net.IP, userAgent string) (*UserToken, error) LookupToken(ctx context.Context, unhashedToken string) (*UserToken, error) // RotateToken will always rotate a valid token RotateToken(ctx context.Context, cmd RotateCommand) (*UserToken, error) RevokeToken(ctx context.Context, token *UserToken, soft bool) error RevokeAllUserTokens(ctx context.Context, userID int64) error GetUserToken(ctx context.Context, userID, userTokenID int64) (*UserToken, error) GetUserTokens(ctx context.Context, userID int64) ([]*UserToken, error) ActiveTokenCount(ctx context.Context, userID *int64) (int64, error) GetUserRevokedTokens(ctx context.Context, userID int64) ([]*UserToken, error) }
UserTokenService are used for generating and validating user tokens
Click to show internal directories.
Click to hide internal directories.