policyutil

package
v0.7.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2017 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddDefaultPolicy      = true
	DoNotAddDefaultPolicy = false
)

Variables

This section is empty.

Functions

func EquivalentPolicies

func EquivalentPolicies(a, b []string) bool

EquivalentPolicies checks whether the given policy sets are equivalent, as in, they contain the same values. The benefit of this method is that it leaves the "default" policy out of its comparisons as it may be added later by core after a set of policies has been saved by a backend.

func ParsePolicies

func ParsePolicies(policiesRaw string) []string

ParsePolicies parses a comma-delimited list of policies. The resulting collection will have no duplicate elements. If 'root' policy was present in the list of policies, then all other policies will be ignored, the result will contain just the 'root'. In cases where 'root' is not present, if 'default' policy is not already present, it will be added.

func SanitizePolicies

func SanitizePolicies(policies []string, addDefault bool) []string

SanitizePolicies performs the common input validation tasks which are performed on the list of policies across Vault. The resulting collection will have no duplicate elements. If 'root' policy was present in the list of policies, then all other policies will be ignored, the result will contain just the 'root'. In cases where 'root' is not present, if 'default' policy is not already present, it will be added if addDefault is set to true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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