Documentation
¶
Overview ¶
Package legalhttp mounts the legal module's HTTP surface: the logged-in re-acceptance endpoint and the platform-admin acceptance-history / compliance endpoints. Products call Mount + MountAdmin from main.go — the same shape as billinghttp (user routes ride the global middleware chain; admin routes take the injected platform-admin guard).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Mount ¶
Mount wires the logged-in legal endpoints. Every route is behind the global Authenticate chain; webx.P rejects anonymous callers with 401. A nil Svc panics — same fail-fast wiring contract as AdminDeps.Guard below: a nil-service handler would only blow up on the first request, long after the wiring mistake was cheap to fix.
func MountAdmin ¶
MountAdmin wires the admin legal endpoints (acceptance history lookup for disputes, compliance reconciliation for the admin card).
Types ¶
type AdminDeps ¶
type AdminDeps struct {
Mod *legal.Module
Svc *legal.Service
Guard func(http.Handler) http.Handler
}
AdminDeps mounts the operator-facing legal endpoints. Guard is the platform-admin middleware — pass adminhttp.PlatformAdminGuard(); a nil Guard panics (an unguarded admin route is a security hole, not a degraded feature — same discipline as billinghttp/settingshttp AdminDeps).