Skip to content

feat: update openedx-lti role map#645

Draft
navinkarkera wants to merge 48 commits intoopenedx:masterfrom
open-craft:navin/FAL-4346/new-role-map
Draft

feat: update openedx-lti role map#645
navinkarkera wants to merge 48 commits intoopenedx:masterfrom
open-craft:navin/FAL-4346/new-role-map

Conversation

@navinkarkera
Copy link
Copy Markdown
Contributor

@navinkarkera navinkarkera commented Apr 15, 2026

- Introduce Lti1p3Passport model to centralize LTI 1.3 keys and credentials
- Move lti_1p3_internal_private_key, lti_1p3_internal_private_key_id,
  lti_1p3_internal_public_jwk, lti_1p3_client_id, lti_1p3_tool_public_key,
  and lti_1p3_tool_keyset_url fields from LtiConfiguration to Lti1p3Passport
- Add ForeignKey relationship from LtiConfiguration to Lti1p3Passport
- Implement passport-based key generation and retrieval
- Add clean() validation to Lti1p3Passport to ensure at least one of
  lti_1p3_tool_public_key or lti_1p3_tool_keyset_url is set
- Update validation in LtiConfiguration.clean() to check for passport
  presence instead of tool key fields
- Refactor get_or_create_local_lti_config() to handle passport creation
  and sync block/passport key configurations
- Update API endpoints to work with passport ID instead of configuration ID
- Add admin interface for Lti1p3Passport model
- Refactor access_token_endpoint and public_keyset_endpoint to use passport ID
- Update API and views to work with the new passport model
- Generate migration to remove fields from LtiConfiguration table
- Update data migration to copy existing configurations to the new Passport model
- Update XBlock to store passport ID instead of config ID
- Fix copy-paste issue in resource_link_id generation
* Add signal handlers to delete LTI configurations when xblocks or
  library blocks are deleted
* Ensure LTI configurations are properly cleaned up when associated
  blocks are removed from the system
* Update documentation for LTI 1.3 configuration changes to inform users
  about potential regeneration of client IDs and URLs when public keys
  are changed
• Fixed spelling errors (configurtion → configuration, url → URL)

• Improved log messages to be more informative

• Used more descriptive variable names (id_list → block_locations)

• Maintained consistent code style and import organization
- Added 'name' and 'context_key' fields to Lti1p3Passport model
- Modified LtiConfiguration to populate these fields when creating passports
- Updated admin interface to display new fields
- Added migration to populate existing passports with name and context_key
- Updated string representation of passport to include name

- Made 'location' field in LtiConfiguration unique to prevent race conditions
This fixes a race condition that occurred when get_or_create was called with the same location multiple times, which resulted in duplicate rows with identical locations being created simultaneously.
@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 Apr 15, 2026
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @navinkarkera!

This repository is currently maintained by @Faraz32123.

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.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.


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.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 98.48024% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.70%. Comparing base (7b1c939) to head (659869e).

Files with missing lines Patch % Lines
...ssport_context_key_lti1p3passport_name_and_more.py 76.92% 6 Missing ⚠️
lti_consumer/models.py 96.80% 3 Missing ⚠️
lti_consumer/lti_xblock.py 90.47% 2 Missing ⚠️
...onsumer/migrations/0021_create_lti_1p3_passport.py 90.90% 2 Missing ⚠️
lti_consumer/signals/signals.py 97.01% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #645      +/-   ##
==========================================
+ Coverage   97.59%   97.70%   +0.10%     
==========================================
  Files          79       84       +5     
  Lines        6871     7662     +791     
==========================================
+ Hits         6706     7486     +780     
- Misses        165      176      +11     
Flag Coverage Δ
unittests 97.70% <98.48%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Apr 16, 2026
@navinkarkera navinkarkera force-pushed the navin/FAL-4346/new-role-map branch from 5a80f80 to 659869e Compare April 17, 2026 07:12
@navinkarkera navinkarkera force-pushed the navin/FAL-4346/new-role-map branch from d12b0e0 to 659869e Compare April 17, 2026 12:33
@navinkarkera navinkarkera force-pushed the navin/FAL-4346/new-role-map branch from 659869e to 0565099 Compare April 17, 2026 12:33
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: Waiting on Author

Development

Successfully merging this pull request may close these issues.

3 participants