permitio / cedar-agent

Cedar-agent is the easiest way to deploy and run Cedar
Apache License 2.0
148 stars 11 forks source link

Override datastore entities #14

Closed dtrce closed 1 year ago

dtrce commented 1 year ago

Description: Add an ability to override the entities stored in datastore by directly passing it into is_authorized REST API call.

Example body of a REST call for is_authorized with entities passed in with the request

{
    "principal": "User::\"admin.1@domain.com\"",
    "action": "Action::\"delete\"",
    "resource": "Document::\"cedar-agent.pdf\"",
    "entities": [
        {
            "attrs": {},
            "parents": [
                {
                    "id": "Admin",
                    "type": "Role"
                }
            ],
            "uid": {
                "id": "admin.1@domain.com",
                "type": "User"
            }
        },
        {
            "attrs": {},
            "parents": [
                {
                    "id": "Admin",
                    "type": "Role"
                }
            ],
            "uid": {
                "id": "delete",
                "type": "Action"
            }
        }
    ],
    "context": {}
}