cedar-policy/cedar-docs

Incorrect example for JSON EST

aaronjeline opened this issue · 1 comments

What were you trying to do?
Reading the docs for the JSON EST format (https://docs.cedarpolicy.com/policies/json-format.html), and the following is given as an example of a policy:

{
    "effect": "permit",
    "principal": {
        "op": "==",
        "entity": { "type": "User", "id": "12UA45" }
    },
    "action": {
        "op": "==",
        "entity": { "type": "Action", "id": "view" }
    },
    "resource": {
        "op": "in",
        "entity": { "type": "Folder", "id": "abc" }
    },
    "conditions": [
        {
            "kind": "when",
            "body": {
                "==": {
                    "left": {
                        ".": {
                            "left": {
                                "Var": "context"
                            },
                            "attr": "tls_version"
                        }
                    },
                    "right": {
                        "Literal": "1.3"
                    }
                }
            }
        }
    ]
}

What is wrong and why?
{ "Literal" : "1.3" } is not valid EST JSON
What do we need to do to fix this?
Is should be {"Value" : "1.3"}