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

Upserting to memory database only inserts #80

Closed
jrmullins opened this issue Jan 29, 2019 · 0 comments
Closed

Upserting to memory database only inserts #80

jrmullins opened this issue Jan 29, 2019 · 0 comments

Comments

@jrmullins
Copy link

Describe the bug
Upserting policies, with the same IDs/data, to the memory database, causes duplicate records, instead of updating.

To Reproduce
Steps to reproduce the behavior:

  1. Run DATABASE_URL=memory go run main.go serve
  2. PUT the same policy more than once
PUT /engines/acp/ory/exact/policies HTTP/1.1
Host: localhost:4466
Content-Type: application/json
{
  "actions": [
    "delete"
  ],
  "description": "Delete first blog post",
  "effect": "allow",
  "id": "alice-deletes-blog-post",
  "resources": [
    "blog_posts:my-first-blog-post"
  ],
  "subjects": [
    "alice"
  ]
}
  1. Get the list of policies and withness duplicate entries
GET /engines/acp/ory/exact/policies HTTP/1.1
Host: localhost:4466
Content-Type: application/json

Expected behavior
Upserting a policy will update a pre-existing policy based on the ID. If this is a limitation of the memory database, I would expect some sort of warning.

Version:

  • Go version 1.11
  • Keto origin/master @ ed7af3f
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

No branches or pull requests

1 participant