oidc

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package oidc provides a supported-adapter integration wrapper for OIDC auth.

Use NewFromEnv when application bootstrap wants environment-loaded OIDC/JWKS bearer-token middleware and a readiness health checker from one construction path. The wrapper delegates validation behavior to middleware/auth/oidc and keeps configuration loading in the contrib module.

Treat issuer, audience, JWKS URL, and allowed algorithms as production security configuration. Do not use placeholder identity-provider values in deployed services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthChecker

func HealthChecker(cfg Config, client *http.Client) ports.HealthChecker

HealthChecker returns a health checker for OIDC JWKS.

func WithSubject

func WithSubject(ctx context.Context, subj Subject) context.Context

WithSubject stores the authenticated subject in context.

Types

type Config

type Config = oidc.Config

Config aliases the OIDC middleware configuration.

func LoadConfig

func LoadConfig(loader *config.Loader) Config

LoadConfig reads OIDC configuration from environment.

type Middleware

type Middleware = oidc.Middleware

Middleware aliases the OIDC middleware.

func NewMiddleware

func NewMiddleware(ctx context.Context, cfg Config, log ports.Logger) (*Middleware, error)

NewMiddleware creates an OIDC middleware.

type Subject

type Subject = oidc.Subject

Subject aliases the OIDC subject payload.

func SubjectFromContext

func SubjectFromContext(ctx context.Context) (Subject, bool)

SubjectFromContext retrieves the subject from context.

Jump to

Keyboard shortcuts

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