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() gin.HandlerFunc
WriteAuth requires a valid X-Internal-Service-Token header (compared constant-time against INTERNAL_SERVICE_TOKEN) and a non-empty X-Acting-User-Sub header, matching users-api's InternalServiceAuth contract for the same caller (admin-web). An unset or empty INTERNAL_SERVICE_TOKEN permanently disables the write path rather than trusting an empty token. On success, the acting user 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.