Bug 56731 - Evaluate E-Tag in If-Match on DELETE request
Summary: Evaluate E-Tag in If-Match on DELETE request
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: UDM - REST API
Version: UCS 5.2
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 5.0-5-errata
Assignee: Florian Best
QA Contact: Johannes Lohmer
URL: https://git.knut.univention.de/univen...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-14 03:31 CEST by Florian Best
Modified: 2024-12-17 11:43 CET (History)
4 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2023-10-14 03:31:13 CEST
1. If-Match should be evaluated in a DELETE request.
2. In response to PUT, PATCH requests the E-Tag should contain the E-Tag from after the modification.
3. a POST request could also add an E-Tag to its response.
Comment 2 Daniel Tröder univentionstaff 2023-10-16 10:21:07 CEST
Please elaborate shortly on what the use case is for the »1.« feature.
Comment 3 Florian Best univentionstaff 2023-10-16 10:35:21 CEST
(In reply to Daniel Tröder from comment #2)
> Please elaborate shortly on what the use case is for the »1.« feature.

If you want to DELETE a object you can make sure that the current version you have fetched has not been changed upstream. So that it's still untouched and nobody has changed it in the meantime.
Having this also allows e.g. in a web UI to display a dialog saying "The object you want to remove has been changed since you opened it. Do you really want to remove this object?".
Comment 4 Florian Best univentionstaff 2023-10-16 20:40:45 CEST
If-Match is now respected in DELETE, the error message has been enhanced, PUT,PATCH,POST returns E-Tag and no-cache Cache-Control, OpenAPI schema has been extended (it already told about these headers), dev-reference was updated. 

univention-directory-manager-rest.yaml
3b78c703088f | fix(udm-rest): check for conditional request in DELETE request

univention-directory-manager-rest (10.0.6-11)
3b78c703088f | fix(udm-rest): check for conditional request in DELETE request

univention-directory-manager-modules.yaml
3b78c703088f | fix(udm-rest): check for conditional request in DELETE request

univention-directory-manager-modules (15.0.24-20)
3b78c703088f | fix(udm-rest): check for conditional request in DELETE request

ucs-test (10.0.19-19)
662393c23941 | test(udm-rest): test all possible If-Match combinations
e4c321cd69d5 | test(udm-rest): use pytest fixtures
Comment 5 Johannes Lohmer univentionstaff 2023-10-18 10:41:49 CEST
Reproduced: OK
Code: OK
Tests: OK
Package-Build: OK
Documentation: OK
Errata YAML: OK