Documentation
¶
Index ¶
- func GetDefinitionFqnFromDefinition(def *policy.Attribute) (string, error)
- func GetDefinitionFqnFromValue(v *policy.Value) (string, error)
- func GetDefinitionFqnFromValueFqn(valueFqn string) (string, error)
- func GroupValueFqnsByDefinition(valueFqns []string) (map[string][]string, error)
- type DataRuleResult
- type Decision
- type Pdp
- type ValueFailure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefinitionFqnFromDefinition ¶
GetDefinitionFqnFromDefinition constructs the FQN for an attribute definition.
func GetDefinitionFqnFromValue ¶
GetDefinitionFqnFromValue extracts the definition FQN from a policy value.
func GetDefinitionFqnFromValueFqn ¶
GetDefinitionFqnFromValueFqn extracts the definition FQN from a value FQN string.
Types ¶
type DataRuleResult ¶
type DataRuleResult struct { Passed bool `json:"passed" example:"false"` RuleDefinition *policy.Attribute `json:"rule_definition"` ValueFailures []ValueFailure `json:"value_failures"` }
DataRuleResult represents the result of evaluating one rule for an entity.
type Decision ¶
type Decision struct { Access bool `json:"access" example:"false"` Results []DataRuleResult `json:"entity_rule_result"` }
Decision represents the overall access decision for an entity.
type Pdp ¶
type Pdp struct {
// contains filtered or unexported fields
}
Pdp represents the Policy Decision Point component.
func (*Pdp) DetermineAccess ¶
func (pdp *Pdp) DetermineAccess( ctx context.Context, dataAttributes []*policy.Value, entityAttributeSets map[string][]string, attributeDefinitions []*policy.Attribute, ) (map[string]*Decision, error)
DetermineAccess will take data Attribute Values, entities mapped entityId to Attribute Value FQNs, and data AttributeDefinitions, compare every data Attribute against every entity's set of Attribute Values, generating a rolled-up decision result for each entity, as well as a detailed breakdown of every data comparison.
type ValueFailure ¶
type ValueFailure struct { DataAttribute *policy.Value `json:"data_attribute"` Message string `json:"message" example:"Criteria NOT satisfied for entity: {entity_id} - lacked attribute value: {attribute}"` }
ValueFailure represents a specific failure when evaluating a data attribute.