oathkeeper: github.com/ory/oathkeeper/pipeline/errors Index | Files

package errors

import "github.com/ory/oathkeeper/pipeline/errors"

Index

Package Files

error.go error_json.go error_redirect.go error_www_authenticate.go registry.go when.go

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 Uses

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

func NewErrErrorHandlerMisconfigured Uses

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

func NewErrErrorHandlerNotEnabled Uses

func NewErrErrorHandlerNotEnabled(a Handler) *herodot.DefaultError

type ErrorJSON Uses

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

func NewErrorJSON Uses

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

func (*ErrorJSON) Config Uses

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

func (*ErrorJSON) GetID Uses

func (a *ErrorJSON) GetID() string

func (*ErrorJSON) Handle Uses

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

func (*ErrorJSON) Validate Uses

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

type ErrorJSONConfig Uses

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

type ErrorRedirect Uses

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

func NewErrorRedirect Uses

func NewErrorRedirect(
    c configuration.Provider,
    d ErrorRedirectDependencies,
) *ErrorRedirect

func (*ErrorRedirect) Config Uses

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

func (*ErrorRedirect) GetID Uses

func (a *ErrorRedirect) GetID() string

func (*ErrorRedirect) Handle Uses

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

func (*ErrorRedirect) Validate Uses

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

type ErrorRedirectConfig Uses

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

type ErrorRedirectDependencies Uses

type ErrorRedirectDependencies interface {
    x.RegistryWriter
}

type ErrorWWWAuthenticate Uses

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

func NewErrorWWWAuthenticate Uses

func NewErrorWWWAuthenticate(
    c configuration.Provider,
    d ErrorWWWAuthenticateDependencies,
) *ErrorWWWAuthenticate

func (*ErrorWWWAuthenticate) Config Uses

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

func (*ErrorWWWAuthenticate) GetID Uses

func (a *ErrorWWWAuthenticate) GetID() string

func (*ErrorWWWAuthenticate) Handle Uses

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

func (*ErrorWWWAuthenticate) Validate Uses

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

type ErrorWWWAuthenticateConfig Uses

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

type ErrorWWWAuthenticateDependencies Uses

type ErrorWWWAuthenticateDependencies interface {
    x.RegistryWriter
}

type Handler Uses

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 Uses

type Handlers []Handler

func (Handlers) IDs Uses

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

type Registry Uses

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

type When Uses

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

type WhenRequest Uses

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

type WhenRequestHeader Uses

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

type WhenRequestRemoteIP Uses

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

type Whens Uses

type Whens []When

Package errors imports 14 packages (graph) and is imported by 3 packages. Updated 2019-12-31. Refresh now. Tools for package owners.