rmngrequest

package
v0.0.0-...-d47c137 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicClientCreds

func BasicClientCreds(request events.APIGatewayProxyRequest) (clientID, clientSecret string, ok bool)

BasicClientCreds decodes RFC 7617 Basic client credentials from the Authorization header; ok is false when it is absent or not Basic.

func Cookie(request events.APIGatewayProxyRequest, name string) string

Cookie returns the named cookie's value from the request's Cookie header, or "" if absent.

func ExtractAuthToken

func ExtractAuthToken(headers map[string]string) string

ExtractAuthToken returns the bearer token from the Authorization header, or "" if absent.

func ExtractRequestStruct

func ExtractRequestStruct(request events.APIGatewayProxyRequest, inputRequest any, customValidationFuncs ...validation.ValidationFunc) error

func GetRequest

func GetRequest(request events.APIGatewayProxyRequest, inputStruct any) error

inputStruct is a pointer to a struct. The body is decoded into it as JSON, or — when Content-Type is application/x-www-form-urlencoded — parsed as form values and mapped into the struct through the same path as query params. Query params overlay last.

func ParsePageSize

func ParsePageSize(params map[string]string, defaultPageSize ...int64) int64

ParsePageSize parses the "page_size" query parameter from a query-param map. Returns the parsed value, or the default (20, or the first override if provided) if absent/invalid.

func RedactForLog

RedactForLog returns a copy of the request safe to log: the Authorization header (single- and multi-value forms, case-insensitive) is replaced with a placeholder so bearer tokens never land in the logs. The request is taken by value and the header maps are copied, so the caller's original is untouched and remains usable for token extraction.

Types

This section is empty.

Jump to

Keyboard shortcuts

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