mutate

package
v0.0.0-...-136a2fa Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrMalformedResponseFromUpstreamAPI = "The call to an external API returned an invalid JSON object"
	ErrMissingAPIURL                    = "Missing URL in mutator configuration"
	ErrInvalidAPIURL                    = "Invalid URL in mutator configuration"
	ErrNon200ResponseFromAPI            = "The call to an external API returned a non-200 HTTP response"
	ErrInvalidCredentials               = "Invalid credentials were provided in mutator configuration"
	ErrNoCredentialsProvided            = "No credentials were provided in mutator configuration"
)

Variables

View Source
var ErrMutatorNotEnabled = herodot.DefaultError{
	ErrorField:  "mutator matching this route is misconfigured or disabled",
	CodeField:   http.StatusInternalServerError,
	StatusField: http.StatusText(http.StatusInternalServerError),
}

Functions

func NewErrMutatorMisconfigured

func NewErrMutatorMisconfigured(a Mutator, err error) *herodot.DefaultError

func NewErrMutatorNotEnabled

func NewErrMutatorNotEnabled(a Mutator) *herodot.DefaultError

Types

type BasicAuth

type BasicAuth struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type CredentialsCookiesConfig

type CredentialsCookiesConfig struct {
	Cookies map[string]string `json:"cookies"`
}

type CredentialsIDTokenConfig

type CredentialsIDTokenConfig struct {
	Claims    string `json:"claims"`
	IssuerURL string `json:"issuer_url"`
	JWKSURL   string `json:"jwks_url"`
	TTL       string `json:"ttl"`
}

func (*CredentialsIDTokenConfig) ClaimsTemplateID

func (c *CredentialsIDTokenConfig) ClaimsTemplateID() string

type Mutator

type Mutator interface {
	Mutate(r *http.Request, session *authn.AuthenticationSession, config json.RawMessage, _ pipeline.Rule) error
	GetID() string
	Validate(config json.RawMessage) error
}

type MutatorBroken

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

func NewMutatorBroken

func NewMutatorBroken(enabled bool) *MutatorBroken

func (*MutatorBroken) GetID

func (a *MutatorBroken) GetID() string

func (*MutatorBroken) Mutate

func (*MutatorBroken) Validate

func (a *MutatorBroken) Validate(_ json.RawMessage) error

type MutatorCookie

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

func NewMutatorCookie

func NewMutatorCookie(c configuration.Provider) *MutatorCookie

func (*MutatorCookie) GetID

func (a *MutatorCookie) GetID() string

func (*MutatorCookie) Mutate

func (a *MutatorCookie) Mutate(r *http.Request, session *authn.AuthenticationSession, config json.RawMessage, rl pipeline.Rule) error

func (*MutatorCookie) Validate

func (a *MutatorCookie) Validate(config json.RawMessage) error

func (*MutatorCookie) WithCache

func (a *MutatorCookie) WithCache(t *template.Template)

type MutatorHeader

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

func NewMutatorHeader

func NewMutatorHeader(c configuration.Provider) *MutatorHeader

func (*MutatorHeader) GetID

func (a *MutatorHeader) GetID() string

func (*MutatorHeader) Mutate

func (a *MutatorHeader) Mutate(r *http.Request, session *authn.AuthenticationSession, config json.RawMessage, rl pipeline.Rule) error

func (*MutatorHeader) Validate

func (a *MutatorHeader) Validate(config json.RawMessage) error

func (*MutatorHeader) WithCache

func (a *MutatorHeader) WithCache(t *template.Template)

type MutatorHeaderConfig

type MutatorHeaderConfig struct {
	Headers map[string]string `json:"headers"`
}

type MutatorHydrator

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

func NewMutatorHydrator

func NewMutatorHydrator(c configuration.Provider, d mutatorHydratorDependencies) *MutatorHydrator

func (*MutatorHydrator) Config

func (*MutatorHydrator) GetID

func (a *MutatorHydrator) GetID() string

func (*MutatorHydrator) Mutate

func (*MutatorHydrator) Validate

func (a *MutatorHydrator) Validate(config json.RawMessage) error

type MutatorHydratorConfig

type MutatorHydratorConfig struct {
	Api   externalAPIConfig `json:"api"`
	Cache cacheConfig       `json:"cache"`
}

type MutatorIDToken

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

func (*MutatorIDToken) Config

func (*MutatorIDToken) GetID

func (a *MutatorIDToken) GetID() string

func (*MutatorIDToken) Mutate

func (*MutatorIDToken) SetCaching

func (a *MutatorIDToken) SetCaching(token bool)

func (*MutatorIDToken) Validate

func (a *MutatorIDToken) Validate(config json.RawMessage) error

func (*MutatorIDToken) WithCache

func (a *MutatorIDToken) WithCache(t *template.Template)

type MutatorIDTokenRegistry

type MutatorIDTokenRegistry interface {
	credentials.SignerRegistry
}

type MutatorNoop

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

func NewMutatorNoop

func NewMutatorNoop(c configuration.Provider) *MutatorNoop

func (*MutatorNoop) GetID

func (a *MutatorNoop) GetID() string

func (*MutatorNoop) Mutate

func (a *MutatorNoop) Mutate(r *http.Request, session *authn.AuthenticationSession, config json.RawMessage, _ pipeline.Rule) error

func (*MutatorNoop) Validate

func (a *MutatorNoop) Validate(config json.RawMessage) error

type Registry

type Registry interface {
	AvailablePipelineMutators() []string
	PipelineMutator(string) (Mutator, error)
}

Jump to

Keyboard shortcuts

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