mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-11 22:16:10 +08:00
Bug fix ZTA (#2533)
This commit is contained in:
parent
26d39772e8
commit
0ff1b8d19c
2 changed files with 6 additions and 1 deletions
|
@ -705,7 +705,7 @@ defmodule Livebook.Config do
|
||||||
provider ->
|
provider ->
|
||||||
with [type, key] <- String.split(provider, ":", parts: 2),
|
with [type, key] <- String.split(provider, ":", parts: 2),
|
||||||
%{^type => module} <- identity_provider_type_to_module() do
|
%{^type => module} <- identity_provider_type_to_module() do
|
||||||
{module, key}
|
{:zta, module, key}
|
||||||
else
|
else
|
||||||
_ -> abort!("invalid configuration for identity provider given in #{env}")
|
_ -> abort!("invalid configuration for identity provider given in #{env}")
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,6 +43,11 @@ defmodule Livebook.ConfigTest do
|
||||||
assert Config.identity_provider!("TEST_IDENTITY_PROVIDER") ==
|
assert Config.identity_provider!("TEST_IDENTITY_PROVIDER") ==
|
||||||
{:custom, LivebookWeb.SessionIdentity, "extra"}
|
{:custom, LivebookWeb.SessionIdentity, "extra"}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
with_env([TEST_IDENTITY_PROVIDER: "cloudflare:123"], fn ->
|
||||||
|
assert Config.identity_provider!("TEST_IDENTITY_PROVIDER")
|
||||||
|
{:zta, Livebook.ZTA.Cloudflare, "123"}
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue