Documentation ¶
Index ¶
Constants ¶
View Source
const TokenDataContextKey = "tokenData"
Variables ¶
This section is empty.
Functions ¶
func CheckTokenMiddleware ¶
func CheckTokenMiddleware(baseToken TokenBase) gin.HandlerFunc
Types ¶
type TokenBase ¶
type TokenBase interface { CreateTokensPair(c context.Context, now time.Time, sessionId string, customerId string, protectedData map[string]interface{}, plainData map[string]interface{}) (string, string, error) ValidateAndGetData(c context.Context, now time.Time, token string) (map[string]interface{}, map[string]interface{}, error) ValidateAndUseRefreshToken(c context.Context, now time.Time, token string) (map[string]interface{}, map[string]interface{}, error) RemoveRefreshToken(c context.Context, now time.Time, token string) error RemoveRefreshTokenById(c context.Context, id string) error }
func NewJwtToken ¶
func NewJwtToken(credentials credentials.CredentialsGetter, cacheGetter cache.CacheStorageGetter, cacheSetter cache.CacheStorageSetter) TokenBase
Click to show internal directories.
Click to hide internal directories.