token

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEmail

func GetEmail(ctx context.Context) string

func MockMiddleware

func MockMiddleware() func(next http.Handler) http.Handler

func WithEmail

func WithEmail(ctx context.Context, email string) context.Context

Types

type Config

type Config struct {
	ClientID       string
	Issuer         string
	Endpoint       string
	AllowedDomains []string
}

func (Config) Validate

func (c Config) Validate() error

type KeySetProvider

type KeySetProvider struct {
	// contains filtered or unexported fields
}

func NewKSP

func NewKSP(ctx context.Context, jwksURL string) (*KeySetProvider, error)

func (*KeySetProvider) KeySetFrom

func (ksp *KeySetProvider) KeySetFrom(tok jwt.Token) (jwk.Set, error)

KeySetFrom ignores the provided token and fetches the JWKS from the configured endpoint. This makes sense as we have one handler per issuer.

type Parser

type Parser interface {
	ParseString(string) (*User, error)
	ParseHeader(http.Header, string) (*User, error)
}

type User

type User struct {
	ID     string
	Email  string
	Groups []string
}

type Validator

type Validator func(http.Handler) http.Handler

func Middleware

func Middleware(h Parser) Validator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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