Documentation ¶
Index ¶
- Constants
- type FakeUserAuthTokenService
- func (s *FakeUserAuthTokenService) ActiveTokenCount(ctx context.Context) (int64, error)
- func (s *FakeUserAuthTokenService) BatchRevokeAllUserTokens(ctx context.Context, userIds []int64) error
- func (s *FakeUserAuthTokenService) CreateToken(ctx context.Context, user *models.User, clientIP net.IP, userAgent string) (*models.UserToken, error)
- func (s *FakeUserAuthTokenService) GetUserRevokedTokens(ctx context.Context, userId int64) ([]*models.UserToken, error)
- func (s *FakeUserAuthTokenService) GetUserToken(ctx context.Context, userId, userTokenId int64) (*models.UserToken, error)
- func (s *FakeUserAuthTokenService) GetUserTokens(ctx context.Context, userId int64) ([]*models.UserToken, error)
- func (s *FakeUserAuthTokenService) Init() error
- func (s *FakeUserAuthTokenService) LookupToken(ctx context.Context, unhashedToken string) (*models.UserToken, error)
- func (s *FakeUserAuthTokenService) RevokeAllUserTokens(ctx context.Context, userId int64) error
- func (s *FakeUserAuthTokenService) RevokeToken(ctx context.Context, token *models.UserToken, soft bool) error
- func (s *FakeUserAuthTokenService) TryRotateToken(ctx context.Context, token *models.UserToken, clientIP net.IP, ...) (bool, error)
- type UserAuthTokenService
- func (s *UserAuthTokenService) ActiveTokenCount(ctx context.Context) (int64, error)
- func (s *UserAuthTokenService) BatchRevokeAllUserTokens(ctx context.Context, userIds []int64) error
- func (s *UserAuthTokenService) CreateToken(ctx context.Context, user *models.User, clientIP net.IP, userAgent string) (*models.UserToken, error)
- func (s *UserAuthTokenService) GetUserRevokedTokens(ctx context.Context, userId int64) ([]*models.UserToken, error)
- func (s *UserAuthTokenService) GetUserToken(ctx context.Context, userId, userTokenId int64) (*models.UserToken, error)
- func (s *UserAuthTokenService) GetUserTokens(ctx context.Context, userId int64) ([]*models.UserToken, error)
- func (s *UserAuthTokenService) LookupToken(ctx context.Context, unhashedToken string) (*models.UserToken, error)
- func (s *UserAuthTokenService) RevokeAllUserTokens(ctx context.Context, userId int64) error
- func (s *UserAuthTokenService) RevokeToken(ctx context.Context, token *models.UserToken, soft bool) error
- func (s *UserAuthTokenService) Run(ctx context.Context) error
- func (s *UserAuthTokenService) TryRotateToken(ctx context.Context, token *models.UserToken, clientIP net.IP, ...) (bool, error)
Constants ¶
View Source
const ServiceName = "UserAuthTokenService"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeUserAuthTokenService ¶
type FakeUserAuthTokenService struct { CreateTokenProvider func(ctx context.Context, user *models.User, clientIP net.IP, userAgent string) (*models.UserToken, error) TryRotateTokenProvider func(ctx context.Context, token *models.UserToken, clientIP net.IP, userAgent string) (bool, error) LookupTokenProvider func(ctx context.Context, unhashedToken string) (*models.UserToken, error) RevokeTokenProvider func(ctx context.Context, token *models.UserToken, soft bool) error RevokeAllUserTokensProvider func(ctx context.Context, userId int64) error ActiveAuthTokenCount func(ctx context.Context) (int64, error) GetUserTokenProvider func(ctx context.Context, userId, userTokenId int64) (*models.UserToken, error) GetUserTokensProvider func(ctx context.Context, userId int64) ([]*models.UserToken, error) GetUserRevokedTokensProvider func(ctx context.Context, userId int64) ([]*models.UserToken, error) BatchRevokedTokenProvider func(ctx context.Context, userIds []int64) error }
func NewFakeUserAuthTokenService ¶
func NewFakeUserAuthTokenService() *FakeUserAuthTokenService
func (*FakeUserAuthTokenService) ActiveTokenCount ¶
func (s *FakeUserAuthTokenService) ActiveTokenCount(ctx context.Context) (int64, error)
func (*FakeUserAuthTokenService) BatchRevokeAllUserTokens ¶
func (s *FakeUserAuthTokenService) BatchRevokeAllUserTokens(ctx context.Context, userIds []int64) error
func (*FakeUserAuthTokenService) CreateToken ¶
func (*FakeUserAuthTokenService) GetUserRevokedTokens ¶
func (*FakeUserAuthTokenService) GetUserToken ¶
func (*FakeUserAuthTokenService) GetUserTokens ¶
func (*FakeUserAuthTokenService) Init ¶
func (s *FakeUserAuthTokenService) Init() error
Init initializes the service. Required for dependency injection.
func (*FakeUserAuthTokenService) LookupToken ¶
func (*FakeUserAuthTokenService) RevokeAllUserTokens ¶
func (s *FakeUserAuthTokenService) RevokeAllUserTokens(ctx context.Context, userId int64) error
func (*FakeUserAuthTokenService) RevokeToken ¶
type UserAuthTokenService ¶
type UserAuthTokenService struct { SQLStore *sqlstore.SQLStore ServerLockService *serverlock.ServerLockService Cfg *setting.Cfg // contains filtered or unexported fields }
func ProvideUserAuthTokenService ¶
func ProvideUserAuthTokenService(sqlStore *sqlstore.SQLStore, serverLockService *serverlock.ServerLockService, cfg *setting.Cfg) *UserAuthTokenService
func (*UserAuthTokenService) ActiveTokenCount ¶
func (s *UserAuthTokenService) ActiveTokenCount(ctx context.Context) (int64, error)
func (*UserAuthTokenService) BatchRevokeAllUserTokens ¶
func (s *UserAuthTokenService) BatchRevokeAllUserTokens(ctx context.Context, userIds []int64) error
func (*UserAuthTokenService) CreateToken ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.