Closed osbornk closed 1 year ago
I will fix this, basically removing line https://github.com/jelhub/scimgateway/blob/master/lib/scimgateway.js#L1304
modifyUser (PATCH) logic becomes somehow odd when after modifying there is a user lookup for returning the user object. Now user is not found, and we do not throw this as an exception anymore. Anyhow modifyUser was OK, assume returning an empty response will not become a failure message in Azure?
The 500 itself does not become a failure in Azure today. So I don't think it really cares about the response. It is more about the cleanliness of the application and not throwing exceptions in what is actually a successful state.
But once you push up a commit I can certainly test it out for you.
Thanks.
What is your res content (getUser result)? I have problems to see why PUT is working
Please ignore above update. I now see why PUT is working.
Fix now included in v4.2.7 release
Looks good now. Thanks.
We use Azure, which uses a PATCH operation as a soft delete by setting
active = false
. But our scim plugin interprets this as an actual delete operation. So, we actually delete the user and it now no longer exists. It does not have any harmful effects, but does cause the request to return a 500.The problem is this line:
https://github.com/jelhub/scimgateway/blob/master/lib/scimgateway.js#L1304
In contrast, the modifyUser PUT operation handles this without error.
Notice the
res.Resources.length === 1
. So we end up in the third conditional and just return an empty array.I can make a change and create a pull request, but I don't want to undo intentional code and this looks intentional. But it is throwing an exception if PATCH modifyUser causes the user to be removed.