Commit Graph

22 Commits

Author SHA1 Message Date
Cody Cutrer 06763dd519 add # frozen_string_literal: true for lib
Change-Id: I59b751cac52367a89e03f572477f0cf1d607b405
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251155
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>
2020-10-27 20:49:50 +00:00
Jacob Fugal 2b3886c5f4 extend client_credentials oauth2 grants for CD2
refs SAS-1540

* adds an audience setting to developer keys, so a key can be set to
  target external audiences with its credentials grants
* when a key with an external audience grants credentials, the token is
  signed with an asymmetric key instead of the internal symmetric key
* external audiences can retrieve the corresponding public keys from
  /login/oauth2/jwks
* credentials issued by developer keys with an account id include the
  account's guid in a custom claim

includes a refactor of key storage and rotation in consul, which had
already been done for LTI. but it wasn't really a feature of lti, just
something used by LTI, and we needed the same for key management for
this. moved it to be part of Canvas::Security

Change-Id: Ie5c0fcee6fc21687f31c109389a3bcc1ed349c5d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243606
QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2020-08-13 18:52:47 +00:00
James Williams 0b742ad0b8 add external tool placement for submisson type selection
test plan:
* enable the "Submission Type LTI Placement" feature
* add an external tool to a course or account with a
 "submission_type_selection" placement configured
* should be able to create or edit an assignment and
 select the tool directly from the submission type
 drop down
* when selected, it should show a button
 (that currently does nothing but will be used to
 launch the tool for additional configuration)
* should be able to save the assignment with
 the tool selected, and it should stay selected
 when the saved assignment is edited again

flag=submission_type_tool_placement
closes #LA-725

Change-Id: Ic0dd44f91b61f3300c55db7e7b30d9180c7a14e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237534
Reviewed-by: Clint Furse <cfurse@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Clint Furse <cfurse@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-05-20 18:12:57 +00:00
Alex Slaughter 2d11c63b32 cleanup(LTI): Cleanup Unsupported Update Function
flag = none
refs: CAL-23, QUIZ-7628

Test Plan:
  - Specs pass

Change-Id: Ifbfbbd8e8a6b7e70cdbf5f8a15b2c63c7ba3375c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237841
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
2020-05-19 23:47:57 +00:00
Michael Brewer-Davis cecc1804b0 add conference_selection LTI placement
closes CAL-6
flag=conference_selection_lti_placement

Test plan:
- Add LTI developer key at /accounts/self/developer_keys
- verify that conference_selection is not included in the
  list of placement options
- turn on feature flag "Allow Conference Selection LTI placement"
  at /accounts/site_admin/settings
- add LTI developer key again
- verify that conference_selection is included in
  the placement options and tool can be saved/reloaded

Change-Id: Ie6016514a29e9362562aab1a7a33f0c3d808ed6a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/232853
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2020-04-10 16:07:26 +00:00
wdransfield 6e0586f9eb Add LTI advantage feature flag service
Closes PLAT-4952

Test Plan:
- Install an LTI 1.3 tool that uses the new
  scope and service endpoint
- Make a request to the new endpoint specifying
  a feature flag that exists. Verify the
  feature flag is returned in the response
  with accurate data.
- Make a request to the new endpoint specifying
  a feature flag that does not exist. Verify
  the service responds with a 404
- Verify the new endpoint adheres to LTI
  Advange authentication/authorization (
  requres JWT access token, requres active
  developer key, etc.)
Change-Id: Ifb876b541c237a3c9ca45270bafea5693d6a03eb
Reviewed-on: https://gerrit.instructure.com/211196
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-10-01 21:17:49 +00:00
Xander Moffatt 8bcc4735db allow dev key saving with only public_jwk_url
closes PLAT-4858

test plan:
- create an LTI dev key with a public_jwk_url instead of a public_jwk
- the url doesn't need to be anything special but
`https://canvas.instructure.com/api/lti/security/jwks`
is always a safe bet
- edit the LTI dev key and click save
- the save should return 200 and not show any errors

Change-Id: I85a732fb6b7e9a1f32a3156621ab9899f2bf68b9
Reviewed-on: https://gerrit.instructure.com/209913
Tested-by: Jenkins
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2019-09-18 16:44:34 +00:00
wdransfield 78b898d950 Add list event type scope to tool config schema
Refs Closes PLAT-4766

Test Plan:
Make sure you can save a tool configuraiton that uses the new
list_event_types scope

Change-Id: Ib0e9ce88e03a5cce71aae2a418557f67492234d7
Reviewed-on: https://gerrit.instructure.com/208079
Tested-by: Jenkins
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Clint Furse <cfurse@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2019-09-04 21:11:47 +00:00
Marc Phillips 4fae26529c Add Data Services event subscription destroy
closes PLAT-4819

Test Plan:
 n/a

Change-Id: Ib5661b85af4e68048d44742f9ec8d273c79008b2
Reviewed-on: https://gerrit.instructure.com/206519
Tested-by: Jenkins
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
2019-08-27 17:54:21 +00:00
Xander Moffatt 352d132257 add data services index action
closes PLAT-4744

Test Plan:
 - see that the index action returns a list

Change-Id: I92cc07c5476c7dd48202f38b62e09df6aa591b62
Reviewed-on: https://gerrit.instructure.com/206435
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Jenkins
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
2019-08-27 17:54:04 +00:00
Marc Phillips a01a549b4c Add update to LTI Data Services
closes PLAT-4763

Test Plan:
 it updates the subscription

Change-Id: I80289d2bea6c88b70726718cec7b9087e4879aa9
Reviewed-on: https://gerrit.instructure.com/206505
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Jenkins
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
2019-08-26 22:21:46 +00:00
Marc Phillips 1f2394e982 Add subscription show to LTI DataServices
closes PLAT-4761

Test Plan:
 - see that a call to this endpoint will show a sub

Change-Id: Ifc299aebe5cfbadaf82a1970f75ad182ffa31b29
Reviewed-on: https://gerrit.instructure.com/206489
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Jenkins
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
2019-08-26 22:21:25 +00:00
Marc Phillips c7cd834b27 Add DataServices LTI integration
refs PLAT-4757

Test Plan:
 - tests pass

Change-Id: I695ce7c88e47a38115e397d4e29eccd9171e7bf2
Reviewed-on: https://gerrit.instructure.com/206063
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-08-22 15:02:49 +00:00
Drake Harper e0d184126a Add manual edit for public jwk url
refs PLAT-4493

Test Plan:
-create a developer key and validate the public jwk url field
	is present
-save developer key
-edit developer key and validate public jwk url field is present
-save edit and validate edits were saved to developer key

Change-Id: I9019d116ad9995931757439f4c3d63b3d67a3a5f
Reviewed-on: https://gerrit.instructure.com/197713
Tested-by: Jenkins
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2019-06-25 18:29:59 +00:00
Drake Harper 540db8d275 Create Developer Key update endpoint for public_jwk update
fixes PLAT-4492

Test Plan
-Create test tool
-Use tool to create developer key in canvas
-Change tool credential oauth_client_id to match
	client id from developer key
-Go to http://lti13testtool.docker/developer_key/update_public_jwk/21
-Verify that public JWK was changed:

Change-Id: Ic09a665d4ab14d3423b7e4b2a3a51296c0617981
Reviewed-on: https://gerrit.instructure.com/194447
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2019-06-07 21:43:56 +00:00
Marc Phillips b84183be87 Add validations to Manual LTI Key create
Also fixed a few formatting issues and loosened the
requirements on domain and tool_id.

closes PLAT-4248

Test Plan:
Go through the lti manual creation flow, should work
Attempt to break it, shouldn't work

Change-Id: I8ceb05951d2596fd37e976dd114cc3da3a3d7499
Reviewed-on: https://gerrit.instructure.com/190194
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2019-04-23 19:20:30 +00:00
Marc Phillips 47cb8c3b03 Remove custom_fields from ToolConfig Model
This belongs in the settings hash.

refs PLAT-4248

Test Plan:
 n/a

Change-Id: I89ca516d9e00e8fe8048e8d419893b16efc0b76d
Reviewed-on: https://gerrit.instructure.com/187200
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
2019-03-28 19:08:48 +00:00
Marc Phillips 306c528724 Add required root level fields for LTI Key
For manual creation of keys, add the fields
that will be required or needed to create a
new Tool Configuration Manually.

refs PLAT-4248

Test Plan:
 - Go to create a new LTI key, note that the manual
   option now has fields attached

Change-Id: I34afe82ba903cc149a0ba74b245cec0375b029e4
Reviewed-on: https://gerrit.instructure.com/186829
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Jenkins
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
2019-03-26 17:26:24 +00:00
Marc Phillips 14ae14dfaa Update ToolConfiguration Schema
Some fields should not be required, fix typo
in Deeplinkingrequest.

fixes PLAT-4284

Test Plan:
 - n/a

Change-Id: I36c3c84a143d8aaff7ddb9de7c33847640a6845a
Reviewed-on: https://gerrit.instructure.com/184627
Tested-by: Jenkins
Product-Review: Marc Phillips <mphillips@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2019-03-12 19:45:14 +00:00
Marc Phillips b5eaa314ca Add tool configuration schema validation (backend)
Validate that a tool config matches the schema for
a tool.

closes PLAT-4258

Test Plan:

 - Attempt to create an lti tool with an old config, should
   fail with schema errors
 - Create an lti tool with a new tool config, should succeed
 - Create a tool from the config, should work
 - Test that the launches still work for launch basic and
   Deeplinking

Change-Id: Iaeea45f14dd10f464ab06f4bd1bb24696e91b38f
Reviewed-on: https://gerrit.instructure.com/184182
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-12 18:43:47 +00:00
wdransfield 9927f75643 Fix schema namespacing error
Change-Id: Ifcc3316b96f4b2ae3da109c9e7e80afdd57cdada
Reviewed-on: https://gerrit.instructure.com/166599
Reviewed-by: Marc Alan Phillips <mphillips@instructure.com>
Tested-by: Jenkins
Product-Review: Marc Alan Phillips <mphillips@instructure.com>
QA-Review: Marc Alan Phillips <mphillips@instructure.com>
2018-10-02 17:01:32 +00:00
wdransfield c25d2dfbc0 Import and validate public JWK
Closes PLAT-3739

Test Plan:
- Use the tool configuration create/update endpoint to create a new
  tool configuration. The JSON provided to the settings should
  include (in its root) a 'public_jwk' object. This object must
  take the following form:
    {
        "kty":"RSA",
	"e":"AQAB",
	"n":"2YGluUtCi62Ww_TWB38OE6wTaN..."
	"kid":"2018-09-18T21:55:18Z",
	"alg":"RS256",
	"use":"sig"
   }
- Verify a tool configuration is created
- Verify the tool configuration's developer key's public_jwk
  column is now set to the JWK from the previous step
- Verify all claims in the JWK above are required
- Verify the 'kty' claim must be 'RSA' when using the
  endpoint
- Verify the 'alg' claim must be 'RS256' when using the
  endpoint
- Verify all above verifications work when the settings JSON
  is provided directly OR provided indirectly by URL
- Verify all above verifications work when creating a new tool
  configuration OR editing an existing one

Change-Id: Iae8e9b89266611234b8ab2e47c4912b7fb1d9f2a
Reviewed-on: https://gerrit.instructure.com/165203
Reviewed-by: Marc Alan Phillips <mphillips@instructure.com>
QA-Review: Marc Alan Phillips <mphillips@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2018-10-02 13:06:45 +00:00