Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion service/authorization/authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,28 @@ func (as *AuthorizationService) GetDecisions(ctx context.Context, req *authoriza
// get attribute definition/value combinations
dataAttrDefsAndVals, err := retrieveAttributeDefinitions(ctx, ra, as.sdk)
if err != nil {
// TODO: should all decisions in a request fail if one FQN lookup fails?
// if attribute an FQN does not exist
// return deny for all entity chains aginst this RA set and continue to next
if strings.Contains(err.Error(), db.ErrTextNotFound) {
for _, ec := range dr.GetEntityChains() {
decisionResp := &authorization.DecisionResponse{
Decision: authorization.DecisionResponse_DECISION_DENY,
EntityChainId: ec.GetId(),
Action: &policy.Action{
Value: &policy.Action_Standard{
Standard: policy.Action_STANDARD_ACTION_TRANSMIT,
},
},
}
if ra.GetResourceAttributesId() != "" {
decisionResp.ResourceAttributesId = ra.GetResourceAttributesId()
} else if len(ra.GetAttributeValueFqns()) > 0 {
decisionResp.ResourceAttributesId = ra.GetAttributeValueFqns()[0]
}
rsp.DecisionResponses = append(rsp.DecisionResponses, decisionResp)
}
continue
}
return nil, db.StatusifyError(err, db.ErrTextGetRetrievalFailed, slog.String("fqns", strings.Join(ra.GetAttributeValueFqns(), ", ")))
}
var attrDefs []*policy.Attribute
Expand Down