You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new upload API proposed in this PEP provides an immediate solution to many of these problems,
82
+
and defines a flexible mechanism for future support of the other problems by extension.
83
+
Indexes implementing this API will provide better error reporting,
84
+
better release testing experience,
84
85
and atomic and simultaneous publishing of all release artifacts.
86
+
In the future indexes can implement resumable and parallel uploads via extensions.
85
87
86
88
87
89
Legacy API
@@ -154,8 +156,9 @@ these steps:
154
156
155
157
#. Initiate an upload session, creating a release stage.
156
158
#. Initiate file-upload session(s) to that stage as part of the upload session.
157
-
#. Execute file upload mechanism for the file-upload session(s).
158
-
#. Complete the file-upload session(s), marking them as executed or canceled.
159
+
#. Negotiate the specific file upload mechanism to use between client and server.
160
+
#. Execute file upload mechanism for the file-upload session(s) using the negotiated mechanism.
161
+
#. Complete the file-upload session(s), marking them as completed or canceled.
159
162
#. Complete the upload session, publishing or discarding the stage.
160
163
#. Optionally check the status of an upload session.
161
164
@@ -178,6 +181,8 @@ All URLs described here are relative to the "root endpoint", which may be locate
178
181
the url structure of a domain. For example, the root endpoint could be
179
182
``https://upload.example.com/``, or ``https://example.com/upload/``.
180
183
184
+
The choice of the root endpoint is left up to the index operator.
185
+
181
186
.. _session-create:
182
187
183
188
Create an Upload Session
@@ -271,7 +276,8 @@ the following keys:
271
276
which are provided below.
272
277
273
278
``mechanisms``
274
-
A list of file-upload mechanisms supported by the server.
279
+
A list of file-upload mechanisms supported by the server, sorted in server-preferred order.
280
+
At least one value is required.
275
281
276
282
``session-token``
277
283
If the index supports :ref:`previewing staged releases <staged-preview>`, this key will contain
@@ -427,8 +433,7 @@ the file to be uploaded. These checks may include, but are not limited to:
427
433
If the server determines that upload should proceed, it will return a ``202 Accepted`` response, with
428
434
the response body below. The :ref:`status <session-status>` of the session will also include the filename in the ``files`` mapping. If the server determines the upload cannot proceed, it **MUST** return
429
435
a ``409 Conflict``. The server **MAY** allow parallel uploads of files, but is not required to.
430
-
If the server cannot proceed with an upload because the ``mechanism`` supplied by the client is not supported
431
-
it **MUST** return a ``422 Unprocessable Entity``.
436
+
If the server cannot proceed with an upload because the ``mechanism`` supplied by the client is not supported it **MUST** return a ``422 Unprocessable Entity``.
432
437
433
438
.. _file-upload-session-response:
434
439
@@ -511,13 +516,18 @@ The requests looks like:
511
516
"action": "complete",
512
517
}
513
518
519
+
After receiving this requests the server **MAY** perform additional asynchronous processing
520
+
on the file, for instance to verify its hashes or contents.
514
521
515
-
After receiving this requests the server **MAY** perform additional asynchronous processing on the file,
516
-
for instance to verify its hashes or contents.
517
-
If the processing is required to complete before an upload session can be published,
518
-
the status of the file upload session can be set to ``processing`` until such processing is complete,
519
-
reaches an error state, or the file upload session is canceled.
522
+
If the file upload session requires no further processing, the server **MUST** respond with a
523
+
``200 OK`` and the status of the file upload session **MUST** be set to set to ``complete``.
520
524
525
+
If such processing is required to complete before an upload session can be published,
526
+
the server **MUST** respond with a ``202 Accepted`` and the status
527
+
of the file upload session **MUST** be set to ``processing`` until such processing is complete,
528
+
reaches an error state, or the file upload session is canceled.
529
+
Clients can query the file upload session :ref:`status <session-status>` by issuing a GET request to
530
+
the ``file-upload-session`` :ref:`link <file-upload-session-links>`.
521
531
522
532
.. _file-upload-session-cancelation:
523
533
@@ -760,7 +770,7 @@ interpretation to aid in diagnosing underlying issue.
0 commit comments