proxy

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package proxy contains the core proxy functionality and aTLS configuration

Index

Constants

View Source
const (
	AttestationTypeHeader string = "X-Flashbots-Attestation-Type"
	MeasurementHeader     string = "X-Flashbots-Measurement"
)
View Source
const AvailableAttestationTypes string = "none, azure-tdx"

Variables

This section is empty.

Functions

func CreateAttestationIssuer

func CreateAttestationIssuer(log *slog.Logger, attestationType AttestationType) (atls.Issuer, error)

func CreateAttestationValidators

func CreateAttestationValidators(log *slog.Logger, attestationType AttestationType, jsonMeasurementsPath string) ([]atls.Validator, error)

func ExtractMeasurementsFromExtension

func ExtractMeasurementsFromExtension(ext *pkix.Extension, v variant.Variant) (map[uint32][]byte, error)

Types

type AttestationLogger

type AttestationLogger struct {
	Log *slog.Logger
}

func (AttestationLogger) Info

func (w AttestationLogger) Info(format string, args ...any)

func (AttestationLogger) Warn

func (w AttestationLogger) Warn(format string, args ...any)

type AttestationType

type AttestationType string
const (
	AttestationNone     AttestationType = "none"
	AttestationAzureTDX AttestationType = "azure-tdx"
)

func ParseAttestationType

func ParseAttestationType(attestationType string) (AttestationType, error)

type MultiValidator

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

MultiValidator is a validator for Azure confidential VM attestation using TDX which accepts multiple measurements

func NewMultiValidator

func NewMultiValidator(validators []atls.Validator) *MultiValidator

NewMultiValidator returns a new Validator for Azure confidential VM attestation using TDX which accepts multiple measurements

func (*MultiValidator) OID

func (*MultiValidator) Validate

func (v *MultiValidator) Validate(ctx context.Context, attDocRaw, nonce []byte) (userData []byte, err error)

type Proxy

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

func NewProxy

func NewProxy(log *slog.Logger, targetURL string, validators []atls.Validator) *Proxy

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Proxy) WithTransport

func (p *Proxy) WithTransport(transport *http.Transport) *Proxy

Jump to

Keyboard shortcuts

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