Skip to content

feat!: remove deprecated course/library aliases from scopes endpoint - #610

Merged
BryanttV merged 2 commits into
mainfrom
bav/remove-deprecated-scope-aliases
Nov 12, 2026
Merged

BryanttV merged 2 commits into
mainfrom
bav/remove-deprecated-scope-aliases

Conversation

@BryanttV

@BryanttV BryanttV commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Description

GET /api/authz/v1/scopes/ changed its scope_type values from course/library to course-v1/lib, and kept the old values as deprecated aliases so the change was not breaking while the Admin Console migrated. Now that the Admin Console uses the new values, the aliases are dead code. This PR removes them so the API exposes a single set of values, the same as /roles/.

  • Removes DEPRECATED_SCOPE_TYPE_ALIASES (rest_api/data.py) and ScopeTypeAliasField (rest_api/v1/admin_console/serializers.py). scope_type is now a plain ChoiceField.
  • Requests with scope_type=course or scope_type=library now return 400. course-v1 and lib keep working.
  • Updates the OpenAPI description of scope_type and the "Scope type naming" section of ADR 0028 so they no longer mention the aliases.
  • Adds a breaking change entry to the changelog.
  • Tests: removes the alias cases, adds rejection cases for course and library, and moves the two management-permission tests to course-v1/lib.

Affected roles: Developers and operators calling /scopes/ directly. The Admin Console is not affected once it uses the new values.

Supporting Information

Testing Instructions

  1. Authenticate as a user with permission to view team members.

  2. Request GET /api/authz/v1/scopes/?scope_type=course-v1 and verify 200 with only course scopes.

  3. Request GET /api/authz/v1/scopes/?scope_type=lib and verify 200 with only library scopes.

  4. Request GET /api/authz/v1/scopes/?scope_type=course and then ?scope_type=library. Verify both return 400.

  5. Run the automated tests:

    pytest src/openedx_authz/tests/rest_api

Deadline

None

Other Information

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Nov 6, 2026
@openedx-webhooks

openedx-webhooks commented Nov 6, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @BryanttV!

This repository is currently maintained by @openedx/committers-openedx-authz.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Nov 6, 2026
@BryanttV
BryanttV force-pushed the bav/remove-deprecated-scope-aliases branch from 9ef71b5 to 58c4bee Compare November 6, 2026 15:57
GET /api/authz/v1/scopes/ now accepts only scope_type=course-v1 and
scope_type=lib. The deprecated course and library aliases are rejected
with a validation error, as /roles/ already does.

Refs #536

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@BryanttV
BryanttV force-pushed the bav/remove-deprecated-scope-aliases branch from 58c4bee to 6c6af43 Compare November 11, 2026 22:30
@BryanttV
BryanttV marked this pull request as ready for review November 11, 2026 22:31
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@mariajgrimaldi mariajgrimaldi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks so much for cleaning this up :)

@BryanttV
BryanttV merged commit c48f81a into main Nov 12, 2026
8 checks passed
@BryanttV
BryanttV deleted the bav/remove-deprecated-scope-aliases branch November 12, 2026 19:32
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Contributions Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Remove deprecated course/library aliases from the scopes endpoint

3 participants