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

If-Match tag for update users/groups #92

Merged
merged 1 commit into from
Jul 27, 2024

Conversation

Dray56
Copy link
Contributor

@Dray56 Dray56 commented Jul 9, 2024

fix #91

Signed-off-by: Ray <debaditya.ray@sap.com>
@Dray56
Copy link
Contributor Author

Dray56 commented Jul 9, 2024

@strehle @joefitzgerald Could you please have a look at this?

@joefitzgerald
Copy link
Contributor

Wouldn't it be helpful to supply the user/group object version to an operation that mutates it? As implemented here, updates would be blind and could lead to concurrent updates that result in data loss due to a race condition.

@Dray56
Copy link
Contributor Author

Dray56 commented Jul 25, 2024

True, that would be the most ideal solution. However that would involve some breaking changes. The original intent of this PR was to get the UpdateUser and UpdateGroup calls from the generated_user and generated_group atleast working as the If-Match header is a required header for the PUT calls.

To incorporate the new metadata object version parameter,

  1. Either we change the doJSON function definition(which is used in almost every file) or
  2. Modify the UpdateUser and UpdateGroup functions to call the doJSONWithHeaders with desired object version. Since, the user and group files are generated from a template, it would be best not to modify them in case later there is a regeneration of the files on any major UAA API changes.

As for the If-Match tag, that is even present on the get and delete UAA API calls for users and groups though optional but it is not supported yet as a parameter for the calls currently in the go-uaa client. If anyone though desires for the fine grain control of updating for a particular version, they can always make use of the curl function in the client which can easily accomplish the desired activity.

@joefitzgerald joefitzgerald merged commit d675ee3 into cloudfoundry:master Jul 27, 2024
2 checks passed
@joefitzgerald
Copy link
Contributor

#57 should probably also be revisited on the basis of this PR.

@Dray56
Copy link
Contributor Author

Dray56 commented Jul 30, 2024

That is another attempt at addressing this issue by modifying the template generator to add the if-match header for all the update calls. However it would even apply to clients, identity zones and providers along with users and groups which do not support the if-match header according to the docs. The header seems to only apply to users and groups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Unable to Update User due to missing 'If-Match' Header
2 participants