From 8929cb998d17fba84b7b27eba856764db195f59a Mon Sep 17 00:00:00 2001 From: Alex Dutton Date: Fri, 31 Jan 2020 11:42:25 +0000 Subject: [PATCH 1/2] Change status code for AuthenticationFailed, and add DepositComplete This will still need building and deploying. Resolves #20. --- src/tables/error-types.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tables/error-types.csv b/src/tables/error-types.csv index 08cfb60..9dc3776 100644 --- a/src/tables/error-types.csv +++ b/src/tables/error-types.csv @@ -1,10 +1,11 @@ Error Type,Error Code,Reason -AuthenticationFailed,403,"The request supplied invalid credentials, or no credentials, when the server was expecting to authenticate the request." +AuthenticationFailed,401,"The request supplied invalid credentials, or no credentials, when the server was expecting to authenticate the request." BadRequest,400,The request did not meet the standard specified by the SWORD protocol. This error can be used when no other error is appropriate ByReferenceFileSizeExceeded,400,"The client supplied a By-Reference deposit file, which specified a file size which exceeded the server's limit" ByReferenceNotAllowed,412,The client attempted to carry out a By-Reference deposit on a server which does not support it ContentMalformed,400,"The body content of the request was malformed in some way, such that the server cannot read it correctly." ContentTypeNotAcceptable,415,The `Content-Type` header specifies a content type of the request which is in a format that the server cannot accept. +DepositComplete,403,"The deposit is not In-Progress, so can no longer be modified." DigestMismatch,412,One or more of the Digests that the server checked did not match the deposited content ETagNotMatched,412,The client supplied an `If-Match` header which did not match the current `ETag` for the resource being updated. ETagRequired,412,"The client did not supply an `If-Match` header, when one was required by the server" From 4a6c2b63b33ef8a36dda00830cf3a08a289fe3ca Mon Sep 17 00:00:00 2001 From: Alex Dutton Date: Fri, 31 Jan 2020 11:58:57 +0000 Subject: [PATCH 2/2] Add error-types.csv to the build sword3common has a script to extract error document types directly from the spec, currently by parsing the HTML. Once this is merged and deployed it can grab the CSV specfication directly, allowing a simpler implementation. --- build.json | 5 +++++ src/tables/error-types.csv | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build.json b/build.json index 4722027..9b6186f 100644 --- a/build.json +++ b/build.json @@ -119,6 +119,11 @@ "root" : "diagrams/structure.png", "out" : "structure.png", "process" : false + }, + { + "root": "tables/error-types.csv", + "out": "error-types.csv", + "process": false } ], diff --git a/src/tables/error-types.csv b/src/tables/error-types.csv index 9dc3776..485f90f 100644 --- a/src/tables/error-types.csv +++ b/src/tables/error-types.csv @@ -5,7 +5,7 @@ ByReferenceFileSizeExceeded,400,"The client supplied a By-Reference deposit file ByReferenceNotAllowed,412,The client attempted to carry out a By-Reference deposit on a server which does not support it ContentMalformed,400,"The body content of the request was malformed in some way, such that the server cannot read it correctly." ContentTypeNotAcceptable,415,The `Content-Type` header specifies a content type of the request which is in a format that the server cannot accept. -DepositComplete,403,"The deposit is not In-Progress, so can no longer be modified." +DepositComplete,403,"The deposit is not In-Progress, so can no longer be altered." DigestMismatch,412,One or more of the Digests that the server checked did not match the deposited content ETagNotMatched,412,The client supplied an `If-Match` header which did not match the current `ETag` for the resource being updated. ETagRequired,412,"The client did not supply an `If-Match` header, when one was required by the server"