go run.
securityhttp (flagship)
The fastest way to wire up sessions, CSRF, default-deny authorization, and a JSON login endpoint — five lines withsecurityhttp.NewHandler(...).
Basic HTTP Basic Auth
The minimal complete setup: in-memory users, a delegating password encoder, andmiddleware.BasicAuth protecting a couple of routes.
Authorization route rules
Adds route-rule authorization and a role hierarchy (ADMIN > STAFF > USER) on
top of HTTP Basic Auth, with default-deny and 401-vs-403 exception
translation.
Bearer-token resource server
A JWT-verifying resource server: HS256 tokens,scope → SCOPE_* authority
mapping, and route rules gating /api/admin/** against the rest of /api/**.
