mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-09 13:07:37 +08:00
Move module to LivebookWeb.ZTA.SessionIdentity
This commit is contained in:
parent
25829b420f
commit
c93511296a
3 changed files with 4 additions and 4 deletions
|
@ -695,7 +695,7 @@ defmodule Livebook.Config do
|
||||||
def identity_provider!(env) do
|
def identity_provider!(env) do
|
||||||
case System.get_env(env) do
|
case System.get_env(env) do
|
||||||
nil ->
|
nil ->
|
||||||
{:session, LivebookWeb.SessionIdentity, :unused}
|
{:session, LivebookWeb.ZTA.SessionIdentity, :unused}
|
||||||
|
|
||||||
"custom:" <> module_key ->
|
"custom:" <> module_key ->
|
||||||
destructure [module, key], String.split(module_key, ":", parts: 2)
|
destructure [module, key], String.split(module_key, ":", parts: 2)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
defmodule LivebookWeb.SessionIdentity do
|
defmodule LivebookWeb.ZTA.SessionIdentity do
|
||||||
# This module implements the ZTA contract specific to Livebook cookies
|
# This module implements the ZTA contract specific to Livebook cookies
|
||||||
|
|
||||||
import Plug.Conn
|
import Plug.Conn
|
|
@ -39,9 +39,9 @@ defmodule Livebook.ConfigTest do
|
||||||
assert Config.identity_provider!("TEST_IDENTITY_PROVIDER") == {:custom, Module, nil}
|
assert Config.identity_provider!("TEST_IDENTITY_PROVIDER") == {:custom, Module, nil}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
with_env([TEST_IDENTITY_PROVIDER: "custom:LivebookWeb.SessionIdentity:extra"], fn ->
|
with_env([TEST_IDENTITY_PROVIDER: "custom:LivebookWeb.ZTA.SessionIdentity:extra"], fn ->
|
||||||
assert Config.identity_provider!("TEST_IDENTITY_PROVIDER") ==
|
assert Config.identity_provider!("TEST_IDENTITY_PROVIDER") ==
|
||||||
{:custom, LivebookWeb.SessionIdentity, "extra"}
|
{:custom, LivebookWeb.ZTA.SessionIdentity, "extra"}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
with_env([TEST_IDENTITY_PROVIDER: "cloudflare:123"], fn ->
|
with_env([TEST_IDENTITY_PROVIDER: "cloudflare:123"], fn ->
|
||||||
|
|
Loading…
Add table
Reference in a new issue