proxy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: AGPL-3.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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(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