Help us shape the future of Go! Take the 2026 Go Developer Survey

middleware

command
v0.1.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: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

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