feat: apply ADR 0034 (auth standardization) across 6 standardized APIs - #38796
Conversation
… compliant)
ADR 0034 — Unify Auth (OAuth2 DOT v2) — requires removing
BearerAuthentication / BearerAuthenticationAllowInactiveUser /
OAuth2Authentication / OAuth2AuthenticationAllowInactiveUser from
authentication_classes per OEP-0042.
XblockViewSet.authentication_classes is already:
(JwtAuthentication, SessionAuthenticationAllowInactiveUser)
— matches the ADR 0034 target pattern. The explicit declaration is
preserved (rather than relying on platform defaults) because the endpoint
needs SessionAuthenticationAllowInactiveUser rather than the default
SessionAuthentication. Documented in the module docstring.
No code changes required.
…eady compliant) HomeViewSet.authentication_classes is already ``(JwtAuthentication, SessionAuthenticationAllowInactiveUser)`` — matches the ADR 0034 target. No Bearer or OAuth2 authentication classes to remove. Explicit declaration kept (rather than relying on platform defaults) so SessionAuthenticationAllowInactiveUser is used instead of the default SessionAuthentication. Documented in the module docstring.
…eady compliant) HomeCoursesViewSet.authentication_classes is already ``(JwtAuthentication, SessionAuthenticationAllowInactiveUser)`` — matches the ADR 0034 target. No Bearer or OAuth2 authentication classes to remove. Documented in the class's ADR-compliance docstring.
ADR 0034 (Unify Auth — OEP-0042 alignment) deprecates
BearerAuthenticationAllowInactiveUser. All four enrollment v2 views had
the pattern (JwtAuthentication, BearerAuthenticationAllowInactiveUser,
EnrollmentCrossDomainSessionAuth); per the ADR's "Standard API" target,
the Bearer entry is removed and the rest of the tuple kept unchanged.
Updated:
* EnrollmentViewSet (list / create / unenroll / allowed)
* EnrollmentRetrieveView (GET /enrollment/{course_key})
* UserRolesView (GET /roles/)
* EnrollmentsAdminListView (GET /enrollments/, admin)
EnrollmentCrossDomainSessionAuth is retained (not replaced by the
platform-default SessionAuthentication) because these endpoints must
accept cross-domain Studio/LMS CSRF-validated session cookies. Each
viewset carries an inline comment explaining the deviation.
Dropped the now-unused BearerAuthenticationAllowInactiveUser import.
Module docstring updated to reflect ADR 0034 compliance.
No new dependencies. No behaviour changes for legitimate JWT or session
callers; Bearer-token callers (deprecated per OEP-0042) must migrate
to JWT.
…already compliant) CourseDetailsViewSet.authentication_classes is already ``(JwtAuthentication, SessionAuthenticationAllowInactiveUser)`` — matches the ADR 0034 target. No Bearer or OAuth2 authentication classes to remove. Documented in the module docstring.
…wset ADR 0034 (Unify Auth — OEP-0042 alignment) deprecates BearerAuthenticationAllowInactiveUser. AuthoringGradingViewSet had the pattern (JwtAuthentication, BearerAuthenticationAllowInactiveUser, SessionAuthenticationAllowInactiveUser); per the ADR's "Standard API" target the Bearer entry is removed and the rest of the tuple kept unchanged. SessionAuthenticationAllowInactiveUser is retained (rather than relying on the platform-default SessionAuthentication) so Studio authors whose accounts are temporarily inactive can still update grading; an inline comment records the deviation. Dropped the now-unused BearerAuthenticationAllowInactiveUser import. Module docstring updated to reflect ADR 0034 compliance. No new dependencies. No behaviour changes for JWT or session callers; Bearer-token callers (deprecated per OEP-0042) must migrate to JWT.
|
Thanks for the pull request, @taimoor-ahmed-1! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
3bc64c8
into
openedx:feat/axim-api_improvements
Summary
Applies ADR 0034 — Unify Auth (OAuth2 DOT v2) to the 6 APIs previously standardized under the FC-0118 effort.
ADR 0034 (per OEP-0042) deprecates `BearerAuthentication` / `BearerAuthenticationAllowInactiveUser` and their `OAuth2Authentication*` aliases. Target pattern is `(JwtAuthentication, SessionAuthenticationAllowInactiveUser)` (or the platform default `JwtAuthentication + SessionAuthentication`).
Changes
`feat` — Enrollment v2 (commit 4)
`BearerAuthenticationAllowInactiveUser` removed from 4 viewsets/views:
`EnrollmentCrossDomainSessionAuth` is retained (rather than the platform-default `SessionAuthentication`) because these endpoints must accept cross-domain Studio/LMS CSRF-validated session cookies. Each viewset carries an inline comment explaining the deviation.
`feat` — AuthorGrading v3 (commit 6)
`BearerAuthenticationAllowInactiveUser` removed from `AuthoringGradingViewSet`:
`SessionAuthenticationAllowInactiveUser` is retained so Studio authors whose accounts are temporarily inactive can still update grading.
`docs` — 4 already-compliant areas (commits 1, 2, 3, 5)
Each already uses the ADR 0034 target pattern `(JwtAuthentication, SessionAuthenticationAllowInactiveUser)` (or with `EnrollmentCrossDomainSessionAuth` in enrollment-adjacent code). The docs commits add an `ADR 0034` line to the module docstring confirming compliance and recording why the explicit declaration is kept rather than relying on platform defaults.
Behaviour
Test plan
🤖 Generated with Claude Code