Skip to content

Commit

Permalink
Sign ignores .sig, .att, .sbom
Browse files Browse the repository at this point in the history
The signing tasks no longer signs cosign signatures, attestations and
sboms (images that end with .sigg, .att, or .sbom) and ignores them
instead.

closes #1347
  • Loading branch information
MichalPysik authored and lubosmj committed Jun 20, 2024
1 parent a6c4fad commit ff3068c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES/1347.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The pulp signing task that produces atomic type signature no longer signs cosign signatures,
attestations and sboms (images that end with .sig, .att, or .sbom), and ignores them instead.
10 changes: 7 additions & 3 deletions pulp_container/app/tasks/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from aiofiles import tempfile
from asgiref.sync import sync_to_async
from django.conf import settings
from django.db.models import Q

from pulpcore.plugin.models import Repository

Expand Down Expand Up @@ -46,12 +47,15 @@ def sign(repository_pk, signing_service_pk, reference, tags_list=None):
latest_version = repository.latest_version()
if tags_list:
latest_repo_content_tags = latest_version.content.filter(
pulp_type=Tag.get_pulp_type(), pk__in=tags_list
pulp_type=Tag.get_pulp_type(),
pk__in=tags_list,
)
else:
latest_repo_content_tags = latest_version.content.filter(pulp_type=Tag.get_pulp_type())
latest_repo_tags = Tag.objects.filter(pk__in=latest_repo_content_tags).select_related(
"tagged_manifest"
latest_repo_tags = (
Tag.objects.filter(pk__in=latest_repo_content_tags)
.select_related("tagged_manifest")
.exclude(Q(name__endswith=".sig") | Q(name__endswith=".att") | Q(name__endswith=".sbom"))
)
signing_service = ManifestSigningService.objects.get(pk=signing_service_pk)

Expand Down

0 comments on commit ff3068c

Please sign in to comment.