Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use AWX base view to make unauth requests 401 #14981

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

AlanCoding
Copy link
Member

@AlanCoding AlanCoding commented Mar 12, 2024

SUMMARY

This is needed to fix "crawler" test failures, where 403 responses are given to unauthenticated users and 401 is expected.

See AWX get_authenticate_header method.

ALSO - note that without that method override

https://github.com/encode/django-rest-framework/blob/09a0c551ca934e486d2765e042a287c15fa85e75/rest_framework/views.py#L190

DRF uses

return authenticators[0].authenticate_header(request)

and in my case, this was AwxJWTAuthentication, which came from the DRF base class, which gave nothing, which became a 403. This is violently unstable, and will afflict other apps.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API

Copy link
Contributor

@jbradberry jbradberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlanCoding
Copy link
Member Author

The integration tests are looking good for this, so merging.

@AlanCoding AlanCoding merged commit fcd655c into ansible:feature_dab_rbac Mar 13, 2024
19 of 24 checks passed
djyasin pushed a commit to djyasin/awx that referenced this pull request Sep 16, 2024
djyasin pushed a commit to djyasin/awx that referenced this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants