oauth2

package
v0.1.319 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptionsCannotBeNil = "options cannot be nil"
)

Variables

This section is empty.

Functions

func OAuth2UnaryServerInterceptor

func OAuth2UnaryServerInterceptor(oauth2Context *OAuth2Context) grpc.UnaryServerInterceptor

OAuth2UnaryServerInterceptor ...

Types

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"`
}

DiscoveryDocument ...

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
}

GrpcFuncAuthConfig ...

func NewGrpcFuncAuthConfig

func NewGrpcFuncAuthConfig(authority string, expectedScheme string, clockSkewMinutes int) *GrpcFuncAuthConfig

NewGrpcFuncAuthConfig ...

type JWTValidator

type JWTValidator struct {
	Options *JWTValidatorOptions
}

JWTValidator struct

func NewJWTValidator

func NewJWTValidator(options *JWTValidatorOptions) *JWTValidator

NewJWTValidator creates a new *JWTValidator

func (*JWTValidator) ParseToken

func (jwtValidator *JWTValidator) ParseToken(ctx context.Context, accessToken string) (contracts_claimsprincipal.IClaimsPrincipal, 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
}

MethodClaims ...

type OAuth2Context

type OAuth2Context struct {
	OAuth2Document *OAuth2Document
	JWTValidator   *JWTValidator
	Scheme         string
	Config         *GrpcFuncAuthConfig
}

OAuth2Context ...

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
}

OAuth2Document ...

func (OAuth2Document) MarshalZerologObject

func (p OAuth2Document) MarshalZerologObject(e *zerolog.Event)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL