authz

package
v0.0.0-...-7b9449e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer struct {
	Client    kclient.Client
	Providers []BindingProvider
}

func (*Authorizer) AppendBindingProviders

func (a *Authorizer) AppendBindingProviders(providers ...BindingProvider)

AppendBindingProviders adds a new binding provider to the authorizer.

func (*Authorizer) Authorize

func (a *Authorizer) Authorize(ctx context.Context, attr authorizer.Attributes) (authorized authorizer.Decision, reason string, err error)

Authorize is called by k8s.

func (*Authorizer) Bindings

func (a *Authorizer) Bindings(ctx context.Context, user user.Info) (result []binding.Binding, _ error)

Bindings is used by steve to provide all rules for the current user.

type BindingAuthorizer

type BindingAuthorizer interface {
	authorizer.Authorizer
	AppendBindingProviders(provider ...BindingProvider)
	Bindings(ctx context.Context, user user.Info) ([]binding.Binding, error)
}

func NewAllowAll

func NewAllowAll() BindingAuthorizer

type BindingProvider

type BindingProvider interface {
	ForUser(ctx context.Context, c kclient.Client, user user.Info) ([]binding.Binding, error)
	ForAttributes(ctx context.Context, c kclient.Client, user user.Info, attr authorizer.Attributes) ([]binding.Binding, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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