Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pulp_container/app/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
ContainerPullThroughDistribution,
)

TOKEN_EXPIRATION_TIME = settings.get("TOKEN_EXPIRATION_TIME", 300)
TOKEN_EXPIRATION_TIME = getattr(settings, "TOKEN_EXPIRATION_TIME", 300)

FakeView = namedtuple("FakeView", "action, get_object, get_serializer")

Expand Down
8 changes: 4 additions & 4 deletions pulp_container/app/registry_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def authentication_classes(self):
This allows deployments to use custom authentication backends (e.g. remote
header-based auth) alongside standard Basic auth for container registry operations.
"""
if settings.get("TOKEN_AUTH_DISABLED", False):
if getattr(settings, "TOKEN_AUTH_DISABLED", False):
return [RegistryAuthentication, *api_settings.DEFAULT_AUTHENTICATION_CLASSES]
return [TokenAuthentication]

Expand All @@ -295,7 +295,7 @@ def permission_classes(self):
"""
List of permission classes to check for this view.
"""
if settings.get("TOKEN_AUTH_DISABLED", False):
if getattr(settings, "TOKEN_AUTH_DISABLED", False):
return [RegistryPermission]
return [TokenPermission]

Expand Down Expand Up @@ -534,7 +534,7 @@ def permission_classes(self):
"""
List of permission classes to check for this view.
"""
if settings.get("TOKEN_AUTH_DISABLED", False):
if getattr(settings, "TOKEN_AUTH_DISABLED", False):
return [IsAuthenticated]
return [TokenPermission]

Expand Down Expand Up @@ -626,7 +626,7 @@ def get_queryset(self, *args, **kwargs):
distribution_permission = "container.pull_containerdistribution"
namespace_permission = "container.namespace_pull_containerdistribution"

if settings.get("TOKEN_AUTH_DISABLED", False):
if getattr(settings, "TOKEN_AUTH_DISABLED", False):
return queryset

public_repositories = queryset.filter(private=False)
Expand Down
2 changes: 1 addition & 1 deletion pulp_container/tests/functional/api/test_content_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_content_cache(
monitor_task,
):
"""A test case that verifies the functionality of the Redis caching machinery."""
if not pulp_settings.get("CACHE_ENABLED"):
if not getattr(pulp_settings, "CACHE_ENABLED", False):
pytest.skip("The caching machinery was not enabled")

repo = container_repository_factory()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers=[
requires-python = ">=3.11"
dependencies = [
"jsonschema>=4.4,<4.27",
"pulpcore>=3.111.0,<3.115",
"pulpcore>=3.111.0,<3.130",
"pyjwt[crypto]>=2.4,<2.14",
"pysequoia>=0.1.33,<0.2.0"
]
Expand Down
Loading