Documentation
¶
Index ¶
- Constants
- type UserAuthTokenService
- func (s *UserAuthTokenService) ActiveTokenCount(ctx context.Context, userID *int64) (int64, error)
- func (s *UserAuthTokenService) BatchRevokeAllUserTokens(ctx context.Context, userIds []int64) error
- func (s *UserAuthTokenService) CreateToken(ctx context.Context, cmd *auth.CreateTokenCommand) (*auth.UserToken, error)
- func (s *UserAuthTokenService) DeleteUserRevokedTokens(ctx context.Context, userID int64, window time.Duration) error
- func (s *UserAuthTokenService) FindExternalSessions(ctx context.Context, query *auth.ListExternalSessionQuery) ([]*auth.ExternalSession, error)
- func (s *UserAuthTokenService) GetExternalSession(ctx context.Context, externalSessionID int64) (*auth.ExternalSession, error)
- func (s *UserAuthTokenService) GetTokenByExternalSessionID(ctx context.Context, externalSessionID int64) (*auth.UserToken, error)
- func (s *UserAuthTokenService) GetUserRevokedTokens(ctx context.Context, userId int64) ([]*auth.UserToken, error)
- func (s *UserAuthTokenService) GetUserToken(ctx context.Context, userId, userTokenId int64) (*auth.UserToken, error)
- func (s *UserAuthTokenService) GetUserTokens(ctx context.Context, userId int64) ([]*auth.UserToken, error)
- func (s *UserAuthTokenService) LookupToken(ctx context.Context, unhashedToken string) (*auth.UserToken, error)
- func (s *UserAuthTokenService) RevokeAllUserTokens(ctx context.Context, userId int64) error
- func (s *UserAuthTokenService) RevokeToken(ctx context.Context, token *auth.UserToken, soft bool) error
- func (s *UserAuthTokenService) RotateToken(ctx context.Context, cmd auth.RotateCommand) (*auth.UserToken, error)
- func (s *UserAuthTokenService) Run(ctx context.Context) error
- func (s *UserAuthTokenService) UpdateExternalSession(ctx context.Context, externalSessionID int64, ...) error
Constants ¶
View Source
const SkipRotationTime = 5 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserAuthTokenService ¶
type UserAuthTokenService struct {
// contains filtered or unexported fields
}
func ProvideUserAuthTokenService ¶
func ProvideUserAuthTokenService(sqlStore db.DB, serverLockService *serverlock.ServerLockService, quotaService quota.Service, secretService secrets.Service, cfg *setting.Cfg, tracer tracing.Tracer, features featuremgmt.FeatureToggles, ) (*UserAuthTokenService, error)
func (*UserAuthTokenService) ActiveTokenCount ¶
ActiveTokenCount returns the number of active tokens. If userID is nil, the count is for all users.
func (*UserAuthTokenService) BatchRevokeAllUserTokens ¶
func (s *UserAuthTokenService) BatchRevokeAllUserTokens(ctx context.Context, userIds []int64) error
func (*UserAuthTokenService) CreateToken ¶
func (s *UserAuthTokenService) CreateToken(ctx context.Context, cmd *auth.CreateTokenCommand) (*auth.UserToken, error)
func (*UserAuthTokenService) DeleteUserRevokedTokens ¶
func (*UserAuthTokenService) FindExternalSessions ¶
func (s *UserAuthTokenService) FindExternalSessions(ctx context.Context, query *auth.ListExternalSessionQuery) ([]*auth.ExternalSession, error)
func (*UserAuthTokenService) GetExternalSession ¶
func (s *UserAuthTokenService) GetExternalSession(ctx context.Context, externalSessionID int64) (*auth.ExternalSession, error)
func (*UserAuthTokenService) GetTokenByExternalSessionID ¶
func (*UserAuthTokenService) GetUserRevokedTokens ¶
func (*UserAuthTokenService) GetUserToken ¶
func (*UserAuthTokenService) GetUserTokens ¶
func (*UserAuthTokenService) LookupToken ¶
func (*UserAuthTokenService) RevokeAllUserTokens ¶
func (s *UserAuthTokenService) RevokeAllUserTokens(ctx context.Context, userId int64) error
func (*UserAuthTokenService) RevokeToken ¶
func (*UserAuthTokenService) RotateToken ¶
func (s *UserAuthTokenService) RotateToken(ctx context.Context, cmd auth.RotateCommand) (*auth.UserToken, error)
func (*UserAuthTokenService) UpdateExternalSession ¶
func (s *UserAuthTokenService) UpdateExternalSession(ctx context.Context, externalSessionID int64, cmd *auth.UpdateExternalSessionCommand) error
Click to show internal directories.
Click to hide internal directories.