auth

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package auth defines the authenticated identity carried by control-plane requests.

Package auth defines the authenticated identity carried by control-plane requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OIDCMiddleware

func OIDCMiddleware(issuer, clientID, tenantClaim string, next http.Handler) (http.Handler, error)

OIDCMiddleware authenticates control-plane requests with an OIDC ID token (Authorization: Bearer <id_token>) issued by the configured issuer. The token's subject becomes the Principal subject; the tenant claim (default "tenant", configurable) becomes the tenant scope every store query is bounded by. This is the production identity path the tech baseline requires before any non-development deployment.

func StaticMiddleware

func StaticMiddleware(principal Principal, next http.Handler) http.Handler

StaticMiddleware is intentionally suitable only for a single-tenant local development server. Production deployments must replace it with verified workload or user identity middleware.

func WithPrincipal

func WithPrincipal(ctx context.Context, principal Principal) context.Context

Types

type Principal

type Principal struct {
	Subject  string
	TenantID string
}

func PrincipalFromContext

func PrincipalFromContext(ctx context.Context) (Principal, bool)

Jump to

Keyboard shortcuts

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