Skip to content

client: remove merge client during update#1705

Merged
aeneasr merged 1 commit intoory:masterfrom
DennisPattmann5012:client-sql-manager
Jan 23, 2020
Merged

client: remove merge client during update#1705
aeneasr merged 1 commit intoory:masterfrom
DennisPattmann5012:client-sql-manager

Conversation

@DennisPattmann5012
Copy link
Copy Markdown
Contributor

Proposed changes

Fix different behaviour between memory client update manager and database client update manager.

Checklist

  • I have read the contributing guidelines
  • I have read the security policy
  • I confirm that this pull request does not address a security vulnerability. If this pull request addresses a security
    vulnerability, I confirm that I got green light (please contact [email protected]) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation within the code base (if appropriate)
  • I have documented my changes in the developer guide (if appropriate)

Further comments

If hydra runs with memory manager the update client operation only updates the forwarded values. If hydra runs with database manager the update client operation updates all fields of the client. If you don't forward a value for a given field the field is emptied in the database.

Copy link
Copy Markdown
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! It's indeed strange that we're merging the client in the memory manager. I'm actually not quite sure if that was intended or if that's some old code.

UpdateClient is being used for PUT operations - these operations insert a 1:1 copy of the payload into the store. For "patching" a resource (like with merge) we would use the PATCH HTTP method. We don't support that at the moment but it will probably come in a future version.

Regarding this PR, I'd actually like to see the mergo removed from the memory manager to avoid confusion :)

Thank you!

@DennisPattmann5012
Copy link
Copy Markdown
Contributor Author

I would like to see a PATCH method for clients! :)

I'm going to update this PR and remove the merge code.

@DennisPattmann5012 DennisPattmann5012 changed the title client: merge client during update client: remove merge client during update Jan 23, 2020
@aeneasr
Copy link
Copy Markdown
Member

aeneasr commented Jan 23, 2020

I would like to see a PATCH method for clients! :)

Cool :) We will probably create an umbrella issue to decide what PATCH methodlogy we want to use across the ecosystem. One possibility would be JSON Patch: http://jsonpatch.com

@aeneasr aeneasr merged commit b0bf43f into ory:master Jan 23, 2020
@DennisPattmann5012 DennisPattmann5012 deleted the client-sql-manager branch January 23, 2020 15:11
@aeneasr
Copy link
Copy Markdown
Member

aeneasr commented Jan 23, 2020

Tracked as: ory/meta#2

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