Documentation
¶
Index ¶
- Constants
- func DerivedRolesFQN(roleSetName string) string
- func DerivedRolesSimpleName(fqn string) string
- func FQN(p *policyv1.Policy) string
- func PolicyKey(p *policyv1.Policy) string
- func PolicyKeyFromFQN(m string) string
- func PrincipalPolicyFQN(principal, version string) string
- func PrincipalResourceActionRuleName(rule *policyv1.PrincipalRule_Action, resource string, idx int) string
- func ResourcePolicyFQN(resource, version string) string
- func ResourceRuleName(rule *policyv1.ResourceRule, idx int) string
- func Sanitize(v string) string
- type ModuleID
Constants ¶
const ( DerivedRolesPrefix = "cerbos.derived_roles" PrincipalPoliciesPrefix = "cerbos.principal" ResourcePoliciesPrefix = "cerbos.resource" DefaultVersion = "default" )
Variables ¶
This section is empty.
Functions ¶
func DerivedRolesFQN ¶ added in v0.9.0
DerivedRolesFQN returns the fully-qualified module name for the given derived roles set.
func DerivedRolesSimpleName ¶
DerivedRolesSimpleName extracts the simple name from a derived roles FQN.
func PolicyKey ¶
PolicyKey returns a human-friendly identifier that can be used to refer to the policy in logs and other outputs.
func PolicyKeyFromFQN ¶ added in v0.9.0
PolicyKeyFromFQN returns a policy key from the module name.
func PrincipalPolicyFQN ¶ added in v0.9.0
PrincipalPolicyFQN returns the fully-qualified module name for the principal policy with given principal and version.
func PrincipalResourceActionRuleName ¶ added in v0.9.0
func PrincipalResourceActionRuleName(rule *policyv1.PrincipalRule_Action, resource string, idx int) string
PrincipalResourceActionRuleName returns the name for an action rule defined for a particular resource.
func ResourcePolicyFQN ¶ added in v0.9.0
ResourcePolicyFQN returns the fully-qualified name for the resource policy with given resource and version.
func ResourceRuleName ¶ added in v0.9.0
func ResourceRuleName(rule *policyv1.ResourceRule, idx int) string
ResourceRuleName returns the name of the given resource rule.
Types ¶
type ModuleID ¶
type ModuleID struct {
// contains filtered or unexported fields
}
ModuleID is a unique identifier for modules.
func DerivedRolesModuleID ¶
DerivedRolesModuleID returns the module ID for the given derived roles set.
func GenModuleID ¶
GenModuleID generates a short ID for the module.
func GenModuleIDFromFQN ¶ added in v0.9.0
GenModuleIDFromFQN generates a short ID for the given module name.
func PrincipalPolicyModuleID ¶
PrincipalPolicyModuleID returns the module ID for the principal policy with given principal and version.
func ResourcePolicyModuleID ¶
ResourcePolicyModuleID returns the module ID for the resource policy with given resource and version.