cedar-policy/cedar

Some authorization errors do not have source locations attached

Opened this issue · 0 comments

Before opening, please confirm:

Bug Category

Policy Evaluation

Describe the bug

#485 claimed to provide source locations for evaluation errors. However, in at least some cases, public AuthorizationErrors backed by EvaluationError do not have source locations. We should investigate why this is; to my knowledge, these errors should have source locations attached.

Expected behavior

Authorization errors resulting from policy-evaluation errors should have source locations attached (for policies parsed from the Cedar policy syntax, not the JSON format).

Reproduction steps

  1. Grep for TODO(#485) in the code. This TODO was left in the code even though #485 was resolved. As of this writing, the TODO is at cedar-policy/src/tests.rs:3626.
  2. Uncomment the two lines that check for source locations, and rename the variable _err to err.
  3. cargo test --all-features
  4. The tests fail.

Code Snippet

No response

Log output

No response

Additional configuration

No response

Operating System

No response

Additional information and screenshots

No response