handlers

package
v1.0.6 Latest Latest
Warning

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

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

Documentation

Overview

Package handlers provides HTTP request handlers for the Gate API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizedInputErrorHandler added in v1.0.6

func SanitizedInputErrorHandler(w http.ResponseWriter, r *http.Request, err error)

SanitizedInputErrorHandler returns a safe error response without exposing internal details.

Types

type ErrorResponse

type ErrorResponse struct {
	Code              string `json:"error_code"`
	Message           string `json:"error"`
	RequestID         string `json:"request_id"`
	RetryAfterSeconds int    `json:"retry_after_seconds,omitempty"`
}

ErrorResponse is the JSON body returned for all exchange failures.

type ExchangeHandler

type ExchangeHandler struct {
	// contains filtered or unexported fields
}

ExchangeHandler handles POST /api/v1/exchange requests.

func NewExchangeHandler

func NewExchangeHandler(service sts.Exchanger) (*ExchangeHandler, error)

NewExchangeHandler creates an ExchangeHandler with the given STS service. It pulls a tracer and meters from the global OTel providers.

func (*ExchangeHandler) Exchange

func (h *ExchangeHandler) Exchange(w http.ResponseWriter, r *http.Request)

Exchange delegates to the STS service and writes the response.

type ExchangeInput

type ExchangeInput struct {
	Body sts.ExchangeRequest `in:"body=json"`
}

ExchangeInput is the httpin-decoded input for the exchange endpoint.

type InfoHandler

type InfoHandler struct {
	// contains filtered or unexported fields
}

InfoHandler serves build and configuration information.

func NewInfoHandler

func NewInfoHandler(providersSHA256 string) *InfoHandler

NewInfoHandler creates an InfoHandler reporting providersSHA256, the fingerprint of the trusted issuers (see config.PolicyConfig.IssuersFingerprint).

func (*InfoHandler) GetInfo

func (h *InfoHandler) GetInfo(w http.ResponseWriter, r *http.Request)

GetInfo writes build and configuration information as JSON.

type InfoResponse

type InfoResponse struct {
	FIPSEnabled     bool   `json:"fips_enabled"`
	ProvidersSHA256 string `json:"providers_sha256"`
}

InfoResponse is the JSON body returned by the info endpoint.

Jump to

Keyboard shortcuts

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