Skip to content

Commit

Permalink
Revert "Return 401 instead of 403"
Browse files Browse the repository at this point in the history
This reverts commit 3979fb6.

closes pulp#1254

The change disallowed users to use customized authentication classes,
e.g., for managing credentials by leveraging keycloak.
  • Loading branch information
lubosmj committed Apr 11, 2023
1 parent 583635d commit 45556c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/1254.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug that disallowed users to configure custom authentication classes for the token server.
2 changes: 0 additions & 2 deletions pulp_container/app/registry_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from pulpcore.plugin.files import PulpTemporaryUploadedFile
from pulpcore.plugin.tasking import add_and_remove, dispatch
from pulpcore.plugin.util import get_objects_for_user
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import (
AuthenticationFailed,
NotAuthenticated,
Expand Down Expand Up @@ -357,7 +356,6 @@ class BearerTokenView(APIView):
"""

# Allow everyone to access but still value authenticated users.
authentication_classes = [BasicAuthentication]
permission_classes = []

def get(self, request):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from urllib.parse import urljoin, urlparse
import requests
import pytest

from pulp_smash import api, config, cli
from pulp_smash.pulp3.bindings import delete_orphans, monitor_task
Expand Down Expand Up @@ -139,6 +140,9 @@ def compare_config_blob_digests(self, pulled_manifest_digest):
self.assertEqual(pulled_manifest_digest, config_blob_response["digest"])


@pytest.mark.skip(
reason="Skipping until the issue https://github.com/pulp/pulp_container/issues/918 is addressed"
)
def test_invalid_user(pulp_settings, local_registry):
"""Test if the token server correctly returns a 401 error in case of invalid credentials."""

Expand Down

0 comments on commit 45556c5

Please sign in to comment.