authz

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNotModified is returned from a source when the data has not
	// been modified, identified based on the provided hash value
	ErrNotModified = errors.New("not modified")
)

Functions

func WithDataSource

func WithDataSource(source DataSource, pollDuration time.Duration) containers.Option[Engine]

func WithPollDuration

func WithPollDuration(dur time.Duration) containers.Option[Engine]

Types

type CachedSource

type CachedSource[T any] interface {
	Get(_ context.Context, hash []byte) (T, []byte, error)
}

type DataSource

type DataSource CachedSource[map[string]any]

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(ctx context.Context, logger *zap.Logger, source PolicySource, opts ...containers.Option[Engine]) (*Engine, error)

func (*Engine) IsAllowed

func (e *Engine) IsAllowed(ctx context.Context, input map[string]interface{}) (bool, error)

type PolicySource

type PolicySource CachedSource[[]byte]

type Verifier

type Verifier interface {
	IsAllowed(ctx context.Context, input map[string]any) (bool, error)
}

Directories

Path Synopsis
middleware
source

Jump to

Keyboard shortcuts

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