Documentation ¶
Index ¶
- type FakeOAuthTokenService
- func (ts *FakeOAuthTokenService) GetCurrentOAuthToken(context.Context, *user.SignedInUser) *oauth2.Token
- func (ts *FakeOAuthTokenService) HasOAuthEntry(context.Context, *user.SignedInUser) (*login.UserAuth, bool, error)
- func (ts *FakeOAuthTokenService) InvalidateOAuthTokens(ctx context.Context, usr *login.UserAuth) error
- func (ts *FakeOAuthTokenService) IsOAuthPassThruEnabled(*datasources.DataSource) bool
- func (ts *FakeOAuthTokenService) TryTokenRefresh(ctx context.Context, usr *login.UserAuth) error
- 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 *user.User, clientIP net.IP, userAgent string) (*auth.UserToken, error)
- func (s *FakeUserAuthTokenService) GetUserRevokedTokens(ctx context.Context, userId int64) ([]*auth.UserToken, error)
- func (s *FakeUserAuthTokenService) GetUserToken(ctx context.Context, userId, userTokenId int64) (*auth.UserToken, error)
- func (s *FakeUserAuthTokenService) GetUserTokens(ctx context.Context, userId int64) ([]*auth.UserToken, error)
- func (s *FakeUserAuthTokenService) Init() error
- func (s *FakeUserAuthTokenService) LookupToken(ctx context.Context, unhashedToken string) (*auth.UserToken, error)
- func (s *FakeUserAuthTokenService) RevokeAllUserTokens(ctx context.Context, userId int64) error
- func (s *FakeUserAuthTokenService) RevokeToken(ctx context.Context, token *auth.UserToken, soft bool) error
- func (s *FakeUserAuthTokenService) RotateToken(ctx context.Context, cmd auth.RotateCommand) (*auth.UserToken, error)
- func (s *FakeUserAuthTokenService) TryRotateToken(ctx context.Context, token *auth.UserToken, clientIP net.IP, userAgent string) (bool, *auth.UserToken, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeOAuthTokenService ¶
type FakeOAuthTokenService struct { ExpectedAuthUser *login.UserAuth ExpectedErrors map[string]error // contains filtered or unexported fields }
func (*FakeOAuthTokenService) GetCurrentOAuthToken ¶
func (ts *FakeOAuthTokenService) GetCurrentOAuthToken(context.Context, *user.SignedInUser) *oauth2.Token
func (*FakeOAuthTokenService) HasOAuthEntry ¶
func (ts *FakeOAuthTokenService) HasOAuthEntry(context.Context, *user.SignedInUser) (*login.UserAuth, bool, error)
func (*FakeOAuthTokenService) InvalidateOAuthTokens ¶
func (*FakeOAuthTokenService) IsOAuthPassThruEnabled ¶
func (ts *FakeOAuthTokenService) IsOAuthPassThruEnabled(*datasources.DataSource) bool
func (*FakeOAuthTokenService) TryTokenRefresh ¶
type FakeUserAuthTokenService ¶
type FakeUserAuthTokenService struct { CreateTokenProvider func(ctx context.Context, user *user.User, clientIP net.IP, userAgent string) (*auth.UserToken, error) RotateTokenProvider func(ctx context.Context, cmd auth.RotateCommand) (*auth.UserToken, error) TryRotateTokenProvider func(ctx context.Context, token *auth.UserToken, clientIP net.IP, userAgent string) (bool, *auth.UserToken, error) LookupTokenProvider func(ctx context.Context, unhashedToken string) (*auth.UserToken, error) RevokeTokenProvider func(ctx context.Context, token *auth.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) (*auth.UserToken, error) GetUserTokensProvider func(ctx context.Context, userId int64) ([]*auth.UserToken, error) GetUserRevokedTokensProvider func(ctx context.Context, userId int64) ([]*auth.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 ¶
func (*FakeUserAuthTokenService) RotateToken ¶
func (s *FakeUserAuthTokenService) RotateToken(ctx context.Context, cmd auth.RotateCommand) (*auth.UserToken, error)
Click to show internal directories.
Click to hide internal directories.