Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth0Provider ¶
type Auth0Provider struct {
// contains filtered or unexported fields
}
func NewAuth0Provider ¶
func NewAuth0Provider(config JWTConfig) (*Auth0Provider, error)
func (*Auth0Provider) KeyFunc ¶
func (p *Auth0Provider) KeyFunc() jwt.Keyfunc
func (*Auth0Provider) SetContextValues ¶
func (*Auth0Provider) VerifyAudience ¶
func (p *Auth0Provider) VerifyAudience(claims jwt.MapClaims) bool
func (*Auth0Provider) VerifyIssuer ¶
func (p *Auth0Provider) VerifyIssuer(claims jwt.MapClaims) bool
type FirebaseProvider ¶
type FirebaseProvider struct {
// contains filtered or unexported fields
}
func NewFirebaseProvider ¶
func NewFirebaseProvider(config JWTConfig) (*FirebaseProvider, error)
func (*FirebaseProvider) KeyFunc ¶
func (p *FirebaseProvider) KeyFunc() jwt.Keyfunc
func (*FirebaseProvider) SetContextValues ¶
func (*FirebaseProvider) VerifyAudience ¶
func (p *FirebaseProvider) VerifyAudience(claims jwt.MapClaims) bool
func (*FirebaseProvider) VerifyIssuer ¶
func (p *FirebaseProvider) VerifyIssuer(claims jwt.MapClaims) bool
type GenericProvider ¶
type GenericProvider struct {
// contains filtered or unexported fields
}
func NewGenericProvider ¶
func NewGenericProvider(config JWTConfig) (*GenericProvider, error)
func (*GenericProvider) KeyFunc ¶
func (p *GenericProvider) KeyFunc() jwt.Keyfunc
func (*GenericProvider) SetContextValues ¶
func (*GenericProvider) VerifyAudience ¶
func (p *GenericProvider) VerifyAudience(claims jwt.MapClaims) bool
func (*GenericProvider) VerifyIssuer ¶
func (p *GenericProvider) VerifyIssuer(claims jwt.MapClaims) bool
type JWKSProvider ¶
type JWKSProvider struct {
// contains filtered or unexported fields
}
func NewJWKSProvider ¶
func NewJWKSProvider(config JWTConfig) (*JWKSProvider, error)
func (*JWKSProvider) KeyFunc ¶
func (p *JWKSProvider) KeyFunc() jwt.Keyfunc
func (*JWKSProvider) SetContextValues ¶
func (*JWKSProvider) VerifyAudience ¶
func (p *JWKSProvider) VerifyAudience(claims jwt.MapClaims) bool
func (*JWKSProvider) VerifyIssuer ¶
func (p *JWKSProvider) VerifyIssuer(claims jwt.MapClaims) bool
type JWTConfig ¶
type JWTConfig struct {
Provider string
Secret string
PubKeyFile string `mapstructure:"public_key_file"`
PubKeyType string `mapstructure:"public_key_type"`
Audience string `mapstructure:"audience"`
Issuer string `mapstructure:"issuer"` //like "http://my-domain.auth0.com"
JWKSURL string `mapstructure:"jwks_url"` //URL of the JWKS endpoint, like "https://YOUR_DOMAIN/.well-known/jwks.json"
JWKSRefresh int `mapstructure:"jwks_refresh"` //static minutes interval between refreshes, overriding the adaptive token refreshing
JWKSMinRefresh int `mapstructure:"jwks_min_refresh"` //minutes fallback value when tokens are refreshed, default to 60 minutes
}
JWTConfig struct contains JWT authentication related config values used by the GraphJin service
type JWTProvider ¶
type JWTProvider interface {
KeyFunc() jwt.Keyfunc
VerifyAudience(jwt.MapClaims) bool
VerifyIssuer(jwt.MapClaims) bool
SetContextValues(context.Context, jwt.MapClaims) (context.Context, error)
}
JWTProvider is the interface to define providers for doing JWT authentication.
func NewProvider ¶
func NewProvider(config JWTConfig) (JWTProvider, error)
Click to show internal directories.
Click to hide internal directories.