sentinel

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: MPL-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
}

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

func New

func New(logger *log.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