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

digest-headers: general feedback on Section 6 [POST, PATCH] #1366

Closed
3 tasks done
reschke opened this issue Jan 2, 2021 · 3 comments
Closed
3 tasks done

digest-headers: general feedback on Section 6 [POST, PATCH] #1366

reschke opened this issue Jan 2, 2021 · 3 comments

Comments

@reschke
Copy link
Contributor

reschke commented Jan 2, 2021

POST and PATCH requests can appear to convey partial representations but are semantically acting on resources. The enclosed representation, including its metadata, refers to that action.

Aren't all HTTP requests "acting on resources"?

In these requests the representation digest MUST be computed on the representation-data of that action. This is the only possible choice because representation digest requires complete representation metadata (see Section 2).

IMHO, that should be the case for any requests (but we already have a ticket for that).

In responses,

if the representation describes the status of the request, Digest MUST be computed on the enclosed representation (see Section 10.8 );
if there is a referenced resource Digest MUST be computed on the selected representation of the referenced resource even if that is different from the target resource. That might or might not result in computing Digest on the enclosed representation.
The latter case might be done according to the HTTP semantics of the given method, for example using the Content-Location header field. In contrast, the Location header field does not affect Digest because it is not representation metadata.

  • This is true, but "might be done" is a bit vague. In general, this is the way it is done.

6.1. Digest and PATCH

Why do we need this if 6 is about POST and PATCH already?

In PATCH requests, the representation digest MUST be computed on the patch document because the representation metadata refers to the patch document and not to the target resource (see Section 2 of [PATCH]).

How is this different from POST?

In PATCH responses, the representation digest MUST be computed on the selected representation of the patched resource.

  • No. General rules should apply here. There is no special case for PATCH.

Digest usage with PATCH is thus very similar to POST, but with the resource's own semantic partly implied by the method and by the patch document.

  • Nope.
@ioggstream
Copy link
Contributor

Seems we need further discussion here :) We just tried to address POST and PATCH before generic methods, but probably we need to discuss this even further.

@ioggstream ioggstream changed the title digest-headers: general feedback on Section 6 digest-headers: general feedback on Section 6 [POST, PATCH] Jan 11, 2021
@ioggstream
Copy link
Contributor

@reschke says:

In PATCH responses, the representation digest MUST be computed on the selected representation of the patched resource.

No. General rules should apply here. There is no special case for PATCH.

Agree, we don't need to be normative here. Just ensure there's an example.

@ioggstream
Copy link
Contributor

ioggstream commented Apr 26, 2021

Mark's feedback.

    1. Would this be better titled 'Using Digest in State-Changing Requests'?
  • ok in #
    1. The first paragraph reads oddly; are we just saying that state-changing requests like POST and PATCH contain a representation that affects the state of the resource?

Yes, but I we wanted to clarify that (differently from PUT) the content does not necessarily describe the target resource.

    1. 'action' is not used anywhere else in HTTP IIRC.
  • Ok
    1. Are the response-related requirements here any different than elsewhere? Repeating them is likely to confuse readers.

We added this part because the HTTP spec was not that easy to read on that part.

  • 6.1 This seems very duplicative of 6.
  • We can remove it once we clarify this part.

cc: @mnot @LPardue

ioggstream added a commit that referenced this issue Sep 9, 2021
@ioggstream ioggstream reopened this Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants