http

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 7 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 SubrouteInfos added in v0.4.0

func SubrouteInfos() []webx.RouteInfo

SubrouteInfos returns the absolute routes the sub-mux serves once Mount mounts it under "/api/workspaces/{workspaceId}/": subroutePrefix applied to each recorded sub-mux pattern. The root router records only the subtree mount (no method prefix — not an endpoint), so runtime route enumeration — e.g. a contract test comparing mounted routes against the OpenAPI spec — must consult this list in addition to the root Mux.Routes(). It shares the registration with the serving path (workspaceSubroutes), so the two cannot drift; the zero-value Deps only produce handler closures that are never invoked here.

func WorkspaceHeaderCtx

func WorkspaceHeaderCtx(members MemberChecker) func(http.Handler) http.Handler

Types

type Deps

type Deps struct {
	Svc     *app.WorkspaceService
	Members MemberChecker

	Authz *authz.Authorizer

	// StepUp, when non-nil, wraps the domain's destructive operations (delete
	// workspace, transfer ownership). Products mount
	// webx.RequireRecentAuth(maxAge) here — requiring a fresh password
	// confirmation for destructive actions is a product policy, the domain
	// only marks which operations are destructive. Nil = no step-up.
	StepUp func(http.Handler) http.Handler

	// StrongGuard, when non-nil, replaces StepUp on exactly the destructive
	// pair (delete workspace / transfer ownership): the product's
	// strong-profile middleware (catalog evaluator + challenge projection,
	// ADR 0013 batch 1) computed from the operation catalog. StepUp stays in
	// force for the remaining sensitive routes (role perms set/reset) — the
	// two roads may coexist across operations but NEVER on the same
	// operation: a static challenge after a computed one completes can never
	// be satisfied (ADR 0011's double-mount prohibition). Nil = the pair
	// stays on StepUp (simple-profile consumers).
	StrongGuard func(http.Handler) http.Handler
}

type MemberChecker

type MemberChecker interface {
	GetMember(ctx context.Context, workspaceID, userID string) (app.Member, bool, error)
}

Jump to

Keyboard shortcuts

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