middleware

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// An authorization request has been denied.
	ErrUnauthorized = status.Error(codes.PermissionDenied, "unauthorized")

	// The authorization policy returned no result for the requested decision.
	ErrNoDecision = errors.New("authorizer returned no results for request decision")

	// Missing required configuration value.
	ErrMissingArgument = errors.New("missing authorization argument")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// IdentityType describes how identities are interpreted.
	IdentityType api.IdentityType

	// PolicyID is the ID of the aserto policy being queried for authorization.
	PolicyID string

	// PolicyRoot is an optional prefix added to policy paths inferred from messages.
	//
	// For example, if the policy 'peoplefinder.POST.api.users' defines rules for POST requests
	// made to '/api/users', then setting "peoplefinder" as the policy root allows the middleware
	// to infer the correct policy path from incoming requests.
	PolicyRoot string

	// Decision is the authorization rule to use.
	Decision string
}

Config holds global authorization options that apply to all requests.

func (*Config) Validate

func (c *Config) Validate() error

Validate returns an error if any of the required configuration fields are missing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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