-
Notifications
You must be signed in to change notification settings - Fork 81
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-24] [TNL-7318]: LTI AGS Implementation - LineItem Service #92
[BD-24] [TNL-7318]: LTI AGS Implementation - LineItem Service #92
Conversation
Thanks for the pull request, @giovannicimolin! I've created BLENDED-489 to keep track of it in Jira. More details are on the BD-24 project page. When this pull request is ready, tag your edX technical lead. |
@nedbat Since the first two PRs supporting this one were merged, I'll pick this up next week, rebase, add tests and make sure it's fully compliant to the LTI spec (at least for the LineItem endpoint). In the meantime, can you take a look at the architectural decisions I've taken here? I'm mostly concerned about these things:
References: |
8074666
to
3a8aec4
Compare
@nedbat At this point the main implementation is finished. I'm just writing tests (a lot of them) and cleaning it up. |
8d5360c
to
bcd36aa
Compare
acaca93
to
11fd22d
Compare
@viadanna Ready for review. |
Signed-off-by: Giovanni Cimolin da Silva <[email protected]>
4bc81ae
to
ef0cc83
Compare
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.
LGTM 👍
- I tested this as per testing instruction
- I read through the code
- [ ] I checked for accessibility issues - Includes documentation
- [ ] I made sure any change in configuration variables is reflected in the corresponding client'sconfiguration-secure
repository.
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.
Very nice. A few comments, I think only one point that could be a real problem.
# LTI-AGS Scopes | ||
'https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly', | ||
'https://purl.imsglobal.org/spec/lti-ags/scope/lineitem', | ||
] |
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.
We don't have to add https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly
and https://purl.imsglobal.org/spec/lti-ags/scope/score
here?
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.
@nedbat The results
and score
services are being implemented in separate tasks (https://openedx.atlassian.net/browse/TNL-7331 and https://openedx.atlassian.net/browse/TNL-7332) to keep the diff size smaller.
There's already a WIP PR out, based on this branch: #108. Which will be rebased when this lands.
|
||
Recreated here since we cannot import directly from | ||
from the platform like so: | ||
`from openedx.core.lib.api.serializers import UsageKeyField` |
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 wonder if this means this code should go into the opaque-keys library? (Not now, but eventually.)
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.
@nedbat Yes, this serializer should be moved from the core to opaque-keys
.
If you prefer, I can move this to compat.py
and mock the serializer in tests.
What do you say?
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 am fine with merging this as is, and bringing up this need with the owners of opaque-keys to address.
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.
@nedbat Thanks for that! Can you ping the owners on this use case? I'm not sure if there's other places duplicating this code (or avoiding UsageKey
serialization on plugins at all).
"endDateTime": "2018-04-06T22:05:03Z" | ||
} | ||
|
||
Note: The platform MUST NOT modify the 'resourceId', 'resourceLinkId' and 'tag' values. |
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 don't understand what this means. Why would a serializer ever modify anything?
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've successfully run the IMS Validator on this branch. |
This PR implements the LTI AGS LineItem Service.
What does these changes do?
They are implementing the LTI AGS LineItem implementation and putting on the groundwork required to launch other LTI Advantage services.
The changes here include a partial shift to the LTI configuration being stored in a model, authentication methods and all things needed to get the LineItem service working.
Where is the LTI configuration stored?
In the XBlocks, we're only currently using a model as a proxy to the settings stored in the blocks.
What are the main architecture changes?
LineItems are stored on Django models and use DRF to provide a CRUD API for LineItems.
XBlock configuration is still stored on xblock fields, but it's accessed through a python API.
What are the next steps for this?
Chunk this change into manageable and easy to review pull requests:
Testing instructions:
master
's devstacksrc
folder.lms
andstudio
usingpip install -e /edx/src/xblock-lti-consumer
, apply migrations.studio.yml
and enable the following feature flag:make studio-restart
) and log in.lti_consumer
to the advanced modules list and add it to a course.LTI Version
to LTI 1.3, and mark .LTI 1.3 Tool Public Key
field. Save the private key for later.RS-256
and paste the private key in the private key file. Header and Body as follows and then copy the JWT.OAuth Token URL
and make the following request (don't forget to replace the JWT from the previous step). This will yield your access token to use the endpoints.POST
:(Optionally)
If you have a LTI 1.3 tool set up locally:
13. Perform a launch, and check that the LTI message includes the AGS claim:
Certification suite:
To run the IMS certification suite properly, you'll need to override
LMS_BASE_URL
to match thengrok
url (so that the LTI AGS Claim contains the right URL).Reviewers: