Commit Graph

20 Commits

Author SHA1 Message Date
James Butters 28f144cf8f spec: publish test results from gems running rspec
Change-Id: Ia2457bf89c27538612d0f42eaf92447b0cf23150
refs: CORE-3254
Reviewed-on: https://gerrit.instructure.com/207148
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-08-28 18:45:17 +00:00
Cody Cutrer bc72b78457 various gem bumps to allow rails 6
Change-Id: I3d09440a090838edc8dd4557d98705926c2aaa09
Reviewed-on: https://gerrit.instructure.com/202620
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-07-31 20:08:54 +00:00
wdransfield b7dcc16e0a Add "client_id" to login message
Closes PLAT-4713

Test Plan:
Do an LTI 1.3 launch and verify the correct client_id is sent
in the initial login message from Canvas

Change-Id: I7cb82be8dbe7a356cf6ead8fa37a14bcea957148
Reviewed-on: https://gerrit.instructure.com/203073
Tested-by: Jenkins
Reviewed-by: Clint Furse <cfurse@instructure.com>
QA-Review: Clint Furse <cfurse@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2019-07-30 19:00:44 +00:00
wdransfield 3fbabf23e1 Add canvas_region to LTI 1.3 login request
Closes PLAT-4658

Test Plan:
Do an LTI 1.3 launch and verify the canvas_region param is sent
in the login request. If your database server does not have a
region configured locally the value should be "not configured"

Change-Id: I2b4211504a3c8ed8420efc9d038e48f2896cefd8
Reviewed-on: https://gerrit.instructure.com/201176
Tested-by: Jenkins
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Clint Furse <cfurse@instructure.com>
2019-07-16 19:07:18 +00:00
Marc Phillips 5fe73fad00 Remove lti11_legacy_user_id
This was removed from the spec.

fixes PLAT-4346

Test Plan:
 - tests pass

Change-Id: I16ff8a72679cfa867e025b2d58d1913796cebfb3
Reviewed-on: https://gerrit.instructure.com/187655
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2019-04-04 15:53:35 +00:00
Marc Phillips fa3dfcb3d6 Add lti-advantage gem validation
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>
2019-03-15 15:56:34 +00:00
Simon Williams 63e708f09f spec: a bit of cleanup in gems/ tests
sqlite3 released a new version yesterday, but active record is pinned to
a previous version in a way that just errors. the version pins here can
be reverted once rails releases a compatibility update. see
https://github.com/rails/rails/pull/35154

Change-Id: If9edc76058d96a75b8731422407ecea2afb4ce29
Reviewed-on: https://gerrit.instructure.com/180583
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Jenkins
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2019-02-06 15:19:17 +00:00
Marc Phillips a0a7190227 Add target_link_uri to spec
closes PLAT-4107

Test plan:
 - Using the test tool, do a launch and see that
   the target_link_uri is sent on the login and
   the final launch as a claim

Change-Id: I32da1f86a5a0c47e3aee6d66aeac74439696276b
Reviewed-on: https://gerrit.instructure.com/177299
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
2019-01-09 22:25:38 +00:00
Marc Phillips 3f10c83497 Add unique lti_id to users
closes PLAT-4050

Test Plan:
 - create a user, should work
 - update a user, should work
 - attempt to change the lti_id in teh console, should fail
 - attempt a 1.3 launch and note that id is changed to new id
   - also note the lti11_legacy_user_id field is present

Change-Id: I2747d76b08714a66cd2862b81c4f50e5068021e8
Reviewed-on: https://gerrit.instructure.com/174693
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Jenkins
Product-Review: Marc Phillips <mphillips@instructure.com>
2018-12-19 18:21:54 +00:00
wdransfield d74fc98d17 Do LtiDeepLinkingRequest message
Closes PLAT-4021

Test Plan:
- Install an LTI 1.3 tool that uses the editor_button
  placement.

  The tool's configuration should set the message
  type of each of this placements to 'LtiDeepLinkingRequest'
- Launch the tool from the RCE and verify
  * The 3rd party initiated OpenID auth flow occurs
  * The ID token contains all standard claims LTI claims
    (all claims a ResourceLinkRequest contains minus resourace_link_id
    related items)
  * Custom variables are supported and expanded
  * The deep linking settings claim is sent with all required
    values

Change-Id: I56ac0f708fb0afe7ffe515803f3fdb6f63f50d5b
Reviewed-on: https://gerrit.instructure.com/173385
Tested-by: Jenkins
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2018-11-29 20:53:01 +00:00
Cody Cutrer f400a13227 stop calling git during boot
git may not be installed

Change-Id: I69a3dfcd5dc9d743daca70bad15d994bc3ae5e0a
Reviewed-on: https://gerrit.instructure.com/173693
Reviewed-by: James Williams <jamesw@instructure.com>
Tested-by: Jenkins
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2018-11-29 18:22:30 +00:00
wdransfield 04a3e7fa3f Add deep linking request models
Closes PLAT-4015

Test Plan:
Verify new models correctly represent a deep linking request

Change-Id: I52eb0a2ccd9569b12a33eb968d130e63e90b2f58
Reviewed-on: https://gerrit.instructure.com/173047
Reviewed-by: Marc Phillips <mphillips@instructure.com>
Tested-by: Jenkins
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2018-11-26 18:26:59 +00:00
Dan McCallum 08376d351e Include AGS claim in LTI 1.3 resource link launches
- LTI 1.3 launches now include an AGS claim
  (`https://purl.imsglobal.org/spec/lti-ags/claim/endpoint`)
  if the current tool's `DeveloperKey` has been granted
  any AGS scope.
  - If the launched link is an `Assignment`, the AGS claim will
  include a `lineitem` sub-claim set to the `Assignment`'s
  LTI Advantage `LineItem` API URL
  (`/api/lti/courses/:course_id/line_items/:line_item_id`).
  - In any AGS-enabled launch from from a `Course` or `Group`,
  the AGS claim will include `lineitems` sub-claim set the
  `Course`'s LTI Advantage `LineItem` collection API URL
  (`/api/lti/courses/:course_id/line_items`.)

Closes LTIA-49

Test Plan:

  1. Create an LTI 1.3 tool with at least one AGS scope granted to
  its `DeveloperKey`. Those scopes are:

- `https://purl.imsglobal.org/spec/lti-ags/scope/lineitem`
- `https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly`
- `https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly`
- `https://purl.imsglobal.org/spec/lti-ags/scope/score`

  2. Launch the tool from a course navigation link.
  3. Verify that the
  `https://purl.imsglobal.org/spec/lti-ags/claim/endpoint` claim is
  present and:
    3.1. Sets all the granted scopes into the `scope` sub-claim
    3.2. Sets the `lineitems` sub-claim to
    `/api/lti/courses/:course_id/line_items`
    3.3. The `lineitem` sub-claim is not present.
  4. Bind the tool to an `Assignment` and launch from that
  `Assignment`.
  5. Verify that the
  `https://purl.imsglobal.org/spec/lti-ags/claim/endpoint` claim is
  present and:
    5.1. Sets all the granted scopes from step 1 into the `scope`
    sub-claim
    5.2. Sets the `lineitems` sub-claim to
    `/api/lti/courses/:course_id/line_items`
    5.3. Sets the `lineitem` sub-claim to
    `/api/lti/courses/:course_id/line_items/:line_item_id`
  To find :line_item_id for step 5.3 either use the console or database
  query. E.g. in the console:

`Assignment.find(Assignment.maximum(:id)).line_items.find(&:assignment_line_item?).id`

  6. Create another LTI 1.3 tool but do not grant any AGS scopes to its
  `DeveloperKey`.
  7. Launch the tool from a course navigation link.
  8. Verify that the
  `https://purl.imsglobal.org/spec/lti-ags/claim/endpoint` claim is
  not present.
  9. Bind the tool to an `Assignment` and launch from that
  `Assignment`.
  10. Verify that the
  `https://purl.imsglobal.org/spec/lti-ags/claim/endpoint` claim is
  not present.

Change-Id: I787d3e99c60993ed3d28ede08455617e601f3d30
Reviewed-on: https://gerrit.instructure.com/171345
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
2018-11-14 16:43:17 +00:00
wdransfield 609509fa57 Only cache id token body
Closes: PLAT-3987, PLAT-3988

Test Plan:
- Verify the following for assignment, course nav,
  and user nav placements:
  * The unsigned ID token body is sored as JSON in
    redis using the same key scheme as sessionless
    launches
  * The ID token contains all resource link
    request claims
  * Custom parameters are expanded before the body
    is cached
- Verify the message_hint is now a jwt that contains
  the domain and the "verifier"

Change-Id: I468e8af6ededdb4f6ef3da4d1014dc702f570543
Reviewed-on: https://gerrit.instructure.com/171223
Tested-by: Jenkins
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2018-11-08 17:20:56 +00:00
wdransfield dc856ca7cd Send login message for 1.3 launches
Closes PLAT-3950

Test Plan:
- Do the following for an LTI launch from an
  LTI assignment, the course navigation, and the
  user_settings placement.
  * Verify correct LTI launch is stored in Redis
  * Verify a login message is posted instead of
    an LTI launch
  * Verify the login message contains the following:
    - iss -> The iss in the Canvas security config
    - login_hint -> The session ID
    - target_link_uri -> placeholder string for now
    - lti_message_hint -> The redis key "verifier"

Change-Id: Iacd9e45b1883d062339d3ea03721f8c53cb815dd
Reviewed-on: https://gerrit.instructure.com/171036
Tested-by: Jenkins
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2018-11-07 22:44:51 +00:00
Dan McCallum 4f5b161072 Change NRPS service_version sub-claim to service_versions
- Per recent NRPS vs spec change, the `service_version` LTI 1.3
  launch sub-claim is renamed to `service_versions` and its type
  changed from a string to an array of strings. (The expressed
  version itself is still the same, i.e. it just appears as
  ["2.0"] instead of an unwrapped "2.0".)

Closes LTIA-35 WIP

Test Plan:

  - Verify LTI 1.3 launches to the IMS Reference Implementation include
  a https://purl.imsglobal.org/spec/lti-nrps/claim/namesroleservice
  claim with a `"service_versions": ["2.0"]` sub-claim

Change-Id: I53801d633166a07c571e106cc60256729059fdcf
Reviewed-on: https://gerrit.instructure.com/167714
QA-Review: Samuel Barney <sbarney@instructure.com>
Tested-by: Jenkins
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
2018-10-16 19:26:17 +00:00
Dan McCallum b056b0f81b Include NRPS v2 claim in LTI 1.3 resource link launches
- Given a Tool with the `use_1_3` setting set to `true` and an
  Account with the `lti_1_3` feature flag enabled, a resource link
  launch JWT now includes a
  `https://purl.imsglobal.org/spec/lti-nrps/claim/namesroleservice`
  claim. The `context_memberships_url` field within that claim
  advertises the NRPS v2 URL from which the Context's memberships
  can be retrieved.
  - Only works for Course and Group Contexts (though launching
  from a Group does not seem to be possible at this time).

Closes LTIA-12

Test Plan:

  * Create a Course and create and accept several Enrollments in
  it.
  * Create a LTI 1.3-enabled Tool configured to connect to the
  IMS LTI 1.3/Advantage reference implementation and ensure the
  Tool is placed into the Course.
  * Enable the LTI 1.3/Advantage feature for the Course's Account.
  * Launch the Tool.
  * Verify the presence of the
  `https://purl.imsglobal.org/spec/lti-nrps/claim/namesroleservice`
  claim in the IMS RI's user interface, which should indicate
  a successful launch.
  * Verify enablement of the "Request Names and Roles" button in the
  IMS RI user interface. Click it.
  * Correct Course membership should be returned to the RI and
  displayed in the on-screen panel.
  * NB this may require configuring the RI Tool with a OAuth2
  access token URL pointing to a Platform configured in the RI
  Tool.

Change-Id: I9d6f97166aee88b5a1e4301a82e3c4604a555462
Reviewed-on: https://gerrit.instructure.com/166205
Tested-by: Jenkins
Reviewed-by: Marc Alan Phillips <mphillips@instructure.com>
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2018-10-01 22:16:25 +00:00
wdransfield 6c699514e1 Fix lti-advantage gem specs and change activemodel version
Test Plan:
verify lti-advantage gem specs pass locally and
on Jenkins.

Change-Id: I8707914ec5dff77b275ddc92c951e8a865925ba5
Reviewed-on: https://gerrit.instructure.com/160124
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-08-08 19:37:10 +00:00
wdransfield 0f14bf4d93 Add LTI 1.3 Launch Path
Closes PLAT-3629

Test Plan:
- Install an LTI 1 tool in a course
- Modify the tool via the Rails console:
  `tool.settings['use_1_3'] = true; tool.save!`
- Add the tool to a module item
- Launch the tool and verify a JWT is sent as the 'id_token'
- Verify the JWT contains all required LTI 1.3 claims (minus
  security claims).
- Verify all claim data is accurate
- Verify the JWT contains all extensions Canvas sends
  from the same placement in LTI 1.1
- Verify custom variables are sent and expanded
- Create an External Tool assignment with the same tool
- View the assignment and verify a JWT is sent as the
  'id_token'
- Verify the JWT contains all required LTI 1.3 claims (minus
  the security claims).
- Verify the JWT contains all extension Canvas sends in LTI 1
  (ext_ LTI 1 params) as extension claims.

Note: For now the id_token is signed with a placeholder secret.

Change-Id: I7df3d150055bb30010bb509e4d40dde82a406631
Reviewed-on: https://gerrit.instructure.com/158907
Tested-by: Jenkins
Reviewed-by: Marc Alan Phillips <mphillips@instructure.com>
Product-Review: Marc Alan Phillips <mphillips@instructure.com>
QA-Review: Marc Alan Phillips <mphillips@instructure.com>
2018-08-08 16:43:58 +00:00
Nathan Mills f1c4c90bac add lti-advantage gem
refs PLAT-3500

Change-Id: I72c7166bd58053017fba0cca0c4be271de4a2b45
Reviewed-on: https://gerrit.instructure.com/157551
Tested-by: Jenkins
Reviewed-by: Marc Alan Phillips <mphillips@instructure.com>
Product-Review: Marc Alan Phillips <mphillips@instructure.com>
QA-Review: Marc Alan Phillips <mphillips@instructure.com>
2018-07-19 18:25:52 +00:00