Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added unique resource IDs per owner #177

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

aaguiarz
Copy link
Contributor

In the current decision*.json files, the same todo ID is used when checking if users can_update_todo when a specific user is the owner. This implies that the same Todo item is owned by different users, which is probably not intended.

{
      "request": {
        "subject": {
          "type": "user",
          "id": "CiRmZDQ2MTRkMy1jMzlhLTQ3ODEtYjdiZC04Yjk2ZjVhNTEwMGQSBWxvY2Fs"
        },
        "action": {
          "name": "can_update_todo"
        },
        "resource": {
          "type": "todo",
          "id": "7240d0db-8ff0-41ec-98b2-34a096273b9f",
          "properties": {
            "ownerID": "[email protected]"
          }
        }
      },
      "expected": false
    },

This PR updates the decision*.json files to use unique todo:id identifiers for todo items owned by different users:

In addition of making it more correct, it simplifies the implementation in ReBAC systems, as they can store the { user:x, owner, todo:y } relation in the database instead of obtaining it from the context.

Copy link

netlify bot commented Nov 15, 2024

👷 Deploy request for authzen-todo pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 8b9ea0b

@ogazitt
Copy link
Collaborator

ogazitt commented Nov 15, 2024

tested against a few of the implementations, they all pass

@ogazitt ogazitt merged commit 45a4284 into openid:main Nov 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants