You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: LTI 1.3 Passport Refactor + Database Cleanup Support (#627)
* feat(models): split LTI 1.3 configuration into separate Passport model
- 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
* feat(lti): add signal handlers for LTI configuration deletion
* 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
* fix(lti): correct spelling and improve logging in signal handlers
• 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
* fix: lint issues
* feat: install openedx-events
* fix: model label
* fix: handle no location
* test: fix tests
* fix: lint issues
* fixup! fix: lint issues
* test: add signal tests
* fix: coverage
* refactor(models): rename create_lti_1p3_passport to get_or_create_lti_1p3_passport
* fix: copy-paste bug when both public key and keyset url is specified
* fix: lint issues
* test: improve coverage
* refactor(views): remove unnecessary db call
* feat: add name and context key to passport and fix race condition
- 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.
* fix: create name only if block is available
* fix: test
* refactor: migration
* chore: upgrade
* refactor: avoid duplicate signal triggers
* refactor: api
* refactor: rename
* fix: tests
* chore: fix lint issues
* test: add some more
* fix: tests
* fix: coverage issue
* chore: upgrade
* fix: handle duplicate block explicitly
* fix: upgrade conflicts
* refactor: robust duplicate signal handler
* fix: migration for missing location field in configurations
Adds tests covering possible cases
* fix: lint issues
* refactor: remove logic that update block fields in migration
* refactor: add passport id to xml
* fix(migrations): restore config fields from passport on reverse
* refactor: apply suggestions and update docs
* feat: bump version and update changelog
* docs: Update lti_consumer/lti_xblock.py
* docs: Update lti_consumer/migrations/0021_create_lti_1p3_passport.py
* fix: remove unrelated file
* fix: update requirements
* refactor: remove save_xblock helper
As we add passport_id from database while exporting xml, we don't need to
add it to the block explicitly. This avoids modifying the xblock outside
of author edit cycle.
* test: fix tests
* Revert "refactor: remove save_xblock helper"
This reverts commit 8e5b926.
* Revert "test: fix tests"
This reverts commit fac60e2.
* chore: fix typo
---------
Co-authored-by: Feanil Patel <feanil@axim.org>
0 commit comments