Documentation
¶
Index ¶
- func BasicClientCreds(request events.APIGatewayProxyRequest) (clientID, clientSecret string, ok bool)
- func Cookie(request events.APIGatewayProxyRequest, name string) string
- func ExtractAuthToken(headers map[string]string) string
- func ExtractRequestStruct(request events.APIGatewayProxyRequest, inputRequest any, ...) error
- func GetRequest(request events.APIGatewayProxyRequest, inputStruct any) error
- func ParsePageSize(params map[string]string, defaultPageSize ...int64) int64
- func RedactForLog(request events.APIGatewayProxyRequest) events.APIGatewayProxyRequest
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 ¶
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 ¶
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 ¶
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 ¶
func RedactForLog(request events.APIGatewayProxyRequest) events.APIGatewayProxyRequest
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.