provider

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Provider  string
	Issuer    string
	Audience  string
	JWTSecret []byte
	Logger    Logger
}

Config holds OAuth configuration (subset needed by provider)

type HMACValidator

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

HMACValidator validates JWT tokens using HMAC-SHA256 (backward compatibility)

func (*HMACValidator) Initialize

func (v *HMACValidator) Initialize(cfg *Config) error

Initialize sets up the HMAC validator with JWT secret and audience

func (*HMACValidator) ValidateToken

func (v *HMACValidator) ValidateToken(ctx context.Context, tokenString string) (*User, error)

ValidateToken validates JWT token using HMAC-SHA256

type Logger

type Logger interface {
	Debug(msg string, args ...interface{})
	Info(msg string, args ...interface{})
	Warn(msg string, args ...interface{})
	Error(msg string, args ...interface{})
}

Logger interface for pluggable logging

type OIDCValidator

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

OIDCValidator validates JWT tokens using OIDC/JWKS (Okta, Google, Azure)

func (*OIDCValidator) Initialize

func (v *OIDCValidator) Initialize(cfg *Config) error

Initialize sets up the OIDC validator with provider discovery

func (*OIDCValidator) ValidateToken

func (v *OIDCValidator) ValidateToken(ctx context.Context, tokenString string) (*User, error)

ValidateToken validates JWT token using OIDC/JWKS

type TokenValidator

type TokenValidator interface {
	ValidateToken(ctx context.Context, token string) (*User, error)
	Initialize(cfg *Config) error
}

TokenValidator interface for OAuth token validation

type User

type User struct {
	Username string
	Email    string
	Subject  string
}

User represents an authenticated user

Jump to

Keyboard shortcuts

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