Skip to content

Search API - Effect of Deny on result set #272

@identitymonk

Description

@identitymonk

The Draft -03 introduces Subject search with the example:

{
  "subject": {
    "type": "user"
  },
  "action": {
    "name": "can_read",
  },
  "resource": {
    "type": "account",
    "id": "123"
  },
  "context": {
    "time": "2024-10-26T01:22-07:00"
  }
}

The specification needs to more prescriptive on the edge cases that includes Denies. Let's imagine the following policy store content (we used a non standardized policy format for the sake of the example here):

{
  "effect": "Allow",
  "subject": {
    "type": "user",
    "id": "Alice"
  },
  "action": {
    "name": "can_read",
  },
  "resource": {
    "type": "account",
    "id": "123"
  },
  "conditions": {
    "time": {
        "operator": ">",
        "value": "2024-10-26T00:00-07:00"
     },
     "time": {
        "operator": "<",
        "value": "2024-10-27T00:00-07:00"
     }
  }
},
{
  "effect": "Allow",
  "subject": {
    "type": "user",
    "id": "Bob"
  },
  "action": {
    "name": "can_read",
  },
  "resource": {
    "type": "account",
    "id": "123"
  },
  "conditions": {
    "time": {
        "operator": ">",
        "value": "2024-10-26T00:00-07:00"
     },
     "time": {
        "operator": "<",
        "value": "2024-10-27T00:00-07:00"
     }
  }
},
{
  "effect": "Deny",
  "subject": {
    "type": "user",
    "id": "Bob"
  },
  "action": {
    "name": "*",
  },
  "resource": {
    "type": "*"
  },
  "conditions": {}
},
  • what should be the result set returned in this case? Only the policy about Alice? All the policies?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions