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

Invalid tuple deletes not flagged as invalid tuple error #132

Closed
adriantam opened this issue Jul 28, 2022 · 0 comments · Fixed by #135
Closed

Invalid tuple deletes not flagged as invalid tuple error #132

adriantam opened this issue Jul 28, 2022 · 0 comments · Fixed by #135
Assignees
Labels
bug Something isn't working go Pull requests that update Go code good first issue Good for newcomers

Comments

@adriantam
Copy link
Member

If I try to delete by writing http://localhost:8080/stores/01G0CECAB4TT41TKN3E7D7J27Q/write with the body

{
  "deletes": {
    "tuple_keys": [
      {
        "user": "",
        "relation": "writer",
        "object": "document:2021-budget"
      }
    ]
  }
}

It only fails due to tuples do not exist.

{
    "code": "write_failed_due_to_invalid_input",
    "message": "cannot delete a tuple which does not exist: user: '', relation: 'writer', object: 'document:2021-budget': invalid write input"
}

Note that when I try to write the same tuples (with no user)

{
  "writes": {
    "tuple_keys": [
      {
        "user": "",
        "relation": "writer",
        "object": "document:2021-budget"
      }
    ]
  }
}

It will fail with

{
    "code": "invalid_tuple",
    "message": "Invalid tuple 'object:\"document:2021-budget\" relation:\"writer\"'. Reason: missing user"
}

Thus, it looks like we validate against write but not read

@adriantam adriantam added bug Something isn't working good first issue Good for newcomers go Pull requests that update Go code labels Jul 28, 2022
@adriantam adriantam self-assigned this Jul 28, 2022
adriantam added a commit that referenced this issue Jul 28, 2022
Even though we should allow deleting tuples where there is no current
relation / authorization model not exsit, etc.  We should nevertheless
ensure the tuple itself is valid in syntax (i.e., the user is defined).

Close #132
adriantam added a commit that referenced this issue Jul 29, 2022
Even though we should allow deleting tuples where there is no current
relation / authorization model not exist, etc.  We should nevertheless
ensure the tuple itself is valid in syntax (i.e., the user is defined).

Close #132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working go Pull requests that update Go code good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant