Skip to content

Policy JSON format does not error for spaces in annotations #994

@john-h-kastner-aws

Description

@john-h-kastner-aws

Before opening, please confirm:

Bug Category

Cedar Parser

Describe the bug

The following policy is accepted by the JSON policy parse, but it defines an annotation containing a space, which is not possible in the Cedar policy syntax. The JSON policy parser should instead return an error.

{
    "annotations": {
      " ": ""
    },
    "effect": "permit",
    "principal": { "op": "All" },
    "action": { "op": "All" },
    "resource": { "op": "All" },
    "conditions": [ ]
}

The most straightforward fix is to check for spaces in annotations in try_into_ast_template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. This is as high priority issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions