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 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)
TryRotateToken(ctx context.Context, token *UserToken, clientIP net.IP, userAgent string) (bool, *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)
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.