Help us shape the future of Go! Take the 2026 Go Developer Survey

request

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

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

Jump to

Keyboard shortcuts

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