proxy

package
v0.0.0-...-3e5e6b6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(targetOrigin, proxyPath string, transport http.RoundTripper) (*httputil.ReverseProxy, error)

Types

type AdapterConfig

type AdapterConfig struct {
	MsgBodySizeLimit int
}

AdapterConfig stores the configuration for the adapter transport

type AdapterTokenClaims

type AdapterTokenClaims struct {
	ExtraAttributes map[string]interface{} `json:"ext_attr"`
	Scopes          []string               `json:"scope"`
	ConsumerID      string                 `json:"client_id"`
	jwt.StandardClaims
}

type AdapterTransport

type AdapterTransport struct {
	http.RoundTripper
	// contains filtered or unexported fields
}

func NewAdapterTransport

func NewAdapterTransport(sink AuditlogService, svc PreAuditlogService, trip RoundTrip, config AdapterConfig) *AdapterTransport

func (*AdapterTransport) RoundTrip

func (t *AdapterTransport) RoundTrip(req *http.Request) (resp *http.Response, err error)

type AuditlogMessage

type AuditlogMessage struct {
	CorrelationIDHeaders correlation.Headers
	Request              string
	Response             string
	Claims
}

type AuditlogService

type AuditlogService interface {
	Log(ctx context.Context, msg AuditlogMessage) error
}

type Claims

type Claims struct {
	Tenant         string `json:"tenant"`
	ConsumerTenant string `json:"consumerTenant"`
	Scopes         string `json:"scopes"`
	ConsumerID     string `json:"consumerID"`
	ConsumerType   string `json:"consumerType"`
	OnBehalfOf     string `json:"onBehalfOf"`
	Subject        string `json:"subject"`
}

func (Claims) Valid

func (c Claims) Valid() error

type PreAuditlogService

type PreAuditlogService interface {
	AuditlogService
	PreLog(ctx context.Context, msg AuditlogMessage) error
}

type Proxy

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

type RoundTrip

type RoundTrip interface {
	RoundTrip(*http.Request) (*http.Response, error)
}

type Transport

type Transport struct {
	http.RoundTripper
	// contains filtered or unexported fields
}

func NewTransport

func NewTransport(sink AuditlogService, svc PreAuditlogService, trip RoundTrip) *Transport

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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