-
Notifications
You must be signed in to change notification settings - Fork 402
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
SHOULD* use etags for DELETE to agents/activity APIs #564
Merged
+15
−11
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2267,29 +2267,34 @@ of the problem. | |
### 6.3 Concurrency | ||
|
||
##### Description | ||
Concurrency control makes certain that an API consumer does not PUT or POST changes based on old | ||
Concurrency control makes certain that an API consumer does not PUT, POST or DELETE documents based on old | ||
data into an LRS. | ||
|
||
##### Details | ||
xAPI will use HTTP 1.1 entity tags ([ETags](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19)) | ||
to implement optimistic concurrency control in the portions of the API where PUT or POST may | ||
overwrite existing data, being: | ||
to implement optimistic concurrency control in the portions of the API where PUT, POST or DELETE may | ||
overwrite or remove existing data, being: | ||
|
||
* State API | ||
* Agent Profile API | ||
* Activity Profile API | ||
|
||
The State API will permit PUT and POST requests without concurrency headers, since state conflicts | ||
The State API will permit PUT, POST and DELETE requests without concurrency headers, since state conflicts | ||
are unlikely. The requirements below only apply to Agent Profile API and Activity Profile API. | ||
|
||
|
||
|
||
##### Client Requirements | ||
|
||
* A Client using either Agent Profile API or Activity Profile API MUST include the | ||
* A Client making a PUT request to either the Agent Profile API or Activity Profile API MUST include the | ||
[If-Match](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24) header or the | ||
[If-None-Match](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26) header. | ||
|
||
* A Client making a POST request to either the Agent Profile API or Activity Profile API SHOULD* include the | ||
[If-Match](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24) header or the | ||
[If-None-Match](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26) header. | ||
|
||
* A Client making a DELETE request to either the Agent Profile API or Activity Profile API SHOULD* include the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DELETE doesn't need If-None-Match because you're not going to DELETE something that doesn't exist. |
||
[If-Match](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24) header. | ||
|
||
##### LRS Requirements | ||
|
||
* An LRS responding to a GET request MUST add an ETag HTTP header to the response. (The reason for | ||
|
@@ -2302,17 +2307,17 @@ of the SHA-1 digest of the contents. | |
modifications made after the consumer last fetched the document. | ||
* An LRS responding to a PUT request MUST handle the [If-None-Match](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26) header as described in RFC2616, HTTP 1.1 if it contains "*", in order to to detect | ||
when there is a resource present that the consumer is not aware of. | ||
* An LRS responding to a POST request SHOULD* handle the [If-Match](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24) header as described in RFC2616, HTTP 1.1 if it contains an ETag, in order to detect | ||
* An LRS responding to a POST or DELETE request SHOULD* handle the [If-Match](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24) header as described in RFC2616, HTTP 1.1 if it contains an ETag, in order to detect | ||
modifications made after the consumer last fetched the document. | ||
* An LRS responding to a POST request SHOULD* handle the [If-None-Match](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26) header as described in RFC2616, HTTP 1.1 if it contains "*", in order to to detect | ||
when there is a resource present that the consumer is not aware of. | ||
|
||
If the header precondition in any of the PUT request cases above fails, the LRS: | ||
If the header precondition in either of the PUT request cases above fails, the LRS: | ||
|
||
* MUST return HTTP status 412 "Precondition Failed". | ||
* MUST NOT make a modification to the resource. | ||
|
||
If the header precondition in any of the POST request cases above fails, the LRS: | ||
If the header precondition in any of the POST or DELETE request cases above fails, the LRS: | ||
|
||
* SHOULD* return HTTP status 412 "Precondition Failed". | ||
* SHOULD* NOT make a modification to the resource. | ||
|
@@ -2325,7 +2330,6 @@ If a PUT request is received without either header for a resource that already e | |
- set the "If-Match" header with the current ETag to resolve the conflict. | ||
* MUST NOT make a modification to the resource. | ||
|
||
|
||
<a name="security"/> | ||
|
||
### 6.4 Security | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO the text above this implied it only related to PUT, so I don't think we can argument POST/DELETE are MUSTs.