diff --git a/pulp_container/app/authorization.py b/pulp_container/app/authorization.py index c1dbdd145..058567de7 100644 --- a/pulp_container/app/authorization.py +++ b/pulp_container/app/authorization.py @@ -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") diff --git a/pulp_container/app/registry_api.py b/pulp_container/app/registry_api.py index 7b86b345a..616522d93 100644 --- a/pulp_container/app/registry_api.py +++ b/pulp_container/app/registry_api.py @@ -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] @@ -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] @@ -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] @@ -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) diff --git a/pulp_container/tests/functional/api/test_content_cache.py b/pulp_container/tests/functional/api/test_content_cache.py index ab06198ec..5d1d8d7cf 100644 --- a/pulp_container/tests/functional/api/test_content_cache.py +++ b/pulp_container/tests/functional/api/test_content_cache.py @@ -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() diff --git a/pyproject.toml b/pyproject.toml index 71a2286c1..59882286f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" ]