Skip to content

Allow referencing entites JSON files for entities in CLI run-tests JSON input #2016

@john-h-kastner-aws

Description

@john-h-kastner-aws

Category

CLI features/changes

Describe the feature you'd like to request

Current input looks something like:

[
  {
    "request": {
      "principal": "User::\"alice\"",
      "action": "Action::\"delete\"",
      "resource": "Document::\"doc1\"",
      "context": {}
    },
    "entities": [
      {
        "uid": {
          "type": "User",
          "id": "alice"
        },
        "attrs": {
          "role": "user"
        },
        "parents": []
      }
    ],
    "decision": "deny",
    "reason": [],
    "num_errors": 0
  }
]

Defining the entities inline becomes inconvenient for large entity sets and when entity sets should be reused between test cases. We should support a syntax like

[
  {
    "request": {
      "principal": "User::\"alice\"",
      "action": "Action::\"delete\"",
      "resource": "Document::\"doc1\"",
      "context": {}
    },
    "entities": "entities.json",
    "decision": "deny",
    "reason": [],
    "num_errors": 0
  }
]

Describe alternatives you've considered

.

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestThis issue requets a substantial new featuregood-first-issueGood for newcomers. A smaller issue that someone new to the Cedar codebase should be able to tackle

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions