Back to godoc.org
github.com/ory/oathkeeper/pipeline/errors

package errors

v0.38.2 (0185070)
Latest Go to latest
Published: Jun 16, 2020 | License: Apache-2.0 | Module: github.com/ory/oathkeeper

Index

Variables

var ErrDoesNotMatchWhen = ErrHandlerNotResponsible
var ErrErrorHandlerNotEnabled = herodot.DefaultError{
	ErrorField:  "error handler matching this route is misconfigured or disabled",
	CodeField:   http.StatusInternalServerError,
	StatusField: http.StatusText(http.StatusInternalServerError),
}
var ErrHandlerNotResponsible = errors.New("error handler not responsible for this request")

func MatchesWhen

func MatchesWhen(whens Whens, r *http.Request, err error) error

func NewErrErrorHandlerMisconfigured

func NewErrErrorHandlerMisconfigured(a Handler, err error) *herodot.DefaultError

func NewErrErrorHandlerNotEnabled

func NewErrErrorHandlerNotEnabled(a Handler) *herodot.DefaultError

type ErrorJSON

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

func NewErrorJSON

func NewErrorJSON(
	c configuration.Provider,
	d errorJSONDependencies,
) *ErrorJSON

func (*ErrorJSON) Config

func (a *ErrorJSON) Config(config json.RawMessage) (*ErrorJSONConfig, error)

func (*ErrorJSON) GetID

func (a *ErrorJSON) GetID() string

func (*ErrorJSON) Handle

func (a *ErrorJSON) Handle(w http.ResponseWriter, r *http.Request, config json.RawMessage, _ pipeline.Rule, handleError error) error

func (*ErrorJSON) Validate

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

type ErrorJSONConfig

type ErrorJSONConfig struct {
	Verbose bool `json:"verbose"`
}

type ErrorRedirect

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

func (*ErrorRedirect) Config

func (a *ErrorRedirect) Config(config json.RawMessage) (*ErrorRedirectConfig, error)

func (*ErrorRedirect) GetID

func (a *ErrorRedirect) GetID() string

func (*ErrorRedirect) Handle

func (a *ErrorRedirect) Handle(w http.ResponseWriter, r *http.Request, config json.RawMessage, _ pipeline.Rule, _ error) error

func (*ErrorRedirect) Validate

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

type ErrorRedirectConfig

type ErrorRedirectConfig struct {
	To   string `json:"to"`
	Code int    `json:"code"`
}

type ErrorRedirectDependencies

type ErrorRedirectDependencies interface {
	x.RegistryWriter
}

type ErrorWWWAuthenticate

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

func (*ErrorWWWAuthenticate) Config

func (a *ErrorWWWAuthenticate) Config(config json.RawMessage) (*ErrorWWWAuthenticateConfig, error)

func (*ErrorWWWAuthenticate) GetID

func (a *ErrorWWWAuthenticate) GetID() string

func (*ErrorWWWAuthenticate) Handle

func (a *ErrorWWWAuthenticate) Handle(w http.ResponseWriter, r *http.Request, config json.RawMessage, _ pipeline.Rule, _ error) error

func (*ErrorWWWAuthenticate) Validate

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

type ErrorWWWAuthenticateConfig

type ErrorWWWAuthenticateConfig struct {
	Realm string `json:"realm"`
}

type ErrorWWWAuthenticateDependencies

type ErrorWWWAuthenticateDependencies interface {
	x.RegistryWriter
}

type Handler

type Handler interface {
	GetID() string
	Handle(w http.ResponseWriter, r *http.Request, config json.RawMessage, _ pipeline.Rule, err error) error
	Validate(config json.RawMessage) error
}

type Handlers

type Handlers []Handler

func (Handlers) IDs

func (h Handlers) IDs() (res []string)

type Registry

type Registry interface {
	AvailablePipelineErrorHandlers() Handlers
	PipelineErrorHandler(id string) (Handler, error)
}

type When

type When struct {
	Error   []string     `json:"error"`
	Request *WhenRequest `json:"request"`
}

type WhenRequest

type WhenRequest struct {
	RemoteIP *WhenRequestRemoteIP `json:"remote_ip"`
	Header   *WhenRequestHeader   `json:"header"`
}

type WhenRequestHeader

type WhenRequestHeader struct {
	ContentType []string `json:"content_type"`
	Accept      []string `json:"accept"`
}

type WhenRequestRemoteIP

type WhenRequestRemoteIP struct {
	Match                     []string `json:"match"`
	RespectForwardedForHeader bool     `json:"respect_forwarded_for_header"`
}

type Whens

type Whens []When
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier