pulp / pulp/pulpcore

[PULP-396] PulpNoCreateRemoteUserBackend fails without rest_framework.permissions.AllowAny

Open
#6,309 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue
Dominant language
Python
Stars
598
Forks
168
Avg merge
1d 4h
Merged PRs (30d)
86

Description

Version

      "versions": {
        "deb": "3.5.1",
        "rpm": "3.28.0",
        "core": "3.70.0",
        "file": "3.70.0",
        "ostree": "2.4.6",
        "python": "3.13.2",
        "ansible": "0.24.1",
        "certguard": "3.70.0",
        "container": "2.24.0"
      }

Describe the bug
Katello uses remote authentication with no DB user. After upgrading from Pulpcore 3.63 to 3.70, API calls show:

vagrant@centos9-katello-devel-stable ~/foreman $ sudo pulp rpm repository list
Error: {"detail":"Authentication credentials were not provided."}

The same goes when adding the following in the config:

REST_FRAMEWORK__DEFAULT_PERMISSION_CLASSES = [
'rest_framework.permissions.IsAuthenticated'
]

I thought the above would work since admin (the only user we use) should be considered authenticated.

To access the API, I had to use rest_framework.permissions.AllowAny. Perhaps this is appropriate for Katello, but it's unclear.

For more context, here are the auth settings:

AUTHENTICATION_BACKENDS = ['pulpcore.app.authentication.PulpNoCreateRemoteUserBackend']

REST_FRAMEWORK__DEFAULT_AUTHENTICATION_CLASSES = (
    'rest_framework.authentication.SessionAuthentication',
    'pulpcore.app.authentication.PulpRemoteUserAuthentication'
)

With all of this said -- was it expected that we'd need to make a settings change to upgrade Pulp in Katello?

To Reproduce
Use the config described above, or just upgrade a Katello nightly box to Pulpcore 3.70.

Expected behavior
Auth continues working.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the upgrade from Pulpcore 3.63 to 3.70 with the stated AUTHENTICATION_BACKENDS, DEFAULT_AUTHENTICATION_CLASSES, and permission settings. Read the behavior around PulpNoCreateRemoteUserBackend and PulpRemoteUserAuthentication, then determine whether authentication should continue working or a settings change is required; done means the expected upgrade behavior and configuration are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.