middleware

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrInvalidClient

func ErrInvalidClient(msg string) error

ErrInvalidClient creates an error for client authentication failures

func ErrInvalidConfig

func ErrInvalidConfig(msg string) error

ErrInvalidConfig creates an error for invalid middleware configuration

func ErrInvalidGrant

func ErrInvalidGrant(msg string) error

ErrInvalidGrant creates an error for grant-related issues (expired, replayed)

func ErrInvalidMetadata

func ErrInvalidMetadata(msg string) error

ErrInvalidMetadata creates an error for invalid client metadata

func ErrInvalidRequest

func ErrInvalidRequest(msg string) error

ErrInvalidRequest creates an error for invalid request parameters

func ErrServerError

func ErrServerError(msg string) error

ErrServerError creates an error for server-side errors

func ErrSignatureVerification

func ErrSignatureVerification(underlying error) error

ErrSignatureVerification creates an error for signature verification failures

Types

type AuthError

type AuthError struct {
	Code        string `json:"error"`
	Description string `json:"error_description"`
}

AuthError represents an authentication error with OAuth 2.0 error codes

func (AuthError) Error

func (e AuthError) Error() string

func (AuthError) ToFiberError

func (e AuthError) ToFiberError(status int) *fiber.Error

ToFiberError converts an AuthError to a Fiber error with appropriate HTTP status

type PrivateKeyJWTAuth

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

PrivateKeyJWTAuth implements private_key_jwt authentication middleware

func NewPrivateKeyJWTAuth

func NewPrivateKeyJWTAuth(
	entityID string,
	fedEntity oidfed.FederationEntity,
	trustAnchorIDs []string,
	taResolver TAResolver,
	jtiStorage model.JTIStorageBackend,
) (*PrivateKeyJWTAuth, error)

NewPrivateKeyJWTAuth creates a new private_key_jwt authentication middleware. The trustAnchorIDs are resolved to oidfed.TrustAnchors at request time via taResolver, so JWKS updates propagate live.

func (*PrivateKeyJWTAuth) Middleware

func (a *PrivateKeyJWTAuth) Middleware() fiber.Handler

Middleware returns the Fiber middleware handler for private_key_jwt authentication

type TAResolver added in v0.22.0

type TAResolver func(entityIDs []string) oidfed.TrustAnchors

TAResolver resolves trust anchor entity IDs to oidfed.TrustAnchors at request time. This allows JWKS updates to propagate live without restarting the middleware.

Jump to

Keyboard shortcuts

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