authz

package
v0.19.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewErrAuthorizerMisconfigured

func NewErrAuthorizerMisconfigured(a Authorizer, err error) *herodot.DefaultError

func NewErrAuthorizerNotEnabled

func NewErrAuthorizerNotEnabled(a Authorizer) *herodot.DefaultError

Types

type Authorizer

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

type AuthorizerAllow

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

func NewAuthorizerAllow

func NewAuthorizerAllow(c configuration.Provider) *AuthorizerAllow

func (*AuthorizerAllow) Authorize

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

func (*AuthorizerAllow) GetID

func (a *AuthorizerAllow) GetID() string

func (*AuthorizerAllow) Validate

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

type AuthorizerDeny

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

func NewAuthorizerDeny

func NewAuthorizerDeny(c configuration.Provider) *AuthorizerDeny

func (*AuthorizerDeny) Authorize

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

func (*AuthorizerDeny) GetID

func (a *AuthorizerDeny) GetID() string

func (*AuthorizerDeny) Validate

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

type AuthorizerKetoEngineACPORY

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

func (*AuthorizerKetoEngineACPORY) Authorize

func (*AuthorizerKetoEngineACPORY) Config

func (*AuthorizerKetoEngineACPORY) GetID

func (*AuthorizerKetoEngineACPORY) ParseSubject

func (a *AuthorizerKetoEngineACPORY) ParseSubject(session *authn.AuthenticationSession, templateId, templateString string) (string, error)

func (*AuthorizerKetoEngineACPORY) Validate

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

func (*AuthorizerKetoEngineACPORY) WithContextCreator

func (a *AuthorizerKetoEngineACPORY) WithContextCreator(f authorizerKetoWardenContext)

type AuthorizerKetoEngineACPORYConfiguration

type AuthorizerKetoEngineACPORYConfiguration struct {
	RequiredAction   string `json:"required_action"`
	RequiredResource string `json:"required_resource"`
	Subject          string `json:"subject"`
	Flavor           string `json:"flavor"`
	BaseURL          string `json:"base_url"`
}

type AuthorizerKetoEngineACPORYRequestBody

type AuthorizerKetoEngineACPORYRequestBody struct {
	Action   string                 `json:"action"`
	Context  map[string]interface{} `json:"context"`
	Resource string                 `json:"resource"`
	Subject  string                 `json:"subject"`
}

type Registry

type Registry interface {
	AvailablePipelineAuthorizers() []string
	PipelineAuthorizer(string) (Authorizer, error)
}

Jump to

Keyboard shortcuts

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