From d2c857f2a9e17ce35dd83ada72c6616e3aa50861 Mon Sep 17 00:00:00 2001 From: Dennis Kliban Date: Thu, 14 May 2026 15:22:53 -0400 Subject: [PATCH] Include DEFAULT_AUTHENTICATION_CLASSES when token auth is disabled When TOKEN_AUTH_DISABLED=True, ContainerRegistryApiMixin only used RegistryAuthentication (Basic auth), ignoring any custom backends configured in DEFAULT_AUTHENTICATION_CLASSES. Now includes both RegistryAuthentication and all configured default authentication classes, allowing deployments to use custom auth backends alongside standard Basic auth for container registry operations. Fixes #2362 Co-Authored-By: Claude Opus 4.6 (1M context) --- CHANGES/2362.feature | 3 +++ pulp_container/app/registry_api.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 CHANGES/2362.feature diff --git a/CHANGES/2362.feature b/CHANGES/2362.feature new file mode 100644 index 000000000..30b01e8af --- /dev/null +++ b/CHANGES/2362.feature @@ -0,0 +1,3 @@ +When token auth is disabled, container registry API views now include +DEFAULT_AUTHENTICATION_CLASSES alongside RegistryAuthentication, allowing +deployments to use custom authentication backends. diff --git a/pulp_container/app/registry_api.py b/pulp_container/app/registry_api.py index ed9ece403..9e7217218 100644 --- a/pulp_container/app/registry_api.py +++ b/pulp_container/app/registry_api.py @@ -230,9 +230,14 @@ class ContainerRegistryApiMixin: def authentication_classes(self): """ List of authentication classes to check for this view. + + When token auth is disabled, includes both RegistryAuthentication (Basic auth) + and any authentication classes configured in DEFAULT_AUTHENTICATION_CLASSES. + 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): - return [RegistryAuthentication] + return [RegistryAuthentication, *api_settings.DEFAULT_AUTHENTICATION_CLASSES] return [TokenAuthentication] @property