Help us shape the future of Go! Take the 2026 Go Developer Survey

authorizer

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Allow   = authorizationResult("allow")
	Deny    = authorizationResult("deny")
	Unknown = authorizationResult("unknown")
)

Variables

View Source
var ErrNoStandardParts = errors.New("the provided URL does not match the standard API form")

Functions

func GetBootstrapPolicy

func GetBootstrapPolicy(masterNamespace string) *authorizationapi.Policy

TODO enumerate all resourceKinds and verbs instead of using *

func GetBootstrapPolicyBinding

func GetBootstrapPolicyBinding(masterNamespace string) *authorizationapi.PolicyBinding

func VerbAndKindAndNamespace

func VerbAndKindAndNamespace(req *http.Request) (string, string, string, []string, error)

VerbAndKindAndNamespace returns verb, kind, namespace, remaining parts, error

Types

type AuthorizationAttributeBuilder

type AuthorizationAttributeBuilder interface {
	GetAttributes(request *http.Request) (AuthorizationAttributes, error)
}

func NewAuthorizationAttributeBuilder

func NewAuthorizationAttributeBuilder(requestsToUsers *authcontext.RequestContextMap) AuthorizationAttributeBuilder

type AuthorizationAttributes

type AuthorizationAttributes interface {
	GetUserInfo() authenticationapi.UserInfo
	GetVerb() string
	GetNamespace() string
	// GetRequestAttributes is of type interface{} because different verbs and different Authorizer/AuthorizationAttributeBuilder pairs may have different contract requirements
	GetRequestAttributes() interface{}
}

type Authorizer

type Authorizer interface {
	Authorize(a AuthorizationAttributes) (allowed bool, reason string, err error)
}

func NewAuthorizer

func NewAuthorizer(masterAuthorizationNamespace string, policyRuleBindingRegistry policyregistry.Registry, policyBindingRegistry policybindingregistry.Registry) Authorizer

Jump to

Keyboard shortcuts

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