why:
Course-related variable expansions aren't exposed
flag=none
refs INTEROP-6600
--------------------------------------------------
Test plan
(requires the LTI 1.3 Test Tool)
--------------------------------------------------
* Activate the feature flag "LTI Deep Linking for Module Index
Menu"
* Install a LTI Tool with the placement "module_index_menu_modal"
using the message_type "LtiDeepLinkingRequest"
* Go to Course > Module page
* Click on the 3 dots button-menu in the top of the page and
launch the tool
* the "Deep Linking" page should open
* add the custom variables in the "Custom Params (JSON)" field.
Example:
```
{
"canvas_course_endAt":"$Canvas.course.endAt",
"canvas_course_gradePassbackSetting":"$Canvas.course.gradePassbackSetting",
"canvas_course_hideDistributionGraphs":"$Canvas.course.hideDistributionGraphs",
"canvas_course_id":"$Canvas.course.id",
"canvas_course_name":"$Canvas.course.name",
"canvas_course_previousContextIds":"$Canvas.course.previousContextIds",
"canvas_course_previousContextIds_recursive":"$Canvas.course.previousContextIds.recursive",
"canvas_course_previousCourseIds":"$Canvas.course.previousCourseIds",
"canvas_course_sectionIds":"$Canvas.course.sectionIds",
"canvas_course_sectionRestricted":"$Canvas.course.sectionRestricted",
"canvas_course_sectionSisSourceIds":"$Canvas.course.sectionSisSourceIds",
"canvas_course_sisSourceId":"$Canvas.course.sisSourceId",
"canvas_course_startAt":"$Canvas.course.startAt",
"canvas_course_workflowState":"$Canvas.course.workflowState"
}
```
* click on "Send Deep Link to Platform"
* open the assignment created to launch the tool
* in the "Decoded JWT" field, check in the JSON for the key
"https://purl.imsglobal.org/spec/lti/claim/custom". There
should be the requested custom variables
Change-Id: Icbe518b67dc62da7b056af31feb5be85f13b6104
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294961
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Alexis Nast <alexis.nast@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
This commit adds some additional variable expansions to the NRPS
service. According to the LTI 1.3 NRPS 2.0 spec, variable expansions are
only supported for requests that are "queried in the context of a
Resource Link". This means messages that don't send a rlid parameter
will not get any expanded resources.
flag = none
closes INTEROP-7410
test-plan:
- First, ensure you have an installation of the LTI 1.3 test tool that
has at least the contextmembership.readonly scope. In addition, ensure
the test tool has the new variables as substitutions and that it is
installed in a placement that lets it create resource links, typically
assignment_selection or link_selection. I used the
assignment_selection placement.
- Create an assignment (or resource link in general). Take note of the
resource link id. It's a UUID/GUID. You can find it by launching the
assignment you created and looking for {{.resource_link}}{{.id}}.
- Visit lti13testtool.docker/nrps/new. The context id is the id of the
course you just created the resource link in, the rlid is the
resource_link.id you just took note of, and the credential id is the
credential of the tool inside the LTI 1.3 Test Tool's database.
- Send off the request and you should get some JSON back. Look under the
custom claims section and you should see the variables you just added
in their expanded format.
Change-Id: I0994733b588912b2edfce2e959413a07f4c9545e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292043
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Alexis Nast <alexis.nast@instructure.com>
why:
* to conform to LTI spec by returning endDateTime
in the response of AGS create/update calls
* though the date is now stored twice (once on Assignment, once on
Lti::LineItem), there is a situation where they can be different
(set on line item that's not the primary for the assignment), even
though that wouldn't actually do anything
refs INTEROP-7265
flag=none
test plan:
* run migrations
* follow test plan from parent commit to create/update line item
using AGS API
* note that the endDateTime attribute is present in the response
Change-Id: Id3bbdd5f328476fb02fd96a005a655902fa8dac4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/291045
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Alexis Nast <alexis.nast@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
https://gerrit.instructure.com/c/canvas-lms/+/289809
is a prereq, since it creates the course pacing
notice react component used here.
refs LS-3034
flag=course_paces
test plan:
- in a course with course pacing on
- create a quiz
> expect a notice about course pacing managing due dates
in lieu of the due date inputs
- click the go to course pacing link
> expect to go to the course pacing page
- go back and save the quiz
> expect the notice on the quiz "show" page.
Change-Id: Ifa00021eddb6ad11efa2d3691d02093ce3691193
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/289823
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
closes INTEROP-7267
flag=none
why:
* to facilitate 1.1 to 1.3 migration for tools that may only be able to
link line items using the original resource link url
test plan:
* install the LTI 1.3 test tool
* get an LTI token for that tool using
`canvas.docker/api/lti/advantage_token?tool_id=1`,
replacing 1 with the id of your 1.3 test tool
* construct an API request for the AGS Line Items API for a course
with at least one line item:
`canvas.docker/api/lti/courses/1/line_items`,
and add the LTI token to the Authorization header using
`Bearer: <token>`
* the request should return a list of line items in JSON format
* add `?include[]=launch_url` to the request
* each line item should now have a new canvas extension property that
contains the launch url for that line item and its related assignment
* change the request to request a specific line item (like add `/1` on
the end), still with the query param
* it should return one line item, with the new extension property
* remove the query param or change the value to something else
* it should not return the extension property
Change-Id: I0caa494111fde4093f99fef1398b27799b07a6cf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287096
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Alexis Nast <alexis.nast@instructure.com>
auto-corrected, with a bit of manual massaging afterwards if there were
multiple delegations to the same object to combine them into a single
call
Change-Id: Ic93ccad26b037e1f89874d36f9759e5c34435892
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278965
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
[skip-stages=Flakey]
auto-corrected for the most part, but I went through specs and used
the have_key matcher when possible
Change-Id: I4a2df1cdd536a94f3b493668386883d1148660c9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278050
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
app except for app/models, config
all manual. many cases I removed the unused argument entirely, and
updated callers to not send it
there were also a few "override this method and raise an exception so
you don't use it cause rails is changed" methods that were for old
rails versions that I just removed completely
Change-Id: I071a5a8266801427c5c7a157fefe14850495e620
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276446
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
closes FOO-2467
flag=none
[skip-stages=Flakey]
Since canvas and it's plugins
share an autoloader, they need
to make consistent choices about how to inflect
the same acronyms
TEST PLAN:
1) tests pass
Change-Id: Icb133f33ed3e719b616e42e497bac1dc65bd9370
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275496
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
closes FOO-2226
flag = granular_permissions_manage_assignments
Split manage_assignments_add and manage_assignments_delete off from the
main manage_assignments permission.
These permissions control more granularity for adding and deleting the
following types of content:
- Assignments
- Assignment Groups
- Quizzes
- Question Banks
- Questions within Question Banks
- Live Assessments
test plan:
[ with the flag off ]
- Smoke test creating, editing and deleting assignments, assignment
groups, quizzes, and question banks.
- It should all work as before.
[ with the flag on ]
- Create roles that have only the add permission, only the manage
permission, and only the delete permission.
- With those three roles, as well as with a role with all permission,
try creating, editing, and deleting assignments, assignment groups,
quizzes, and quesiton banks.
- It should make sense with the role.
Change-Id: I06505509e55e7ac6c3b5ef1c688ef1353e2045d8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271290
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
fixes LS-2307, LS-2308, LS-2309
flag=important_dates
test plan:
- Enable important dates site admin flag
- Create or find a C4E subject course
- Create an assignment
- Verify there is a checkbox for important dates under due date form
- Verify the checkbox is disabled if no due dates are set
- Verify the checkbox is enabled if a due date is set on any date
- Save the assignment and verify the checkbox is still checked
- Verify this behavior works in the other places this component is used.
For example, quizzes, graded discussions, etc.
Change-Id: If2e806a8de764f467bf9ca086740260f2df015d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268061
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
This is part 3 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links.
We start to read from the new columns created lookup_uuid and
resource_link_uuid.
Adding a migration to remove the not-null constraint of lookup_id and
resource_link_id columns. As part 3.1 we'll stop writing into these
columns, we need to execute this postdeploy migration at this point.
refs INTEROP-6488
flag=none
test-plan:
* specs should pass;
* you should check if LTI is launching as expected, and if the custom
params was expanded as expected in all records that were created in the
part 1 and 2;
* you should be able to new persist custom params, for example you can
use the RCE editor placement;
* you can follow the test-plan:
* https://gerrit.instructure.com/c/canvas-lms/+/256029
* https://gerrit.instructure.com/c/canvas-lms/+/254453
[fsc-timeout=30]
Change-Id: I401f53a82f4dbef66c45932eb2eed8727488313d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258246
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Test plan:
1. Ensure that the new migration has run.
1. Because of 2 existing migrations with future dates, you may need
to rollback 3 steps before you can run the new migration.
2. Run `rake db:rollback STEP=3` followed by `rake db:migrate` in
the web container.
2. Create a new Quiz in the Canvas UI.
3. In the Rails console, verify that the `disable_timer_autosubmission`
value for this quiz is equal to false:
`Assignment.last.quiz.disable_timer_autosubmission`
4. Update the value to true:
`Assignment.last.quiz.update_attribute(:disable_timer_autosubmission,
true)`
5. Verify that the value is now equal to `true` using the command in
step 3.
6. A new Quiz attribute `timer_autosubmit_disabled?` is exposed that
factors in the feature flag as well. Verify that this value returns
as expected with different combinations of the feature flag and
`disable_timer_autosubmission`.
1. Read this flag in the Rails console with:
`Assignment.last.quiz.timer_autosubmit_disabled?`
Refs PFS-15510
Refs PFS-15511
flag=timer_without_autosubmission
Change-Id: I4749bdd46dd06a425141636c41e0f30c0dfc88a9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/233860
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
Product-Review: Chad McGuire <cmcguire@instructure.com>
QA-Review: Petra Ashment <pashment@instructure.com>
(for N.Q mobile and N.Q Respondus)
closes QUIZ-6788
test plan:
- create old quizzes and new quizzes in Canvas
- /api/v1/course/:course_id/all_quizzes will return json for both
old quizzes and new quizzes
Change-Id: I98c9a40b4075566a1945e3c46ef7b5dcb1c7dcac
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218090
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Kevin Dougherty <jdougherty@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
closes QUIZ-6791
test plan:
- test the ps with quiz_lti patch
- make sure quiz migration works
- quiz shell is created
- quiz shell status is updated when quiz migration is done
Change-Id: Ia002ceb48ded582849301e3efd8631396d9ffe95
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/210548
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Kevin Dougherty <jdougherty@instructure.com>
closes PLAT-4918
Test Plan:
- do a nrps launch and see that the response now has the
lti11_legacy_user_id set to the old user.lti_context_id and,
if the user was not launched with a 1.1 tool before, has the
new lti_id as the user_id
- do a launch with a 1.1 tool before launching with the 1.3 tool
- note that the user_id and the lti_id are the same
Change-Id: I5aa2229a2ad983989929dfd83f1b7abc3519b002
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/214072
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
(flag=newquizzes_on_quiz_page)
- populate N.Q quizzes to assignment quizzes list
- display kebab menu based on quiz types (old quizze and new quizzes)
- items in kebab menu are functional
closes QUIZ-6790, QUIZ-6792, QUIZ-6789, QUIZ-6786
test plan:
- With the newquizzes_on_quiz_page flag disabled
everything should behave like in production
- With the newquizzes_on_quiz_page flag enabled
1) N.Q quizzes show up on Quizzes Page
2) N.Q quiz shells have correct kebab menu
3) each menu items (delete, duplicate) should work
Change-Id: Ie4a78bb0f0a69f4d6e248135d1c486f1ca0ffe7f
Reviewed-on: https://gerrit.instructure.com/209993
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Kevin Dougherty III <jdougherty@instructure.com>
Fixes PLAT-4718
Test Plan:
-create an event
-verify asset_name is in body of event
-create a context external tool
-verify asset name is not in body of event
Change-Id: I96d38dfc74b1888aae962e62ee06d025f83ff35b
Reviewed-on: https://gerrit.instructure.com/204268
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Oxana Jurosevic
Closes PLAT-3849
Test Plan:
- Trigger a live event by download a file from 1 of a few places including:
1. Your account > Files
2. Course > Files
- Verify an asset_accessed event is created and includes 2 new fields:
(filename & display_name)
Change-Id: I9c0ca7c21b373250ed69c025da59d6057a598c87
Reviewed-on: https://gerrit.instructure.com/197857
Tested-by: Jenkins
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Oxana Jurosevic
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
refs PLAT-4486
Test Plan:
- create a line_item with the extension defined, should show up
in the retrieval of that line_item
Change-Id: Ia379329dc3509c4d91b81d6e218afb9add7d9dc7
Reviewed-on: https://gerrit.instructure.com/198547
Tested-by: Jenkins
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
closes PLAT-4486
Test Plan:
- Update a Score on a LineItem via an LTI tool
and include a submissionUrl
- make sure both the Submission and Result reflect the new URL
- also try to submit URL without a grade
Change-Id: I4c92fc86bee28a9ffc2599108a417c46a20cf532
Reviewed-on: https://gerrit.instructure.com/198401
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
Closes PLAT-4442
Test Plan:
- Launch an external tool that has a url, domain, and name
- Verify these fields are included in the asset accessed
event that is sent
- Verify other asset accessed event bodies remain unchanged
Change-Id: Ia728a784b01cc640a8619fa05ca01acae2e918b7
Reviewed-on: https://gerrit.instructure.com/197694
Tested-by: Jenkins
Reviewed-by: Drake Harper <dharper@instructure.com>
Reviewed-by: Clint Furse <cfurse@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Variable Expansion for sis_ids was causing an n+1 because
the lookup for the pseudonym didn't take into account if
the pseudonyms were preloaded.
Because of this, several other expansions would have produced
n+1s, so all known n+1 scenarios have been fixed.
fixes PLAT-4241
Test Plan:
tests pass
Change-Id: Ib39068e8e5f1e17a0963443148438b1d16287526
Reviewed-on: https://gerrit.instructure.com/195731
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
fixes PLAT-4481
Test Plan:
-Create 3 courses
-Create 2 users
-Enroll user 1 in courses 1 and 2
-Merge users
-Enroll user 2 in course 3
-Check to see user ids are different
Change-Id: I9da709285f8fdbaab238f1f1c8ceb127a748de11
Reviewed-on: https://gerrit.instructure.com/193535
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
NRPS calls were sending the wrong user_id, now
will send the lti_id instead of the lti_context_id.
fixes PLAT-4402
Test Plan:
- Do a nrps call, note that the user_id is the lti_id of the users
Change-Id: I32950c7b73ff4448426ff0c0a38ecd60e410eebf
Reviewed-on: https://gerrit.instructure.com/191728
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
Call the message validations on the lti messages
before we send the launch.
closes PLAT-4117
Test Plan:
- do a launch, it should still work
Change-Id: I34d20c328173158c76b11aacf7028f7eb152f87b
Reviewed-on: https://gerrit.instructure.com/185216
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
i can't reproduce the errors but maybe changing it from
the def_delegators weirdness will magically fix it or
at least make it easier to track down
refs #QO-435
Change-Id: Ia286fc3a4556715048dfe5620afd154fff18fcfe
Reviewed-on: https://gerrit.instructure.com/184154
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Aaron Griffin <agriffin@instructure.com>
Tested-by: Jenkins
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Closes PLAT-4158
Test Plan:
Use the index and show endpoint of the result service to
verify the result contains the lti_id of the user rather
than the Canvas id.
Change-Id: I0ab8fc2d8b3923a6a11d2a88f3a6cea127a94f0b
Reviewed-on: https://gerrit.instructure.com/178486
Tested-by: Jenkins
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
refs PLAT-4082
Test Plan:
- Run through creation of lineitems, retrieving them, making
scores, and retrieving results. They should all work now.
Change-Id: I2b045ddcfd11092509a51af2cd2b0d43819e709f
Reviewed-on: https://gerrit.instructure.com/177115
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
closes PLAT-4030
Test Plan:
- AGS should work with test tool
- install the test tool and make an assignment
out of it
- use the tool to return a line item and scores
and results and such
- also, from teh tool, create a new line item
and do the results and scores and such
Change-Id: I4f1a6bab561e10d38158748626cf94ec61d8916f
Reviewed-on: https://gerrit.instructure.com/174095
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Jenkins
Product-Review: Marc Phillips <mphillips@instructure.com>
Fixes PLAT-3924
Test Plan:
- Create a new LTI key
- Without refreshing the page verify the following:
* toggling the "on/off" switch works
* the global id of the key is displayed
* the key's secret is available
Change-Id: I1cde9db31ecf8315a7814633d398364acea0a45f
Reviewed-on: https://gerrit.instructure.com/170184
Tested-by: Jenkins
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
- Adds support for outputting two top-level claims
in the NRPS v2 per-member `message` array element:
- `https://www.instructure.com/canvas_user_id`
- `https://www.instructure.com/canvas_user_login_id`
- While the `picture` claim is not included here, it
_is_ normally included in a LTI 1.3 launch request, but
with a different lookup mechanims than what NRPS v2 had
been using prevously (`User.avatar_url` rather than
`User.avatar_image_url`). So for launch<->NRPS parity,
the latter has been changed to match the former.
- Since we now need to whitelist the "public" claim
group, we needed a way to exclude the `role_scope_mentor`
claimn because it results in a N+1. So that claim was promoted
to its own group.
- Since claim groups were being re-organized, took the
opportunity to expanded claim group tests to verify
`privacy_level` enforcement.
References LTIA-41
Test Plan
- Place a LTI 1.3-enabled tool in a `Course` with several
active members.
- Invoke the NRPS v2 service for that tool and `Course`.
- Verify correct rendering of the `picture` field in `members`
elements.
- Verify correct rendering of
`https://www.instructure.com/canvas_user_id` and
`https://www.instructure.com/canvas_user_login_id` top-level
claims in each `member`'s `message` array element.
- Adjust the tool's `privacy_policy` to be non-`public`, verify
that neither `https://www.instructure.com/canvas_user_id` and
`https://www.instructure.com/canvas_user_login_id` claim
renders.
Change-Id: Ic3f306591214dd25815e8e4acc6f5c8d3d3aafac
Reviewed-on: https://gerrit.instructure.com/169525
Tested-by: Jenkins
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Bill Smith <bsmith@instructure.com>
- Previously custom param rules were in `MembershipsProvider`
and claim group rules were in `NamesAndRolesSerializer`. Now
they're all in the latter.
- Also moved `privacy_level` enforcement into
`NamesAndRolesSerializer` since that involves rendering of
one special custom param and all custom param config had
been moved into that class. This obviated the need for
`UserDecorator`, which is now completely removed.
- Simplified LTI message matchers significantly by accepting
an `opts` hash. So now we're back to just two top-level
code paths through those matchers... one for groups and one
for courses. Previously each of those had an alternate path
for `rlid` matching rules.
References LTIA-41
Test Plan:
- This is purely a technical refactoring. No behavioral difference
should be observable.
- To guard against regressions, repeat selections from:
- LTIA-41 tests to verify correct rendering of custom params when
the `rlid` query param is present
- LTIA-13/19 tests to verify correct enforcement of tool
`privacy_level`
- LTIA-24/34 tests to verify correct rendering of the
`lis_person_sourcedid` field.
Change-Id: If07e3886eeb069379b01282686133517446f9f4b
Reviewed-on: https://gerrit.instructure.com/169495
Tested-by: Jenkins
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Bill Smith <bsmith@instructure.com>
- Expands the `Canvas.xapi.url` and `Caliper.url` custom params into
the per-`member` `message` array in NRPS v2 responses.
- The custom param expansion itself was already present and did not
introduce any N+1s so patch is relatively simple. Biggest change
is that the `VariableExpander` needs to be given 'unwrapped'
AR entities since it does `is_a?` checks, especially on the context.
Refs LTIA-41
Test Plan:
- Confgure a LTI 1.3/Advantage tool with the
`$Canvas.xapi.url` and `$Caliper.url` custom params.
- Place that tool into a `Course` with active members
- Request NRPS v2 for that `Course`, specifying the course's LTI ID
as the value of the `rlid` query parameter.
- Verify that, for all active `Course` members, the expanded
`$Canvas.xapi.url` and `$Caliper.url` params have the following form:
- xAPI: `<base>/api/lti/v1/xapi/:tool_id-:user_id-:course_id-:timestamp-:nonce-:signature`
- Caliper: `<base>/api/lti/v1/caliper/:tool_id-:user_id-:course_id-:timestamp-:nonce-:signature`
Change-Id: I50f1e0470db29edba919cb48342d1b0d6ba0162d
Reviewed-on: https://gerrit.instructure.com/169381
Tested-by: Jenkins
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Bill Smith <bsmith@instructure.com>
- Expands the `Person.address.timezone` custom param into
the per-`member` `message` array in NRPS v2 responses.
- The custom param expansion itself was already present but,
since we're rendering multiple users, the implementation
required the same trick as `$Message.locale` where we
temporarily set the time zone to match the current user,
then un-set back to the previous value after the user finishes
rendering.
- Also fix an typo in the nearby `$vnd.Canvas.Person.email.sis`
test setup.
Refs LTIA-41
Test Plan:
- Confgure a LTI 1.3/Advantage tool with the
`$Person.address.timezone` custom param.
- Place that tool into a `Course` with active members where at least
one member has a non-standard time zone preference.
- Request NRPS v2 for that `Course`, specifying the course's LTI ID
as the value of the `rlid` query parameter.
- Verify that, for all active `Course` members, the expanded
`$Person.address.timezone` custom param in the per-`member` NRPS v2
`message` array has the same value as the `member`'s time zone
preference or else the account default.
Change-Id: Ia701e5aa9021b54d42b830da61f41dd977db6b87
Reviewed-on: https://gerrit.instructure.com/169332
Tested-by: Jenkins
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Bill Smith <bsmith@instructure.com>