Documentation ¶
Index ¶
- Variables
- type UserAuthTokenService
- type UserAuthTokenServiceImpl
- func (s *UserAuthTokenServiceImpl) CreateToken(userId int64, clientIP, userAgent string) (*userAuthToken, error)
- func (s *UserAuthTokenServiceImpl) Init() error
- func (s *UserAuthTokenServiceImpl) InitContextWithToken(ctx *models.ReqContext, orgID int64) bool
- func (s *UserAuthTokenServiceImpl) LookupToken(unhashedToken string) (*userAuthToken, error)
- func (s *UserAuthTokenServiceImpl) RefreshToken(token *userAuthToken, clientIP, userAgent string) (bool, error)
- func (srv *UserAuthTokenServiceImpl) Run(ctx context.Context) error
- func (s *UserAuthTokenServiceImpl) UserAuthenticatedHook(user *models.User, c *models.ReqContext) error
- func (s *UserAuthTokenServiceImpl) UserSignedOutHook(c *models.ReqContext)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAuthTokenNotFound = errors.New("User auth token not found")
)
Typed errors
View Source
var (
UrgentRotateTime = 1 * time.Minute
)
Functions ¶
This section is empty.
Types ¶
type UserAuthTokenService ¶
type UserAuthTokenService interface { InitContextWithToken(ctx *models.ReqContext, orgID int64) bool UserAuthenticatedHook(user *models.User, c *models.ReqContext) error UserSignedOutHook(c *models.ReqContext) }
UserAuthTokenService are used for generating and validating user auth tokens
type UserAuthTokenServiceImpl ¶
type UserAuthTokenServiceImpl struct { SQLStore *sqlstore.SqlStore `inject:""` ServerLockService *serverlock.ServerLockService `inject:""` Cfg *setting.Cfg `inject:""` // contains filtered or unexported fields }
func (*UserAuthTokenServiceImpl) CreateToken ¶
func (s *UserAuthTokenServiceImpl) CreateToken(userId int64, clientIP, userAgent string) (*userAuthToken, error)
func (*UserAuthTokenServiceImpl) Init ¶
func (s *UserAuthTokenServiceImpl) Init() error
Init this service
func (*UserAuthTokenServiceImpl) InitContextWithToken ¶
func (s *UserAuthTokenServiceImpl) InitContextWithToken(ctx *models.ReqContext, orgID int64) bool
func (*UserAuthTokenServiceImpl) LookupToken ¶
func (s *UserAuthTokenServiceImpl) LookupToken(unhashedToken string) (*userAuthToken, error)
func (*UserAuthTokenServiceImpl) RefreshToken ¶
func (s *UserAuthTokenServiceImpl) RefreshToken(token *userAuthToken, clientIP, userAgent string) (bool, error)
func (*UserAuthTokenServiceImpl) Run ¶
func (srv *UserAuthTokenServiceImpl) Run(ctx context.Context) error
func (*UserAuthTokenServiceImpl) UserAuthenticatedHook ¶
func (s *UserAuthTokenServiceImpl) UserAuthenticatedHook(user *models.User, c *models.ReqContext) error
func (*UserAuthTokenServiceImpl) UserSignedOutHook ¶
func (s *UserAuthTokenServiceImpl) UserSignedOutHook(c *models.ReqContext)
Click to show internal directories.
Click to hide internal directories.