Skip to content

Commit eb201a5

Browse files
dklibanclaude
authored andcommitted
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) <noreply@anthropic.com>
1 parent 37ef477 commit eb201a5

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGES/2362.feature

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
When token auth is disabled, container registry API views now include
2+
DEFAULT_AUTHENTICATION_CLASSES alongside RegistryAuthentication, allowing
3+
deployments to use custom authentication backends.

pulp_container/app/registry_api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,14 @@ class ContainerRegistryApiMixin:
230230
def authentication_classes(self):
231231
"""
232232
List of authentication classes to check for this view.
233+
234+
When token auth is disabled, includes both RegistryAuthentication (Basic auth)
235+
and any authentication classes configured in DEFAULT_AUTHENTICATION_CLASSES.
236+
This allows deployments to use custom authentication backends (e.g. remote
237+
header-based auth) alongside standard Basic auth for container registry operations.
233238
"""
234239
if settings.get("TOKEN_AUTH_DISABLED", False):
235-
return [RegistryAuthentication]
240+
return [RegistryAuthentication, *api_settings.DEFAULT_AUTHENTICATION_CLASSES]
236241
return [TokenAuthentication]
237242

238243
@property

0 commit comments

Comments
 (0)