Skip to content

Commit

Permalink
add access to Translation-* apt files
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Baudon committed Nov 15, 2024
1 parent 749e5e5 commit 8131c74
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion nexus_allowlist/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def recreate_privileges(
description="Allow access to 'Packages.gz' file in APT repository",
expression=(
'format == "apt" and '
f'path=~"/dists/{APT_DISTRO}/.*/Packages.gz"'
f'path=~"^/dists/{APT_DISTRO}/.*/Packages.gz"'
),
repo_type=_NEXUS_REPOSITORIES["apt_proxy"].repo_type,
repo=_NEXUS_REPOSITORIES["apt_proxy"].name,
Expand All @@ -236,6 +236,21 @@ def recreate_privileges(
)
apt_privilege_names.append(privilege_name)

# Content selector and privilege for APT 'Translation-*' files which contains an
# metadata about the APT distribution
privilege_name = create_content_selector_and_privilege(
nexus_api,
name="apt-translation",
description="Allow access to 'Translation-*' file in APT repository",
expression=(
'format == "apt" '
f'and path=~"^/dists/{APT_DISTRO}/.*/Translation-.*"'
),
repo_type=_NEXUS_REPOSITORIES["apt_proxy"].repo_type,
repo=_NEXUS_REPOSITORIES["apt_proxy"].name,
)
apt_privilege_names.append(privilege_name)

# Create content selectors and privileges for packages according to the
# package setting
if packages == "all":
Expand Down

0 comments on commit 8131c74

Please sign in to comment.