Skip to content

Commit

Permalink
Add a check for anonymous requests
Browse files Browse the repository at this point in the history
closes #1605

(cherry picked from commit b4c550e)
  • Loading branch information
lubosmj committed Jun 27, 2024
1 parent 6a411a7 commit 6176c5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES/1605.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed a bug that caused the registry to not accept requests from anonymous users when token
authentication was disabled.
3 changes: 3 additions & 0 deletions pulp_container/app/token_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ def authenticate(self, request):
If basic authentication could not success, remote webserver authentication is considered.
"""
if request.headers.get("Authorization") == "Basic Og==":
return (AnonymousUser, None)

try:
user = super().authenticate(request)
except AuthenticationFailed:
Expand Down

0 comments on commit 6176c5b

Please sign in to comment.