authorization

package
v5.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAttributes

func SetAttributes(ctx context.Context, attrs *Attributes) context.Context

SetAttributes stores the given attributes within the provided context

Types

type Attributes

type Attributes struct {
	APIGroup     string
	APIVersion   string
	Namespace    string
	Resource     string
	ResourceName string
	User         types.User
	Verb         string
}

Attributes represents all the information required by an authorizer to make an authorization decision

func GetAttributes

func GetAttributes(ctx context.Context) *Attributes

GetAttributes returns the authorization attributes stored in the given context

type Authorizer

type Authorizer interface {
	Authorize(ctx context.Context, attrs *Attributes) (bool, error)
}

Authorizer determines whether a request is authorized using the Attributes passed. It returns true if the request should be authorized, along with any error encountered

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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