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

Rollback after failed operation #200

Closed
joel-mason opened this issue Sep 3, 2021 · 0 comments
Closed

Rollback after failed operation #200

joel-mason opened this issue Sep 3, 2021 · 0 comments

Comments

@joel-mason
Copy link

According to the SCIM RFC, it mentions that if there are multiple operations, and one fails, all operations should be rolled back to the start state.

A PATCH request, regardless of the number of operations, SHALL be
treated as atomic.  If a single operation encounters an error
condition, the original SCIM resource MUST be restored, and a failure
status SHALL be returned.

And I noticed that this SCIM-SDK doesn't do that. Is this something you are aware of?
Below you can find the JSON Payload of the Patch Operation, which is trying to update the same emails.value attribute.
The first operation is fine, but the second operation fails due to a bad path, and then the third operation is not executed.
What I would expect to happen is when the second operation fails, the first one is rolled back.

{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "path": "emails[value eq \"chuck@norris.com\"].value",
      "op": "replace",
      "value": "bernie@sanders.com"
    },
    {
      "path": "email[value eq \"chuck@norris.com\"].value",
      "op": "replace",
      "value": "hulk@hogan.com"
    },
    {
      "path": "emails[value eq \"bernie@sanders.com\"].value",
      "op": "replace",
      "value": "hulk@hogan.com"
    }
  ]
}
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