Skip to content

Commit c0957e5

Browse files
committed
Use digest- prefix for problem types
Closes tus/draft-digest-fields-problem-types#16.
1 parent 34ff9fb commit c0957e5

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

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

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Content-Type: application/problem+json
5959
Want-Content-Digest: sha-512=3, sha-256=10
6060

6161
{
62-
"type": "https://iana.org/assignments/http-problem-types#unsupported-hashing-algorithm",
62+
"type": "https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm",
6363
"title": "hashing algorithm is not supported",
6464
"unsupported-algorithm": "foo"
6565
}
@@ -81,7 +81,7 @@ The term "request", "response", "intermediary", "sender", and "server" are from
8181

8282
## Unsupported Hashing Algorithm
8383

84-
This section defines the "https://iana.org/assignments/http-problem-types#unsupported-hashing-algorithm" problem type.
84+
This section defines the "https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm" problem type.
8585
A server MAY use this problem type if it wants to communicate to the client that
8686
one of the hashing algorithms referenced in the integrity or integrity preference fields present in the request
8787
is not supported.
@@ -110,7 +110,7 @@ Content-Type: application/problem+json
110110
Want-Repr-Digest: sha-512=10, sha-256=0
111111

112112
{
113-
"type": "https://iana.org/assignments/http-problem-types#unsupported-hashing-algorithm",
113+
"type": "https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm",
114114
"title": "Unsupported hashing algorithm",
115115
"unsupported-algorithm": "sha-256"
116116
}
@@ -136,19 +136,16 @@ HTTP/1.1 400 Bad Request
136136
Content-Type: application/problem+json
137137

138138
{
139-
"type": "https://iana.org/assignments/http-problem-types#unsupported-hashing-algorithm",
139+
"type": "https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm",
140140
"title": "Unsupported hashing algorithm",
141141
"unsupported-algorithm": "sha"
142142
}
143143
~~~
144144
{: title="Response Advertising the Supported Algorithms"}
145145

146-
147-
148-
149146
## Invalid Digest Value
150147

151-
This section defines the "https://iana.org/assignments/http-problem-types#invalid-digest-value" problem type. A server MAY use this problem type when responding to a request, whose integrity fields include a digest value, that cannot be generated by the corresponding hashing algorithm. For example, if the digest value of the `sha-512` hashing algorithm is not 64 bytes long, it cannot be a valid digest value and the server can skip computing the digest value. This problem type MUST NOT be used if the server is not able to parse the integrity fields according to {{Section 4.5 of STRUCTURED-FIELDS}}, for example because of a syntax error in the field value.
148+
This section defines the "https://iana.org/assignments/http-problem-types#digest-invalid-value" problem type. A server MAY use this problem type when responding to a request, whose integrity fields include a digest value, that cannot be generated by the corresponding hashing algorithm. For example, if the digest value of the `sha-512` hashing algorithm is not 64 bytes long, it cannot be a valid digest value and the server can skip computing the digest value. This problem type MUST NOT be used if the server is not able to parse the integrity fields according to {{Section 4.5 of STRUCTURED-FIELDS}}, for example because of a syntax error in the field value.
152149

153150
The server SHOULD include a human-readable description why the value is considered invalid in the `title` member.
154151

@@ -169,7 +166,7 @@ HTTP/1.1 400 Bad Request
169166
Content-Type: application/problem+json
170167

171168
{
172-
"type": "https://iana.org/assignments/http-problem-types#invalid-digest-value",
169+
"type": "https://iana.org/assignments/http-problem-types#digest-invalid-value",
173170
"title": "digest value for sha-512 is not 64 bytes long"
174171
}
175172
~~~
@@ -180,7 +177,7 @@ This problem type indicates a fault in the sender's calculation or encoding of t
180177

181178
## Mismatching Digest Value
182179

183-
This section defines the "https://iana.org/assignments/http-problem-types#mismatching-digest-value" problem type. A server MAY use this problem type when responding to a request, whose integrity fields include a digest value that does not match the digest value that the server calculated for the request content or representation.
180+
This section defines the "https://iana.org/assignments/http-problem-types#digest-mismatching-value" problem type. A server MAY use this problem type when responding to a request, whose integrity fields include a digest value that does not match the digest value that the server calculated for the request content or representation.
184181

185182
Three problem type extension members are defined: the `algorithm`, `provided-digest`, and `calculated-digest` members. A response using this problem type SHOULD populate all members, with the value of `algorithm` being the algorithm key of the used hashing algorithm, with the value of `provided-digest` being the digest value taken from the request's integrity fields, and the value of `calculated-digest` being the calculated digest. The digest values MUST BE serialized as byte sequences as described in {{Section 4.1.8 of STRUCTURED-FIELDS}}.
186183

@@ -201,7 +198,7 @@ HTTP/1.1 400 Bad Request
201198
Content-Type: application/problem+json
202199

203200
{
204-
"type": "https://iana.org/assignments/http-problem-types#mismatching-digest-value",
201+
"type": "https://iana.org/assignments/http-problem-types#digest-mismatching-value",
205202
"title": "digest value fromr request does not match expected value",
206203
"algorithm": "sha-256",
207204
"provided-digest": ":RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=:",
@@ -225,10 +222,10 @@ and prefer a general problem type over a more specific one.
225222

226223
IANA is asked to register the following entries in the "HTTP Problem Types" registry at <https://www.iana.org/assignments/http-problem-types>.
227224

228-
## Registration of "unsupported-hashing-algorithm" Problem Type
225+
## Registration of "digest-unsupported-algorithm" Problem Type
229226

230227
Type URI:
231-
: https://iana.org/assignments/http-problem-types#unsupported-hashing-algorithm
228+
: https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm
232229

233230
Title:
234231
: Unsupported Hashing Algorithm
@@ -239,10 +236,10 @@ Recommended HTTP status code:
239236
Reference:
240237
: {{unsupported-hashing-algorithm}} of this document
241238

242-
## Registration of "invalid-digest-value" Problem Type
239+
## Registration of "digest-invalid-value" Problem Type
243240

244241
Type URI:
245-
: https://iana.org/assignments/http-problem-types#invalid-digest-value
242+
: https://iana.org/assignments/http-problem-types#digest-invalid-value
246243

247244
Title:
248245
: Invalid Digest Value
@@ -253,10 +250,10 @@ Recommended HTTP status code:
253250
Reference:
254251
: {{invalid-digest-value}} of this document
255252

256-
## Registration of "mismatching-digest-value" Problem Type
253+
## Registration of "digest-mismatching-value" Problem Type
257254

258255
Type URI:
259-
: https://iana.org/assignments/http-problem-types#mismatching-digest-value
256+
: https://iana.org/assignments/http-problem-types#digest-mismatching-value
260257

261258
Title:
262259
: Mismatching Digest Value

0 commit comments

Comments
 (0)