Versions in this module Expand all Collapse all v0 v0.0.2 Aug 16, 2024 Changes in this version + const HEADER_PREFIX + func AuthMiddleware(config *AuthConfig) gin.HandlerFunc + func CreateToken(privateKey string, tokenClaims jwt.Claims) (string, error) + func ParseToken(publicKey string, tokenString string, tokenClaims jwt.Claims) error + func SetAuthContext(context *gin.Context, authContext *AuthContext) + type AuthClaims struct + ClientId string + Name string + Scope string + type AuthConfig struct + Enabled bool + ExcludeUrls []string + IncludeUrls []string + PrivateKey string + PublicKey string + TokenIssuer string + TokenValidity int64 + type AuthContext struct + Claims *AuthClaims + Scopes []string + func GetAuthContext(context *gin.Context) *AuthContext + func (context *AuthContext) HasAndScope(scopes ...string) bool + func (context *AuthContext) HasAnyScope(scopes ...string) bool + func (context *AuthContext) HasScope(scope string) bool