generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Labels
bugSomething isn't working. This is as high priority issue.Something isn't working. This is as high priority issue.
Description
Before opening, please confirm:
- I have searched for duplicate or closed issues.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
Bug Category
Cedar Parser
Describe the bug
In this EST JSON, there is an annotation identifier if
{
"annotations": {
"if": ""
},
"effect": "permit",
"principal": {
"op": "All"
},
"action": {
"op": "All"
},
"resource": {
"op": "All"
},
"conditions": []
}
We can parse this and obtain a Policy
object, but printing that policy to a string gives
@if("")
permit(principal, action, resource);
Which does not parse because if
is a reserved identifier.
let est = serde_json::json!(
{
"annotations": {
"if": ""
},
"effect": "permit",
"principal": {
"op": "All"
},
"action": {
"op": "All"
},
"resource": {
"op": "All"
},
"conditions": []
}
);
let p = Policy::from_json(None, est).unwrap();
let human_src = p.to_string();
Policy::from_str(&human_src).unwrap(); // This panics
Expected behavior
.
Reproduction steps
.
Code Snippet
// Put your code below this line.
Log output
// Put your output below this line
Additional configuration
No response
Operating System
No response
Additional information and screenshots
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't working. This is as high priority issue.Something isn't working. This is as high priority issue.