Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetParentRefreshTokenID ¶
GetParentRefreshTokenID returns the parent refresh token ID
Types ¶
type AccessTokenClaims ¶
type AccessTokenClaims struct {
ParentRefreshTokenID string `json:"prt,omitempty"`
jwt.RegisteredClaims
}
AccessTokenClaims is the structure for the JWT claims
func NewAccessTokenClaims ¶
func NewAccessTokenClaims( id int64, subject string, issuedAt, expiresAt time.Time, parentRefreshTokenID int64, ) *AccessTokenClaims
NewAccessTokenClaims creates a new JWT access token claims
type DefaultValidator ¶
type DefaultValidator struct {
// contains filtered or unexported fields
}
DefaultValidator struct
func NewDefaultValidator ¶
func NewDefaultValidator( postgresService *internalpostgres.Service, tokenValidator gojwtcache.TokenValidator, ) (*DefaultValidator, error)
NewDefaultValidator creates a new default validator
func (*DefaultValidator) IsAccessTokenValid ¶
func (d *DefaultValidator) IsAccessTokenValid(id string) (bool, error)
IsAccessTokenValid checks if the access token is valid
func (*DefaultValidator) IsRefreshTokenValid ¶
func (d *DefaultValidator) IsRefreshTokenValid(id string) (bool, error)
IsRefreshTokenValid checks if the refresh token is valid
func (*DefaultValidator) ValidateClaims ¶
func (d *DefaultValidator) ValidateClaims( claims *jwt.MapClaims, token gojwttoken.Token, ) (bool, error)
ValidateClaims validates the claims
type RefreshTokenClaims ¶
type RefreshTokenClaims struct {
jwt.RegisteredClaims
}
RefreshTokenClaims is the structure for the JWT claims
func NewRefreshTokenClaims ¶
func NewRefreshTokenClaims( id int64, subject string, issuedAt, expiresAt time.Time, ) *RefreshTokenClaims
NewRefreshTokenClaims creates a new JWT refresh token claims
Click to show internal directories.
Click to hide internal directories.