Documentation
¶
Index ¶
- func DeleteAuthFromRedis(givenUuid string, client *redis.Client, ctx context.Context) (int64, error)
- func FetchAuth(authD *AccessDetails, client *redis.Client, ctx context.Context) (uint64, error)
- func GetAuthToken(r *http.Request) string
- func Refresh(refresh_token string, client *redis.Client, ctx context.Context) (map[string]string, error)
- func TokenValid(r string) error
- func VerifyToken(authHeaderToken string) (*jwt.Token, error)
- type AccessDetails
- type AuthHeaderKeyType
- type TokenDetails
- type Tokens
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAuthFromRedis ¶
func DeleteAuthFromRedis(givenUuid string, client *redis.Client, ctx context.Context) (int64, error)
delete key from redis
func Refresh ¶
func Refresh(refresh_token string, client *redis.Client, ctx context.Context) (map[string]string, error)
use refresh token to create new access token and refresh token
func TokenValid ¶
Types ¶
type AccessDetails ¶
func ExtractTokenMetadata ¶
func ExtractTokenMetadata(r string) (*AccessDetails, error)
type AuthHeaderKeyType ¶
type AuthHeaderKeyType string
const AuthHeaderKey AuthHeaderKeyType = "Authorization"
type TokenDetails ¶
type TokenDetails struct {
AccessToken string
RefreshToken string
AccessUuid string
RefreshUuid string
AtExpires int64
RtExpires int64
}
func CreateToken ¶
generate tokens and store it to redis
Click to show internal directories.
Click to hide internal directories.