oauth

package
v0.0.0-...-0c576d6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTokenClaimsFailed = errors.New("failed to parse token claims")
View Source
var ErrTokenScopesMismatch = errors.New("one or more required scopes not found")
View Source
var ErrTokenVerificationFailed = errors.New("failed to verify token")

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Expiry int64  `json:"exp"`
	Scopes string `json:"scope"`
}

type OAuthValidator

type OAuthValidator struct {
	IssuerUrl      string
	RequiredScopes []string
	// contains filtered or unexported fields
}

func NewOAuthValidator

func NewOAuthValidator(ctx context.Context, issuerUrl string, requiredScopes string) (*OAuthValidator, error)

func (*OAuthValidator) Health

func (*OAuthValidator) ValidateJWT

func (v *OAuthValidator) ValidateJWT(ctx context.Context, token string) (Claims, error)

type PassthroughValidator

type PassthroughValidator struct{}

func (PassthroughValidator) Health

func (PassthroughValidator) ValidateJWT

func (v PassthroughValidator) ValidateJWT(_ context.Context, _ string) (Claims, error)

type Validator

type Validator interface {
	health.Checkable
	ValidateJWT(ctx context.Context, token string) (Claims, error)
}

Jump to

Keyboard shortcuts

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