Documentation ¶
Index ¶
- Constants
- func FinalAuthVerificationMiddleware(container di.Container) grpc.UnaryServerInterceptor
- func OAuth2UnaryServerInterceptor(oauth2Context *OAuth2Context) grpc.UnaryServerInterceptor
- type Claim
- type ClaimsPrincipal
- type DiscoveryDocument
- type DiscoveryDocumentOptions
- type GrpcFuncAuthConfig
- type JWTValidator
- type JWTValidatorOptions
- type MethodClaims
- type OAuth2Context
- type OAuth2DiscoveryOptions
- type OAuth2Document
Constants ¶
View Source
const (
CtxClaimsPrincipalKey = "ClaimsPrincipal"
)
Variables ¶
This section is empty.
Functions ¶
func FinalAuthVerificationMiddleware ¶
func FinalAuthVerificationMiddleware(container di.Container) grpc.UnaryServerInterceptor
func OAuth2UnaryServerInterceptor ¶
func OAuth2UnaryServerInterceptor(oauth2Context *OAuth2Context) grpc.UnaryServerInterceptor
Types ¶
type ClaimsPrincipal ¶
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 }
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
}
func NewJWTValidator ¶
func NewJWTValidator(options *JWTValidatorOptions) *JWTValidator
func (*JWTValidator) NewEmptyClaimsPrincipal ¶
func (jwtValidator *JWTValidator) NewEmptyClaimsPrincipal() *ClaimsPrincipal
func (*JWTValidator) ParseToken ¶
func (jwtValidator *JWTValidator) ParseToken(ctx context.Context, accessToken string) (*ClaimsPrincipal, error)
type JWTValidatorOptions ¶
type JWTValidatorOptions struct { OAuth2Document *OAuth2Document ClockSkewMinutes int }
Options is a struct for specifying configuration options.
type MethodClaims ¶
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)
func BuildOpenIdConnectContext ¶
func BuildOpenIdConnectContext(config *GrpcFuncAuthConfig) (*OAuth2Context, error)
type OAuth2DiscoveryOptions ¶
type OAuth2DiscoveryOptions struct {
JWKSURL string
}
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.