@@ -203,25 +203,35 @@ The following changes are made to the
203
203
:ref: `simple repository API <packaging:simple-repository-api-base >`:
204
204
205
205
* When an uploaded file has one or more attestations, the index **MAY **
206
- provide a `` . provenance`` file adjacent to the hosted distribution.
207
- The format of the `` . provenance`` file ** SHALL ** be a JSON-encoded
208
- :ref: `provenance object <provenance-object >`, which ** SHALL ** contain
209
- the file's attestations.
206
+ provide a provenance file containing attestations associated with
207
+ a given distribution. The format of the provenance file
208
+ ** SHALL ** be a JSON-encoded :ref: `provenance object <provenance-object >`,
209
+ which ** SHALL ** contain the file's attestations.
210
210
211
- For example, if an uploaded file is hosted at
212
- the URL ``https://example.com/sampleproject-1.2.3.tar.gz ``, the provenance
213
- URL would be ``https://example.com/sampleproject-1.2.3.tar.gz.provenance ``.
211
+ The location of the provenance file is signaled by the index via
212
+ the ``data-provenance `` attribute.
214
213
215
- * When a `` . provenance`` file is present, the index **MAY ** include a
214
+ * When a provenance file is present, the index **MAY ** include a
216
215
``data-provenance `` attribute on its file link. The value of the
217
- ``data-provenance `` attribute **SHALL ** be the SHA-256 digest of the
218
- associated ``.provenance `` file.
216
+ ``data-provenance `` attribute **SHALL ** be a fully qualified URL,
217
+ signaling the the file's provenance can be found
218
+ at that URL. This URL **MUST ** represent a
219
+ `secure origin <https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features/ >`_.
219
220
220
- * The index **MAY ** choose to modify the ``.provenance `` file. For example,
221
+ The following table provides examples of release file URLs, ``data-provenance ``
222
+ values, and their resulting provenance file URLs.
223
+
224
+ .. csv-table ::
225
+ :header: "File URL", "``data-provenance ``", "Provenance URL"
226
+
227
+ "https://example.com/sampleproject-1.2.3.tar.gz", "``https://example.com/sampleproject-1.2.3.tar.gz.provenance ``", "https://example.com/sampleproject-1.2.3.tar.gz.provenance"
228
+ "https://example.com/sampleproject-1.2.3.tar.gz", "``https://other.example.com/sampleproject-1.2.3.tar.gz/provenance ``", "https://other.example.com/sampleproject-1.2.3.tar.gz/provenance"
229
+ "https://example.com/sampleproject-1.2.3.tar.gz", "``../relative ``", "*(invalid: not a fully qualified URL) *"
230
+ "https://example.com/sampleproject-1.2.3.tar.gz", "``http://unencrypted.example.com/provenance ``", "*(invalid: not a secure origin) *"
231
+
232
+ * The index **MAY ** choose to modify the provenance file. For example,
221
233
the index **MAY ** permit adding additional attestations and verification
222
234
materials, such as attestations from third-party auditors or other services.
223
- When the index modifies the ``.provenance `` file, it **MUST ** also update the
224
- ``data-provenance `` attribute's value to the new SHA-256 digest.
225
235
226
236
See :ref: `changes-to-provenance-objects ` for an additional discussion of
227
237
reasons why a file's provenance may change.
@@ -236,8 +246,8 @@ The following changes are made to the
236
246
include a ``provenance `` key in the ``file `` dictionary for that file.
237
247
238
248
The value of the ``provenance `` key **SHALL ** be either a JSON string
239
- or ``null ``. If ``provenance `` is not ``null ``, it **SHALL ** be the SHA-256
240
- digest of the associated `` . provenance`` file, as in the Simple Index .
249
+ or ``null ``. If ``provenance `` is not ``null ``, it **SHALL ** be a URL
250
+ to the associated provenance file.
241
251
242
252
See :ref: `appendix-3 ` for an explanation of the technical decision to
243
253
embed the SHA-256 digest in the JSON API, rather than the full
0 commit comments