auth

package
v6.0.0-beta1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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 (*UserAuthTokenServiceImpl) UserAuthenticatedHook

func (s *UserAuthTokenServiceImpl) UserAuthenticatedHook(user *models.User, c *models.ReqContext) error

func (*UserAuthTokenServiceImpl) UserSignedOutHook

func (s *UserAuthTokenServiceImpl) UserSignedOutHook(c *models.ReqContext)

Jump to

Keyboard shortcuts

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