auth

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: MIT Imports: 7 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 MockTokenValidator

func MockTokenValidator() func(next http.Handler) http.Handler

func WithEmail

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

Types

type Azure

type Azure struct {
	ClientID string
	Tenant   string
	// contains filtered or unexported fields
}

func (Azure) Issuer

func (a Azure) Issuer() string

func (Azure) JwksEndpoint

func (a Azure) JwksEndpoint() string

func (*Azure) JwtOptions

func (a *Azure) JwtOptions() []jwt.ParseOption

func (*Azure) KeySetFrom added in v1.0.19

func (a *Azure) KeySetFrom(_ jwt.Token) (jwk.Set, error)

func (*Azure) SetupJwkSetAutoRefresh added in v1.0.19

func (a *Azure) SetupJwkSetAutoRefresh(ctx context.Context) error

func (*Azure) TokenValidatorMiddleware

func (a *Azure) TokenValidatorMiddleware() TokenValidator

type Google

type Google struct {
	ClientID       string
	AllowedDomains []string
	// contains filtered or unexported fields
}

func (*Google) JwtOptions

func (g *Google) JwtOptions() []jwt.ParseOption

func (*Google) KeySetFrom added in v1.0.19

func (g *Google) KeySetFrom(t jwt.Token) (jwk.Set, error)

func (*Google) ParseAndValidateToken

func (g *Google) ParseAndValidateToken(token string) (*User, error)

func (*Google) SetupJwkSetAutoRefresh

func (g *Google) SetupJwkSetAutoRefresh(ctx context.Context) error

func (*Google) TokenValidatorMiddleware

func (g *Google) TokenValidatorMiddleware() TokenValidator

type TokenValidator

type TokenValidator func(http.Handler) http.Handler

type User

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

Jump to

Keyboard shortcuts

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