File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -7,4 +7,31 @@ and simple JSON APIs.
7
7
8
8
For a full API reference, see the [ Integrity API documentation] .
9
9
10
+ ## Internals
11
+
12
+ Since a distribution file can have multiple attestations, and PyPI serves
13
+ these attestations as a single JSON file, this JSON file groups the
14
+ attestations into a single [ provenance object] . This object contains
15
+ bundles of attestations grouped by the Trusted Publisher identity used
16
+ to sign them.
17
+
18
+ To manually verify a PyPI artifact against its provenance object,
19
+ the [ ` pypi-attestations ` ] [ pypi-attestations ] CLI tool can be used:
20
+
21
+ ``` bash
22
+ export WHEEL_DIRECT_URL=https://files.pythonhosted.org/packages/d7/73/c16e5f3f0d37c60947e70865c255a58dc408780a6474de0523afd0ec553a/sampleproject-4.0.0-py3-none-any.whl
23
+
24
+ pypi-attestations verify pypi --repository https://github.com/pypa/sampleproject $WHEEL_DIRECT_URL
25
+ ```
26
+
27
+ This downloads the wheel from PyPI and its corresponding provenance JSON
28
+ (using the Integrity API), checks that the Trusted Publishers specified
29
+ in the provenance match the ` --repository ` argument passed by the user,
30
+ and finally cryptographically verifies the wheel against the included
31
+ attestations.
32
+
33
+
10
34
[ Integrity API documentation ] : /api/integrity/
35
+ [ provenance object ] : https://packaging.python.org/en/latest/specifications/index-hosted-attestations/#provenance-objects
36
+ [ pypi-attestations ] : https://pypi.org/project/pypi-attestations/
37
+
You can’t perform that action at this time.
0 commit comments