Skip to content

Commit fb4a58b

Browse files
authored
Merge pull request #19 from tus/prefix
Use `digest-` prefix for problem types
2 parents d785d87 + c0957e5 commit fb4a58b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

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

+14-14
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Content-Type: application/problem+json
6565
Want-Content-Digest: sha-512=3, sha-256=10
6666

6767
{
68-
"type": "https://iana.org/assignments/http-problem-types#unsupported-hashing-algorithm",
68+
"type": "https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm",
6969
"title": "hashing algorithm is not supported",
7070
"unsupported-algorithm": "foo"
7171
}
@@ -87,7 +87,7 @@ The term "request", "response", "intermediary", "sender", and "server" are from
8787

8888
## Unsupported Hashing Algorithm
8989

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

118118
{
119-
"type": "https://iana.org/assignments/http-problem-types#unsupported-hashing-algorithm",
119+
"type": "https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm",
120120
"title": "Unsupported hashing algorithm",
121121
"unsupported-algorithm": "sha-256"
122122
}
@@ -142,7 +142,7 @@ HTTP/1.1 400 Bad Request
142142
Content-Type: application/problem+json
143143

144144
{
145-
"type": "https://iana.org/assignments/http-problem-types#unsupported-hashing-algorithm",
145+
"type": "https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm",
146146
"title": "Unsupported hashing algorithm",
147147
"unsupported-algorithm": "sha"
148148
}
@@ -151,7 +151,7 @@ Content-Type: application/problem+json
151151

152152
## Invalid Digest Value
153153

154-
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.
154+
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.
155155

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

@@ -172,7 +172,7 @@ HTTP/1.1 400 Bad Request
172172
Content-Type: application/problem+json
173173

174174
{
175-
"type": "https://iana.org/assignments/http-problem-types#invalid-digest-value",
175+
"type": "https://iana.org/assignments/http-problem-types#digest-invalid-value",
176176
"title": "digest value for sha-512 is not 64 bytes long"
177177
}
178178
~~~
@@ -182,7 +182,7 @@ This problem type indicates a fault in the sender's calculation or encoding of t
182182

183183
## Mismatching Digest Value
184184

185-
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.
185+
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.
186186

187187
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}}.
188188

@@ -203,7 +203,7 @@ HTTP/1.1 400 Bad Request
203203
Content-Type: application/problem+json
204204

205205
{
206-
"type": "https://iana.org/assignments/http-problem-types#mismatching-digest-value",
206+
"type": "https://iana.org/assignments/http-problem-types#digest-mismatching-value",
207207
"title": "digest value fromr request does not match expected value",
208208
"algorithm": "sha-256",
209209
"provided-digest": ":RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=:",
@@ -227,10 +227,10 @@ and prefer a general problem type over a more specific one.
227227

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

230-
## Registration of "unsupported-hashing-algorithm" Problem Type
230+
## Registration of "digest-unsupported-algorithm" Problem Type
231231

232232
Type URI:
233-
: https://iana.org/assignments/http-problem-types#unsupported-hashing-algorithm
233+
: https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm
234234

235235
Title:
236236
: Unsupported Hashing Algorithm
@@ -241,10 +241,10 @@ Recommended HTTP status code:
241241
Reference:
242242
: {{unsupported-hashing-algorithm}} of this document
243243

244-
## Registration of "invalid-digest-value" Problem Type
244+
## Registration of "digest-invalid-value" Problem Type
245245

246246
Type URI:
247-
: https://iana.org/assignments/http-problem-types#invalid-digest-value
247+
: https://iana.org/assignments/http-problem-types#digest-invalid-value
248248

249249
Title:
250250
: Invalid Digest Value
@@ -255,10 +255,10 @@ Recommended HTTP status code:
255255
Reference:
256256
: {{invalid-digest-value}} of this document
257257

258-
## Registration of "mismatching-digest-value" Problem Type
258+
## Registration of "digest-mismatching-value" Problem Type
259259

260260
Type URI:
261-
: https://iana.org/assignments/http-problem-types#mismatching-digest-value
261+
: https://iana.org/assignments/http-problem-types#digest-mismatching-value
262262

263263
Title:
264264
: Mismatching Digest Value

0 commit comments

Comments
 (0)