Documentation ¶
Index ¶
- func CreateAccessToken(id int, uid uuid.UUID) (string, error)
- func ExtractExpiresAtFromToken(accessToken string) (*jwt.NumericDate, error)
- func ExtractExpiresAtFromTokenInString(accessToken string) (string, error)
- func ExtractUserIDFromToken(accessToken string) (int, uuid.UUID, error)
- type AuthClaims
- type Authenticator
- func (a *Authenticator) DoesAccessTokenExpiredAtAvaliable(user *model.User, accessToken string) (bool, error)
- func (a *Authenticator) JWTAuth() gin.HandlerFunc
- func (a *Authenticator) ManualAuth(accessToken string) (bool, error)
- func (a *Authenticator) ValidateAccessToken(accessToken string) (bool, error)
- func (a *Authenticator) ValidateUser(user *model.User, id int, uid uuid.UUID) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractExpiresAtFromToken ¶ added in v0.0.8
func ExtractExpiresAtFromTokenInString ¶ added in v0.0.8
Types ¶
type AuthClaims ¶
type Authenticator ¶
func NewAuthenticator ¶
func NewAuthenticator(storage *model.Storage, cache *model.Cache) *Authenticator
func (*Authenticator) DoesAccessTokenExpiredAtAvaliable ¶ added in v0.0.8
func (a *Authenticator) DoesAccessTokenExpiredAtAvaliable(user *model.User, accessToken string) (bool, error)
for logout case
func (*Authenticator) JWTAuth ¶
func (a *Authenticator) JWTAuth() gin.HandlerFunc
func (*Authenticator) ManualAuth ¶
func (a *Authenticator) ManualAuth(accessToken string) (bool, error)
func (*Authenticator) ValidateAccessToken ¶
func (a *Authenticator) ValidateAccessToken(accessToken string) (bool, error)
func (*Authenticator) ValidateUser ¶
Click to show internal directories.
Click to hide internal directories.