legalhttp

package
v0.23.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 3 Imported by: 0

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

func Mount(mux webx.Router, d Deps)

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

func MountAdmin(mux webx.Router, d AdminDeps)

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).

type Deps

type Deps struct {
	Svc *legal.Service
}

Deps carries the user-facing surface. Svc is required.

Jump to

Keyboard shortcuts

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