Documentation ¶
Index ¶
- Constants
- Variables
- func FinalAuthVerificationMiddleware(container di.Container) grpc.UnaryServerInterceptor
- func OAuth2UnaryServerInterceptor(oauth2Context *OAuth2Context) grpc.UnaryServerInterceptor
- type ClaimsPrincipal
- type CtxClaimsPrincipalKeyStruct
- type DiscoveryDocument
- type DiscoveryDocumentOptions
- type GrpcFuncAuthConfig
- type JWTValidator
- type JWTValidatorOptions
- type MethodClaims
- type OAuth2Context
- type OAuth2DiscoveryOptions
- type OAuth2Document
Constants ¶
View Source
const (
OptionsCannotBeNil = "options cannot be nil"
)
Variables ¶
View Source
var CtxClaimsPrincipalKey = &CtxClaimsPrincipalKeyStruct{}
CtxClaimsPrincipalKey key
Functions ¶
func FinalAuthVerificationMiddleware ¶
func FinalAuthVerificationMiddleware(container di.Container) grpc.UnaryServerInterceptor
FinalAuthVerificationMiddleware evaluates the claims principal
func OAuth2UnaryServerInterceptor ¶
func OAuth2UnaryServerInterceptor(oauth2Context *OAuth2Context) grpc.UnaryServerInterceptor
OAuth2UnaryServerInterceptor ...
Types ¶
type ClaimsPrincipal ¶
type ClaimsPrincipal struct { Token jwxt.Token Claims []claimsprincipalContracts.Claim FastMap map[string]map[string]bool }
func ClaimsPrincipalFromClaimsMap ¶ added in v0.1.85
func ClaimsPrincipalFromClaimsMap(claimsMap map[string]interface{}) *ClaimsPrincipal
type CtxClaimsPrincipalKeyStruct ¶ added in v0.1.112
type CtxClaimsPrincipalKeyStruct struct{}
CtxClaimsPrincipalKeyStruct struct
type DiscoveryDocument ¶
type DiscoveryDocument struct { OAuth2Document *OAuth2Document Options *DiscoveryDocumentOptions DiscoveryURL url.URL Algorithms []string `json:"id_token_signing_alg_values_supported"` IntrospectionEndpoint string Issuer string `json:"issuer"` JWKSURL string `json:"jwks_uri"` }
func (DiscoveryDocument) MarshalZerologObject ¶
func (p DiscoveryDocument) MarshalZerologObject(e *zerolog.Event)
type DiscoveryDocumentOptions ¶
type DiscoveryDocumentOptions struct { Authority string OAuth2DiscoveryOptions OAuth2DiscoveryOptions }
DiscoveryDocumentOptions ...
type GrpcFuncAuthConfig ¶
type GrpcFuncAuthConfig struct { Authority string ExpectedScheme string ClockSkewMinutes int FullMethodNameToClaims map[string]MethodClaims }
func NewGrpcFuncAuthConfig ¶
func NewGrpcFuncAuthConfig(authority string, expectedScheme string, clockSkewMinutes int) *GrpcFuncAuthConfig
type JWTValidator ¶
type JWTValidator struct {
Options *JWTValidatorOptions
}
JWTValidator struct
func NewJWTValidator ¶
func NewJWTValidator(options *JWTValidatorOptions) *JWTValidator
NewJWTValidator creates a new *JWTValidator
func (*JWTValidator) NewEmptyClaimsPrincipal ¶
func (jwtValidator *JWTValidator) NewEmptyClaimsPrincipal() *ClaimsPrincipal
NewEmptyClaimsPrincipal creates an empty *ClaimsPrincipal
func (*JWTValidator) ParseToken ¶
func (jwtValidator *JWTValidator) ParseToken(ctx context.Context, accessToken string) (*ClaimsPrincipal, error)
ParseToken validates an produces a claims principal
type JWTValidatorOptions ¶
type JWTValidatorOptions struct { OAuth2Document *OAuth2Document ClockSkewMinutes int }
JWTValidatorOptions is a struct for specifying configuration options.
type MethodClaims ¶
type MethodClaims struct { OR []claimsprincipalContracts.Claim AND []claimsprincipalContracts.Claim }
type OAuth2Context ¶
type OAuth2Context struct { OAuth2Document *OAuth2Document JWTValidator *JWTValidator Scheme string Config *GrpcFuncAuthConfig }
func BuildOAuth2Context ¶
func BuildOAuth2Context(issuer string, JWKSURL string, config *GrpcFuncAuthConfig) (*OAuth2Context, error)
BuildOAuth2Context ...
func BuildOpenIdConnectContext ¶
func BuildOpenIdConnectContext(config *GrpcFuncAuthConfig) (*OAuth2Context, error)
BuildOpenIdConnectContext ...
type OAuth2DiscoveryOptions ¶
type OAuth2DiscoveryOptions struct {
JWKSURL string
}
OAuth2DiscoveryOptions ...
type OAuth2Document ¶
type OAuth2Document struct { Options *OAuth2DiscoveryOptions Issuer string `json:"issuer"` JWKSURL string `json:"jwks_uri"` // contains filtered or unexported fields }
func (OAuth2Document) MarshalZerologObject ¶
func (p OAuth2Document) MarshalZerologObject(e *zerolog.Event)
Click to show internal directories.
Click to hide internal directories.