Documentation ¶
Overview ¶
Package authsrv handle authorization token operations.
Index ¶
- func BearerTokensFromRefresh(refreshToken string) (*models.BearerToken, error)
- func BearerTokensFromUser(user *models.User) (*models.BearerToken, error)
- func GetToken(tokenString string) (*jwt.Token, error)
- func HasRole(role string, token *jwt.Token) bool
- func RevokeRefreshTokenFromAccess(token *jwt.Token) error
- func Roles(token *jwt.Token) []string
- func UserID(token *jwt.Token) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BearerTokensFromRefresh ¶
func BearerTokensFromRefresh(refreshToken string) (*models.BearerToken, error)
BearerTokensFromRefresh return a new AccessToken
func BearerTokensFromUser ¶
func BearerTokensFromUser(user *models.User) (*models.BearerToken, error)
BearerTokensFromUser return both new Access and Refresh tokens.
func GetToken ¶
GetToken return a token from a accessToken string. Return nil if the accessToken string is invalid or if the token as expired.
func RevokeRefreshTokenFromAccess ¶
RevokeRefreshTokenFromAccess remove a RefreshToken from DB from an accessToken
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.