Skip to content

Commit b92dd15

Browse files
woodruffwdi
andauthored
PEP 740: data-provenance attribute value tweaks (#3971)
Signed-off-by: William Woodruff <[email protected]> Co-authored-by: Dustin Ingram <[email protected]>
1 parent 0b91fc8 commit b92dd15

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

peps/pep-0740.rst

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -203,25 +203,35 @@ The following changes are made to the
203203
:ref:`simple repository API <packaging:simple-repository-api-base>`:
204204

205205
* 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.
210210

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.
214213

215-
* When a ``.provenance`` file is present, the index **MAY** include a
214+
* When a provenance file is present, the index **MAY** include a
216215
``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/>`_.
219220

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,
221233
the index **MAY** permit adding additional attestations and verification
222234
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.
225235

226236
See :ref:`changes-to-provenance-objects` for an additional discussion of
227237
reasons why a file's provenance may change.
@@ -236,8 +246,8 @@ The following changes are made to the
236246
include a ``provenance`` key in the ``file`` dictionary for that file.
237247

238248
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.
241251

242252
See :ref:`appendix-3` for an explanation of the technical decision to
243253
embed the SHA-256 digest in the JSON API, rather than the full

0 commit comments

Comments
 (0)