rbac

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package rbac contains utilities for evaluating requests against roles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action v1.RBACAction

Action is a convenience type for an action.

func (*Action) For

func (a *Action) For(resource string) *Action

For returns a copy of this action for the given resource name.

type Actions

type Actions []*Action

Actions is a convenience type for a list of actions.

func (Actions) For

func (a Actions) For(resource string) Actions

type Evaluator

type Evaluator interface {
	// Evaluate returns true if the given actions are allowed for the
	// peer information provided in the context.
	Evaluate(ctx context.Context, actions Actions) (bool, error)
	// IsSecure returns true if the evaluator is secure.
	IsSecure() bool
}

Evaluator is an interface for evaluating actions.

func NewNoopEvaluator

func NewNoopEvaluator() Evaluator

NewNoopEvaluator returns an evaluator that always returns true.

func NewStoreEvaluator

func NewStoreEvaluator(store storage.MeshDB) Evaluator

NewStoreEvaluator returns a ActionEvaluator that evaluates actions against the roles in the given store.

Jump to

Keyboard shortcuts

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