-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[BD-13][BB-6145] Move the rebind_noauth_module_to_user from ModuleSystem argument to service #30320
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
[BD-13][BB-6145] Move the rebind_noauth_module_to_user from ModuleSystem argument to service #30320
Conversation
|
Thanks for the pull request, @tecoholic! I've created BLENDED-1217 to keep track of it in Jira. More details are on the BD-13 project page. When this pull request is ready, tag your edX technical lead. |
f0aca32 to
cc1a5cf
Compare
5b42852 to
cb07579
Compare
|
@Agrendalath Thank you for the detailed review. I totally missed checking the LTI Consumer for the effects and also should have added the deprecation warning after you pointed it out in the hostname ticket. I have incorporated most of the changes you pointed out. A couple of points that I would like to mention:
Kindly take review this again when you get some time. Thanks again for the detailed review catching a number of crucial issues. |
cb07579 to
1de0c99
Compare
|
@Agrendalath I have updated the PR with fixes for the quality check failures. Kindly approve the workflows. |
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
1de0c99 to
3f1a5f1
Compare
|
@ormsbee, this only needs one small change I've mentioned above to be completed. Would you like to take a look at this (and potentially openedx/xblock-lti-consumer#249) before we move forward? |
3f1a5f1 to
5a01169
Compare
|
@Agrendalath @ormsbee The change mentioned in the above comment is now included in the PR. Good for a review. |
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
Agrendalath
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- I tested this: checked that the built-in LTI XBlock and LTI Consumer XBlock can rebind the user correctly
- I read through the code
- I checked for accessibility issues: n/a
- Includes documentation: n/a
- I made sure any change in configuration variables is reflected in the corresponding client's
configuration-securerepository: n/a
5a01169 to
dd9236f
Compare
|
@tecoholic, for the future - please don't squash commits until the review is finished. It's hard to follow exact changes, especially when we're rebasing the branch on the upstream one. |
|
@Agrendalath Noted. I will keep in mind not to squash until the review is over. 👍 |
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
dd9236f to
94f983e
Compare
This removes the `rebind_noauth_module_to_user` argument from the ModuleSystem constructor and moves it to a separate service called "rebinder" in the class `RebindModuleService`. This is used in the LTI module to bind calls recieved by its noauth endpoint to bind the module the real_user. The original function is defined as a local function and calls its parent function recursively to perform rebinding. Due to the heavy dependency of local variables, this new service is defined in the same module to minimize imports.
94f983e to
dc66174
Compare
|
@tecoholic 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
1 similar comment
|
EdX Release Notice: This PR has been deployed to the production environment. |
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
The `rebind_noauth_module_to_user` function is deprecated in the core edx-platform [1]. This is now replaced with a "rebind_user" service. This commit brings this change to the LTI Consumer XBlock. [1] - openedx/openedx-platform#30320
Description
This removes the
rebind_noauth_module_to_userargument from theModuleSystemconstructor and moves it to a separate service called "rebinder" in the classRebindModuleService. This is used in the LTI module to bind calls received by its noauth endpoint to bind the module the real_user.The original function is defined as a local function and calls its parent function recursively to perform rebinding. Due to the heavy dependency of local variables, this new service is defined in the same module to minimize imports.
Supporting information
Testing instructions
The changes primarily impact the LTI 2.0 JSON endpoint handlers in
common/lib/xmodule/xmodule/lti_2_util.py(lines 173 and 256). We will test PUT handler to verify that the module rebinding is working as expected and the anonymous ID resolves into the correct user_id when updating the scores from external LTI tools.masterbranch ofedx-platformSetup a test course in the dev environment of choice."lti"to the Advanced Modules List. (Note: this is not the currentlti_consumermodule, this is the olderltimodule)"saltire:consumer_key:secret"to it. We will use the Saltire testing tool to get the various values for testing.saltirehttps://saltire.lti.app/toolFalseTrueuser_idvalue. eg.,e449db316ca1652a94487273c2e9f042http://<your-domain>/courses/<your-course-id>/lti_rest_endpoints/. eg.,http://localhost:18000/courses/course-v1:UNIV+CS101+2022_T2/lti_rest_endpoints/The next steps involve running a Python script to make OAuth requests. You can achieve the same with any API client which supports OAuth 1.0.
test.py) with the following contents and fill in theREST_URLandUSER_IDvalues we noted previouslypython test.py, it should print200and exit indicating the PUT request with aresultScoreof successful. You can verify the same in the LMS logs and even notice the anonymous id getting translated into LMS's internal numerical ID in celery task logs.90for the studentresultScoreto verify the scores are updated.Testing the PR doesn't break module rebinding
edx-platformto the PR branch:open-craft:tecoholic/BB-6145-deprecate-rebind-noauth-module-to-userresultScorevalue and rerun the test script.Deadline
"None"