Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/oli/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ defmodule Oli.Application do
# Starts Cachex to store section info
Oli.Delivery.Sections.SectionCache,

# Starts the LTI 1.3 examples key provider
Lti_1p3.Examples.KeyProviderConfig.child_spec(),

# a supervisor which can be used to dynamically supervise tasks
{Task.Supervisor, name: Oli.TaskSupervisor}
] ++ maybe_node_js_config()
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ defmodule Oli.MixProject do
{:jason, "~> 1.3"},
{:joken, "~> 2.2.0"},
{:jose, "~> 1.10"},
{:lti_1p3, "~> 0.9"},
{:lti_1p3_ecto_provider, "~> 0.9"},
{:lti_1p3, "~> 0.10"},
{:lti_1p3_ecto_provider, "~> 0.10"},
{:libcluster, "~> 3.3"},
{:libcluster_ec2, "~> 0.6"},
{:mime, "~> 1.2"},
Expand Down
6 changes: 3 additions & 3 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"gen_smtp": {:hex, :gen_smtp, "1.2.0", "9cfc75c72a8821588b9b9fe947ae5ab2aed95a052b81237e0928633a13276fd3", [:rebar3], [{:ranch, ">= 1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "5ee0375680bca8f20c4d85f58c2894441443a743355430ff33a783fe03296779"},
"gen_stage": {:hex, :gen_stage, "1.2.1", "19d8b5e9a5996d813b8245338a28246307fd8b9c99d1237de199d21efc4c76a1", [:mix], [], "hexpm", "83e8be657fa05b992ffa6ac1e3af6d57aa50aace8f691fcf696ff02f8335b001"},
"gettext": {:hex, :gettext, "0.26.2", "5978aa7b21fada6deabf1f6341ddba50bc69c999e812211903b169799208f2a8", [:mix], [{:expo, "~> 0.5.1 or ~> 1.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "aa978504bcf76511efdc22d580ba08e2279caab1066b76bb9aa81c4a1e0a32a5"},
"hackney": {:hex, :hackney, "1.24.1", "f5205a125bba6ed4587f9db3cc7c729d11316fa8f215d3e57ed1c067a9703fa9", [:rebar3], [{:certifi, "~> 2.15.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.4", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "f4a7392a0b53d8bbc3eb855bdcc919cd677358e65b2afd3840b5b3690c4c8a39"},
"hackney": {:hex, :hackney, "1.25.0", "390e9b83f31e5b325b9f43b76e1a785cbdb69b5b6cd4e079aa67835ded046867", [:rebar3], [{:certifi, "~> 2.15.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.4", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "7209bfd75fd1f42467211ff8f59ea74d6f2a9e81cbcee95a56711ee79fd6b1d4"},
"hpax": {:hex, :hpax, "1.0.3", "ed67ef51ad4df91e75cc6a1494f851850c0bd98ebc0be6e81b026e765ee535aa", [:mix], [], "hexpm", "8eab6e1cfa8d5918c2ce4ba43588e894af35dbd8e91e6e55c817bca5847df34a"},
"html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"},
"html_sanitize_ex": {:hex, :html_sanitize_ex, "1.4.3", "67b3d9fa8691b727317e0cc96b9b3093be00ee45419ffb221cdeee88e75d1360", [:mix], [{:mochiweb, "~> 2.15 or ~> 3.1", [hex: :mochiweb, repo: "hexpm", optional: false]}], "hexpm", "87748d3c4afe949c7c6eb7150c958c2bcba43fc5b2a02686af30e636b74bccb7"},
Expand All @@ -72,8 +72,8 @@
"jumper": {:hex, :jumper, "1.0.2", "68cdcd84472a00ac596b4e6459a41b3062d4427cbd4f1e8c8793c5b54f1406a7", [:mix], [], "hexpm", "9b7782409021e01ab3c08270e26f36eb62976a38c1aa64b2eaf6348422f165e1"},
"libcluster": {:hex, :libcluster, "3.3.3", "a4f17721a19004cfc4467268e17cff8b1f951befe428975dd4f6f7b84d927fe0", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "7c0a2275a0bb83c07acd17dab3c3bfb4897b145106750eeccc62d302e3bdfee5"},
"libcluster_ec2": {:hex, :libcluster_ec2, "0.8.2", "8faddf2c139bce6c826b948c2e1a09ede756cf3dac0b06695690e0edcdbfc62d", [:mix], [{:ex_aws, ">= 2.3.2", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:ex_aws_ec2, "~> 2.0", [hex: :ex_aws_ec2, repo: "hexpm", optional: false]}, {:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: false]}, {:libcluster, "~> 2.0 or ~> 3.0", [hex: :libcluster, repo: "hexpm", optional: false]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: false]}], "hexpm", "0a773f46bfa17df28280cda9250916cbcd6b625bf672e61ccafe02550497cd66"},
"lti_1p3": {:hex, :lti_1p3, "0.9.0", "c90d926cef7f9b223f39d5aec6c0470031915bc0b947154a24a25ae8372a2a04", [:mix], [{:httpoison, "~> 2.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:joken, "~> 2.2.0", [hex: :joken, repo: "hexpm", optional: false]}, {:timex, "~> 3.5", [hex: :timex, repo: "hexpm", optional: false]}, {:uuid, "~> 1.1", [hex: :uuid, repo: "hexpm", optional: false]}], "hexpm", "27a884e2f4b4d13b3e51a35e82328fbcf9ed805906f2914d8f4d003d2bfd4266"},
"lti_1p3_ecto_provider": {:hex, :lti_1p3_ecto_provider, "0.9.1", "54f951d9db334b962144eacc7bc67b2a73d00aba4108bf21dd018e023a61ac6d", [:mix], [{:ecto_sql, "~> 3.10", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:httpoison, "~> 2.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:lti_1p3, "~> 0.9", [hex: :lti_1p3, repo: "hexpm", optional: false]}, {:postgrex, ">= 0.0.0", [hex: :postgrex, repo: "hexpm", optional: false]}, {:timex, "~> 3.5", [hex: :timex, repo: "hexpm", optional: false]}, {:uuid, "~> 1.1", [hex: :uuid, repo: "hexpm", optional: false]}], "hexpm", "3589e3d071b730f07d5c1fe5f3b44b5e262b6126bf21e4e1abe117612813cff5"},
"lti_1p3": {:hex, :lti_1p3, "0.10.0", "bef577ff448816adaca67f79131c5034811167cc4c998bef871749e09535a1cc", [:mix], [{:httpoison, "~> 2.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:joken, "~> 2.2.0", [hex: :joken, repo: "hexpm", optional: false]}, {:timex, "~> 3.5", [hex: :timex, repo: "hexpm", optional: false]}, {:uuid, "~> 1.1", [hex: :uuid, repo: "hexpm", optional: false]}], "hexpm", "41e240d734376c244063c406bf80cb896d1cd3656bed8fabbee5934886ad1af0"},
"lti_1p3_ecto_provider": {:hex, :lti_1p3_ecto_provider, "0.10.0", "8ca0cb6e79950b37846b90145d133ddbf30f31f0039b79b6ee76f5190a51fe0e", [:mix], [{:ecto_sql, "~> 3.10", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:httpoison, "~> 2.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:lti_1p3, "~> 0.10", [hex: :lti_1p3, repo: "hexpm", optional: false]}, {:postgrex, ">= 0.0.0", [hex: :postgrex, repo: "hexpm", optional: false]}, {:timex, "~> 3.5", [hex: :timex, repo: "hexpm", optional: false]}, {:uuid, "~> 1.1", [hex: :uuid, repo: "hexpm", optional: false]}], "hexpm", "a02aefb538e7b5318646c030a9aa77dd8e8597505cc12c032a3c2bd5c3e24b0b"},
"mail": {:hex, :mail, "0.2.3", "2c6bb5f8a5f74845fa50ecd0fb45ea16b164026f285f45104f1c4c078cd616d4", [:mix], [], "hexpm", "932b398fa9c69fdf290d7ff63175826e0f1e24414d5b0763bb00a2acfc6c6bf5"},
"makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"},
"makeup_eex": {:hex, :makeup_eex, "0.1.2", "93a5ef3d28ed753215dba2d59cb40408b37cccb4a8205e53ef9b5319a992b700", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.16 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_html, "~> 0.1.0 or ~> 1.0", [hex: :makeup_html, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "6140eafb28215ad7182282fd21d9aa6dcffbfbe0eb876283bc6b768a6c57b0c3"},
Expand Down
35 changes: 8 additions & 27 deletions test/oli_web/controllers/lti_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ defmodule OliWeb.LtiControllerTest do
import Mox
import Oli.Factory

setup :verify_on_exit!
setup :set_mox_global

describe "lti_controller" do
setup [:create_fixtures]

Expand Down Expand Up @@ -149,7 +152,7 @@ defmodule OliWeb.LtiControllerTest do
platform_jwk = jwk_fixture()

Oli.Test.MockHTTP
|> expect(:get, 2, mock_keyset_endpoint("some key_set_url", platform_jwk))
|> expect(:get, 1, mock_keyset_endpoint("some key_set_url", platform_jwk))

state = "some-state"
conn = Plug.Test.init_test_session(conn, state: state)
Expand Down Expand Up @@ -193,7 +196,7 @@ defmodule OliWeb.LtiControllerTest do
platform_jwk = jwk_fixture()

Oli.Test.MockHTTP
|> expect(:get, 2, mock_keyset_endpoint("some key_set_url", platform_jwk))
|> expect(:get, 1, mock_keyset_endpoint("some key_set_url", platform_jwk))

state = "some-state"
conn = Plug.Test.init_test_session(conn, state: state)
Expand Down Expand Up @@ -225,7 +228,7 @@ defmodule OliWeb.LtiControllerTest do
platform_jwk = jwk_fixture()

Oli.Test.MockHTTP
|> expect(:get, 2, mock_keyset_endpoint("some key_set_url", platform_jwk))
|> expect(:get, 1, mock_keyset_endpoint("some key_set_url", platform_jwk))

state = "some-state"
conn = Plug.Test.init_test_session(conn, state: state)
Expand Down Expand Up @@ -287,7 +290,7 @@ defmodule OliWeb.LtiControllerTest do
platform_jwk = jwk_fixture()

Oli.Test.MockHTTP
|> expect(:get, 2, mock_keyset_endpoint("some key_set_url", platform_jwk))
|> expect(:get, 1, mock_keyset_endpoint("some key_set_url", platform_jwk))

state = "some-state"
conn = Plug.Test.init_test_session(conn, state: state)
Expand Down Expand Up @@ -319,7 +322,7 @@ defmodule OliWeb.LtiControllerTest do
platform_jwk = jwk_fixture()

Oli.Test.MockHTTP
|> expect(:get, 2, mock_keyset_endpoint("some key_set_url", platform_jwk))
|> expect(:get, 1, mock_keyset_endpoint("some key_set_url", platform_jwk))

state = "some-state"
conn = Plug.Test.init_test_session(conn, state: state)
Expand Down Expand Up @@ -347,28 +350,6 @@ defmodule OliWeb.LtiControllerTest do
test "launch handles invalid registration and shows registration form", %{conn: conn} do
platform_jwk = jwk_fixture()

Oli.Test.MockHTTP
|> expect(:get, 2, fn "some key_set_url" ->
{:ok,
%HTTPoison.Response{
status_code: 200,
body:
Jason.encode!(%{
keys: [
platform_jwk.pem
|> JOSE.JWK.from_pem()
|> JOSE.JWK.to_public()
|> JOSE.JWK.to_map()
|> (fn {_kty, public_jwk} -> public_jwk end).()
|> Map.put("typ", platform_jwk.typ)
|> Map.put("alg", platform_jwk.alg)
|> Map.put("kid", platform_jwk.kid)
|> Map.put("use", "sig")
]
})
}}
end)

state = "some-state"
conn = Plug.Test.init_test_session(conn, state: state)

Expand Down