vault: github.com/hashicorp/vault/sdk/helper/policyutil Index | Files

package policyutil

import "github.com/hashicorp/vault/sdk/helper/policyutil"

Index

Package Files

policyutil.go

Constants

const (
    AddDefaultPolicy      = true
    DoNotAddDefaultPolicy = false
)

func EquivalentPolicies Uses

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 Uses

func ParsePolicies(policiesRaw interface{}) []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 Uses

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.

Package policyutil imports 3 packages (graph) and is imported by 14 packages. Updated 2019-04-12. Refresh now. Tools for package owners.