We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1de7977 commit dde8b3dCopy full SHA for dde8b3d
warehouse/attestations/services.py
@@ -39,6 +39,12 @@
39
from warehouse.packaging.models import File
40
41
42
+SUPPORTED_ATTESTATION_TYPES = {
43
+ AttestationType.PYPI_PUBLISH_V1,
44
+ AttestationType.SLSA_PROVENANCE_V1,
45
+}
46
+
47
48
def _extract_attestations_from_request(request: Request) -> list[Attestation]:
49
"""
50
Extract well-formed attestation objects from the given request's payload.
@@ -177,7 +183,7 @@ def parse_attestations(
177
183
f"Unknown error while trying to verify included attestations: {e}",
178
184
)
179
185
180
- if predicate_type != AttestationType.PYPI_PUBLISH_V1:
186
+ if predicate_type not in SUPPORTED_ATTESTATION_TYPES:
181
187
self.metrics.increment(
182
188
"warehouse.upload.attestations.failed_unsupported_predicate_type"
189
0 commit comments