Documentation
¶
Overview ¶
Package request provides common request-related types used across the Parsec system.
This package contains types that represent HTTP/RPC request context and attributes, which are used by multiple packages including trust validation and token issuance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestAttributes ¶
type RequestAttributes struct {
// Method is the HTTP method or RPC method name
Method string `json:"method,omitempty"`
// Path is the request path/resource being accessed
Path string `json:"path,omitempty"`
// IPAddress is the client IP address
IPAddress string `json:"ip_address,omitempty"`
// UserAgent is the client user agent
UserAgent string `json:"user_agent,omitempty"`
// Headers contains relevant HTTP headers
Headers map[string]string `json:"headers,omitempty"`
// Additional arbitrary context
// This can include:
// - "host": The HTTP host header
// - "context_extensions": Envoy's context extensions (map[string]string)
// - Custom application-specific context
// Note: No omitempty tag to ensure this field is always present in JSON,
// even when empty, for CEL filter expressions to work correctly
Additional map[string]any `json:"additional"`
}
RequestAttributes contains attributes about the incoming request This is used for both token issuance context and validator filtering decisions All fields are exported and JSON-serializable
func FromClaims ¶
func FromClaims(filteredClaims claims.Claims) *RequestAttributes
FromClaims constructs RequestAttributes from filtered claims This is used when the client provides request_context claims that have been filtered The function maps well-known claim names to RequestAttributes fields