Is your feature request related to a problem? Please describe
The PolicyEvaluation function, when the policy fails, returns an error. The SDK should returns the PolicyResult with Allowed set to false instead, since it is more usable.
|
// TODO: here if the evaluation result false, it is returned an error. This interface |
|
// for the sdk should be improved, since it should use the PolicyResult and return error |
|
// only if there is some error in policy evaluation. |
|
_, query, err := evaluatorAllowPolicy.PolicyEvaluation(logger, e.policyEvaluationOptions) |
|
|
|
if err != nil { |
|
logger.WithField("error", map[string]any{ |
|
"policyName": rondConfig.RequestFlow.PolicyName, |
|
"message": err.Error(), |
|
}).Error("RBAC policy evaluation failed") |
|
return PolicyResult{}, err |
|
} |