Skip to content

Commit 5727815

Browse files
AcconutLPardue
andcommitted
Add abstract and improve introduction
Closes tus/draft-digest-fields-problem-types#1. Co-Authored-By: Lucas Pardue <[email protected]>
1 parent c2f708d commit 5727815

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

draft-kleidl-digest-fields-problem-types.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,28 @@ informative:
3838

3939
--- abstract
4040

41-
TODO Abstract
42-
41+
This document specifies problem types that servers can use in responses to problems encountered while dealing with a request carrying integrity fields and integrity preference fields.
4342

4443
--- middle
4544

4645
# Introduction
4746

48-
Digest fields {{DIGEST}} are HTTP fields that support integrity digests. A request can include the `Content-Digest` and `Repr-Digest` header fields for verifying the integrity of the HTTP message content and the HTTP representation, respectively. In addition, a sender can include the `Want-Content-Digest` and `Want-Repr-Digest` header fields in a request to express interest in receiving integrity field in the response. {{DIGEST}} by design does not define, require or recommend specific server behavior if errors regarding the integrity appear.
49-
50-
For example, a request may include a digest algorithm in the `Content-Digest` and `Repr-Digest` header fields that the server does not support. Similar, a sender may request to the digest utilizing a hashing algorithm that the server does not support. Another possible problem is that the digest supplied in the request does not match up with the digest calculated by the server. Depending on the application, the server may choose to ignore these errors or communicate them back to the client. However, no recommended response format for communicating these errors is defined so far.
47+
{{DIGEST}} by design does not define, require or recommend any specific behavior for error handling relating to integrity. The responsibility is instead delegated to applications. This draft defines a set of problem types {{PROBLEM}} that can be used by server applications to indicate that a problem was encountered while dealing with a request carrying integrity fields and integrity preference fields.
5148

52-
Problem types {{PROBLEM}} are machine-readable description of errors in HTTP response content {{PROBLEM}}. Each problem definition includes a unique type that can be used to identify the error and also allows the attachment of a short, human-readable summary as well as additional properties to aid debugging and error handling. In addition, a JSON and XML representation of the problem types is defined to simplify parsing.
53-
54-
As an example, if the resource receives a request with an integrity field utilizing an unsupported hashing algorithm `foo`, the response may use the following problem type:
49+
For example, a request message may include content alongside `Content-Digest` and `Repr-Digest` header fields that use a digest algorithm the server does not support. An application could decide to reject this request because it cannot validate the integrity. Using a problem type, the server can provide machine-readable error details to aid debugging or error reporting, as shown in the following example.
5550

5651
~~~ http-message
5752
HTTP/1.1 400 Bad Request
5853
Content-Type: application/problem+json
54+
Want-Content-Digest: sha-512=3, sha-256=10
5955

6056
{
6157
"type": "https://iana.org/assignments/http-problem-types#unsupported-hashing-algorithm",
62-
"title": "upload is already completed",
63-
"requested-algorithm": "foo",
64-
"supported-algorithms": ["sha-256", "sha-512"]
58+
"title": "hashing algorithm is not supported",
59+
"unsupported-algorithm": "foo"
6560
}
6661
~~~
6762

68-
The response includes the unique problem type, the requested algorithm that is not supported by the server, as well as an array of the supported algorithms.
69-
7063
# Conventions and Definitions
7164

7265
{::boilerplate bcp14-tagged}

0 commit comments

Comments
 (0)