middleware

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

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