-
Notifications
You must be signed in to change notification settings - Fork 963
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store attestations for PEP740 (#16302)
* Store and retrieve attestations * Continue to work. * Update attestation storage and retrieval * Update comments * Fix import * Please linter * Use the correct event to attach a publisher_url to a `File` * Rename ReleaseFileAttestation to Attestation * Update names * Update table migration * Update metrics * Update attestations storage * Update pypi-attestations and sigstore dependencies * Fix wrong merge. * Generate Provenance file on upload. * Generate and store provenance file during upload. * Improve tests * Fix test error * Fix test error * Fix merge error * Simplify legacy answer * Introduce AttestationsService * Rename AttestationsService to ReleaseVerification service and integrate Provenance related objects * Remove useless check * Integrate generate_and_store_provenance within persist_attestations * Remove file.publisher_url which is no longer used. * Rename ReleaseAttestationService to IntegrityService * Linting * requirements: bump sigstore, pypi-attestations Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: William Woodruff <[email protected]> Co-authored-by: Dustin Ingram <[email protected]> Co-authored-by: William Woodruff <[email protected]>
- Loading branch information
1 parent
54fda81
commit 5545884
Showing
19 changed files
with
1,063 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
import hashlib | ||
|
||
import factory | ||
|
||
from warehouse.attestations.models import Attestation | ||
|
||
from .base import WarehouseFactory | ||
|
||
|
||
class AttestationFactory(WarehouseFactory): | ||
class Meta: | ||
model = Attestation | ||
|
||
file = factory.SubFactory("tests.common.db.packaging.FileFactory") | ||
attestation_file_blake2_digest = factory.LazyAttribute( | ||
lambda o: hashlib.blake2b(o.file.filename.encode("utf8")).hexdigest() | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. |
Oops, something went wrong.