auth

package
v0.0.0-...-34a2968 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeUserAuthTokenService

type FakeUserAuthTokenService struct {
	CreateTokenProvider         func(ctx context.Context, userId int64, clientIP, userAgent string) (*models.UserToken, error)
	TryRotateTokenProvider      func(ctx context.Context, token *models.UserToken, clientIP, userAgent string) (bool, error)
	LookupTokenProvider         func(ctx context.Context, unhashedToken string) (*models.UserToken, error)
	RevokeTokenProvider         func(ctx context.Context, token *models.UserToken) 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)
	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 (s *FakeUserAuthTokenService) CreateToken(ctx context.Context, userId int64, clientIP, userAgent string) (*models.UserToken, error)

func (*FakeUserAuthTokenService) GetUserToken

func (s *FakeUserAuthTokenService) GetUserToken(ctx context.Context, userId, userTokenId int64) (*models.UserToken, error)

func (*FakeUserAuthTokenService) GetUserTokens

func (s *FakeUserAuthTokenService) GetUserTokens(ctx context.Context, userId int64) ([]*models.UserToken, error)

func (*FakeUserAuthTokenService) LookupToken

func (s *FakeUserAuthTokenService) LookupToken(ctx context.Context, unhashedToken string) (*models.UserToken, error)

func (*FakeUserAuthTokenService) RevokeAllUserTokens

func (s *FakeUserAuthTokenService) RevokeAllUserTokens(ctx context.Context, userId int64) error

func (*FakeUserAuthTokenService) RevokeToken

func (s *FakeUserAuthTokenService) RevokeToken(ctx context.Context, token *models.UserToken) error

func (*FakeUserAuthTokenService) TryRotateToken

func (s *FakeUserAuthTokenService) TryRotateToken(ctx context.Context, token *models.UserToken, clientIP, userAgent string) (bool, error)

type UserAuthTokenService

type UserAuthTokenService struct {
	SQLStore          *sqlstore.SqlStore            `inject:""`
	ServerLockService *serverlock.ServerLockService `inject:""`
	Cfg               *setting.Cfg                  `inject:""`
	// contains filtered or unexported fields
}

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 (s *UserAuthTokenService) CreateToken(ctx context.Context, userId int64, clientAddr, userAgent string) (*models.UserToken, error)

func (*UserAuthTokenService) GetUserToken

func (s *UserAuthTokenService) GetUserToken(ctx context.Context, userId, userTokenId int64) (*models.UserToken, error)

func (*UserAuthTokenService) GetUserTokens

func (s *UserAuthTokenService) GetUserTokens(ctx context.Context, userId int64) ([]*models.UserToken, error)

func (*UserAuthTokenService) Init

func (s *UserAuthTokenService) Init() error

func (*UserAuthTokenService) LookupToken

func (s *UserAuthTokenService) LookupToken(ctx context.Context, unhashedToken string) (*models.UserToken, error)

func (*UserAuthTokenService) RevokeAllUserTokens

func (s *UserAuthTokenService) RevokeAllUserTokens(ctx context.Context, userId int64) error

func (*UserAuthTokenService) RevokeToken

func (s *UserAuthTokenService) RevokeToken(ctx context.Context, token *models.UserToken) error

func (*UserAuthTokenService) Run

func (srv *UserAuthTokenService) Run(ctx context.Context) error

func (*UserAuthTokenService) TryRotateToken

func (s *UserAuthTokenService) TryRotateToken(ctx context.Context, token *models.UserToken,
	clientAddr, userAgent string) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL