Skip to content

Commit dde8b3d

Browse files
facutuescadi
andauthored
attestations: allow upload of SLSA provenances (#17121)
Signed-off-by: Facundo Tuesca <[email protected]> Co-authored-by: Dustin Ingram <[email protected]>
1 parent 1de7977 commit dde8b3d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

warehouse/attestations/services.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
from warehouse.packaging.models import File
4040

4141

42+
SUPPORTED_ATTESTATION_TYPES = {
43+
AttestationType.PYPI_PUBLISH_V1,
44+
AttestationType.SLSA_PROVENANCE_V1,
45+
}
46+
47+
4248
def _extract_attestations_from_request(request: Request) -> list[Attestation]:
4349
"""
4450
Extract well-formed attestation objects from the given request's payload.
@@ -177,7 +183,7 @@ def parse_attestations(
177183
f"Unknown error while trying to verify included attestations: {e}",
178184
)
179185

180-
if predicate_type != AttestationType.PYPI_PUBLISH_V1:
186+
if predicate_type not in SUPPORTED_ATTESTATION_TYPES:
181187
self.metrics.increment(
182188
"warehouse.upload.attestations.failed_unsupported_predicate_type"
183189
)

0 commit comments

Comments
 (0)