sentinel

package
v1.8.14 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: MPL-2.0 Imports: 2 Imported by: 102

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScopeCatalogUpsert

func ScopeCatalogUpsert(node *api.Node, service *api.AgentService) map[string]interface{}

ScopeCatalogUpsert returns the standard sentinel scope for a catalog create or update. Service is allowed to be nil.

func ScopeKVUpsert

func ScopeKVUpsert(key string, value []byte, flags uint64) map[string]interface{}

ScopeKVUpsert returns the standard sentinel scope for a KV create or update.

Types

type Evaluator

type Evaluator interface {
	Compile(policy string) error
	Execute(policy string, enforcementLevel string, data map[string]interface{}) bool
	Close()
}

Evaluator wraps the Sentinel evaluator from the HashiCorp Sentinel policy engine.

func New

func New(logger hclog.Logger) Evaluator

New returns a new instance of the Sentinel code engine. This is only available in Consul Enterprise so this version always returns nil.

type ScopeFn

type ScopeFn func() map[string]interface{}

ScopeFn is a callback that provides a sentinel scope. This is a callback so that if we don't run sentinel for some reason (not enabled or a basic policy check means we don't have to) then we don't spend the effort to make the map.

Jump to

Keyboard shortcuts

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