http

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(mux webx.Router, d Deps)

func MountFedAdmin

func MountFedAdmin(mux webx.Router, d Deps)

func MountMFA added in v0.5.0

func MountMFA(mux webx.Router, d Deps)

MountMFA registers the MFA routes. MFAChangeGuard (when set) wraps the settings-mutating routes — a product policy guard such as webx.RequireRecentAuth(15 * time.Minute).

func Routes

func Routes(d Deps) http.Handler

Types

type Deps

type Deps struct {
	AuthCfg     webx.AuthConfig
	Sessions    webx.SessionStore
	PATs        webx.PATLookup
	SessionsSvc *app.SessionService
	Tokens      *app.TokenService

	Account *app.AccountService

	OAuth *app.OAuthService

	Fed *app.FedService

	FedAdminGuard func(http.Handler) http.Handler

	// MFA, when non-nil, mounts the TOTP flows (ADR 0013 batch 2):
	// /auth/mfa/* + POST /auth/verify-mfa. Nil = the capability is absent,
	// not degraded — MFA cannot half-exist.
	MFA *app.MFAService

	// MFAChangeGuard wraps the MFA settings-mutating routes (disable /
	// regenerate-backup-codes) in the product's step-up policy — e.g.
	// webx.RequireRecentAuth(15 * time.Minute), mirroring GitHub's
	// sudo-guarded 2FA settings. The window is product policy (no package
	// default). Nil = no guard (dev convenience; production should set it).
	MFAChangeGuard func(http.Handler) http.Handler

	// PATCreateGuard, when non-nil, wraps POST /api/tokens — the product's
	// gate for PAT creation (GitHub guards token generation behind sudo /
	// AAL2 step-up; the strong-profile road mounts its catalog middleware
	// here, the simple road webx.RequireRecentAuth / RequireRecentMFA).
	// Nil = creation needs only a human session.
	PATCreateGuard func(http.Handler) http.Handler

	OAuthAppURL string

	TrustedProxies []*net.IPNet
}

Jump to

Keyboard shortcuts

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