Skip to content

Etags support - #48

Merged
azmeuk merged 4 commits into
mainfrom
47-etags
Sep 20, 2026
Merged

azmeuk merged 4 commits into
mainfrom
47-etags

Conversation

@azmeuk

@azmeuk azmeuk commented Apr 7, 2026

Copy link
Copy Markdown
Member

fixes #47
fixes #45
fixes #13

The resource to reach can now be designated either by a resource type and
an id, as before, or by a resource object carrying that id. Objects without
an id are rejected, so that a single resource is always unambiguously
designated.

The 'resource_model' parameter is deprecated in favor of the first
positional parameter, which now also accepts resource objects.
When the server advertises ETag support in its ServiceProviderConfig,
replace, modify and delete make the request conditional on the resource
not having changed, as described in RFC7644 section 3.14. The server
answers with a 412 error when it has.

Resource versions are also read from the ETag response header, which
RFC7644 makes mandatory, and not only from the meta.version attribute,
which it merely recommends.
When the server supports ETags and query is given a versioned resource
object, it makes the read conditional. On a 304 Not Modified answer the
object that was passed is returned back, and nothing is downloaded.

The header is not sent along query parameters, since the server would
then answer with a partial representation that the object cannot stand
for.
The examples of RFC7643 are JSON, where 'W\/"x"' decodes to 'W/"x"'.
The test payloads kept the JSON escaping in Python literals, which no
server would ever send, and which now reaches the If-Match headers.
@azmeuk
azmeuk merged commit 6abe40a into main Sep 20, 2026
8 checks passed
@azmeuk
azmeuk deleted the 47-etags branch September 20, 2026 15:13
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.

Support ETags Replace should have resource id parameter Make query and delete take a resource object instead of type + id

1 participant