Versions in this module Expand all Collapse all v0 v0.0.2 Oct 18, 2023 Changes in this version + var VarianceTimer = 30000 * time.Millisecond + func Auth(accessCheckFunction AccessCheckFunction, endpoints KeycloakConfig) gin.HandlerFunc + func AuthCheck() func(tc *TokenContainer, ctx *gin.Context) bool + func GroupCheck(at []AccessTuple) func(tc *TokenContainer, ctx *gin.Context) bool + func RealmCheck(allowedRoles []string) func(tc *TokenContainer, ctx *gin.Context) bool + func RequestLogger(keys []string, contentKey string) gin.HandlerFunc + func UidCheck(at []AccessTuple) func(tc *TokenContainer, ctx *gin.Context) bool + type AccessCheckFunction func(tc *TokenContainer, ctx *gin.Context) bool + type AccessTuple struct + Role string + Service string + Uid string + type BuilderConfig struct + DisableSecurityCheck bool + FullCertsPath *string + Realm string + Service string + Url string + type Certs struct + Keys []KeyEntry + type ClaimMapperFunc func(jsonWebToken *jwt.JSONWebToken, keyCloakToken *KeyCloakToken) error + type KeyCloakToken struct + Acr string + AllowedOrigins []string + AuthTime int64 + Azp string + ClientSession string + CustomClaims interface{} + Email string + Exp int64 + FamilyName string + GivenName string + Iat int64 + Iss string + Jti string + Name string + Nbf int64 + Nonce string + PreferredUsername string + RealmAccess ServiceRole + ResourceAccess map[string]ServiceRole + SessionState string + Sub string + Typ string + type KeyEntry struct + Alg string + Crv string + E string + Kid string + Kty string + N string + Use string + X string + X5C []string + Y string + type KeycloakConfig struct + CustomClaimsMapper ClaimMapperFunc + FullCertsPath *string + Realm string + Url string + type RestrictedAccessBuilder interface + Build func() gin.HandlerFunc + RestrictButForRealm func(realmName string) RestrictedAccessBuilder + RestrictButForRole func(role string) RestrictedAccessBuilder + RestrictButForUid func(uid string) RestrictedAccessBuilder + func NewAccessBuilder(config BuilderConfig) RestrictedAccessBuilder + type ServiceRole struct + Roles []string + type TokenContainer struct + KeyCloakToken *KeyCloakToken + Token *oauth2.Token + func GetTokenContainer(token *oauth2.Token, config KeycloakConfig) (*TokenContainer, error) + func (t *TokenContainer) Valid() bool v0.0.1 Oct 18, 2023