Documentation
¶
Overview ¶
Package middleware provides Gin middleware for admin-api's route groups.
Index ¶
Constants ¶
View Source
const ( // ActingUserSubKey is the gin.Context key write handlers read to get the // attributed acting user after WriteAuth has validated the request. ActingUserSubKey = "actingUserSub" )
Variables ¶
This section is empty.
Functions ¶
func WriteAuth ¶
func WriteAuth(client *authz.Client) gin.HandlerFunc
WriteAuth requires a forwarded user bearer token carrying the admin role, verified against auth-api's /authz/check. On success, the acting user (from auth-api's verified token subject) is stashed on the context under ActingUserSubKey for handlers to attribute their audit records to.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.