Documentation
¶
Overview ¶
Command middleware shows rbac's HTTP middleware behind an authentication layer of your own. The authenticate function stands in for any library that verifies bearer tokens: it hands the verified claims to rbac with rbac.ContextWithClaims. (A library that keeps claims under its own context key works too, with rbac.WithClaimsSource.)
go run ./examples/middleware
Users: alice is an editor, bob a viewer; any other token is rejected.
Click to show internal directories.
Click to hide internal directories.