projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
List available frontends also when no static/frontends folder is present yet
[akkoma]
/
test
/
pleroma
/
web
/
plugs
/
admin_secret_authentication_plug_test.exs
diff --git
a/test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs
b/test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs
index 33394722a5e39da6d63581834067391042ab2ab8..79561afb7045a507a82441923216facae6bd2901 100644
(file)
--- a/
test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs
+++ b/
test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.AdminSecretAuthenticationPlugTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.AdminSecretAuthenticationPlugTest do
@@
-35,7
+35,7
@@
defmodule Pleroma.Web.Plugs.AdminSecretAuthenticationPlugTest do
end
test "with `admin_token` query parameter", %{conn: conn} do
end
test "with `admin_token` query parameter", %{conn: conn} do
-
Pleroma.Config.put
(:admin_token, "password123")
+
clear_config
(:admin_token, "password123")
conn =
%{conn | params: %{"admin_token" => "wrong_password"}}
conn =
%{conn | params: %{"admin_token" => "wrong_password"}}
@@
-49,11
+49,12
@@
defmodule Pleroma.Web.Plugs.AdminSecretAuthenticationPlugTest do
|> AdminSecretAuthenticationPlug.call(%{})
assert conn.assigns[:user].is_admin
|> AdminSecretAuthenticationPlug.call(%{})
assert conn.assigns[:user].is_admin
+ assert conn.assigns[:token] == nil
assert PlugHelper.plug_skipped?(conn, OAuthScopesPlug)
end
test "with `x-admin-token` HTTP header", %{conn: conn} do
assert PlugHelper.plug_skipped?(conn, OAuthScopesPlug)
end
test "with `x-admin-token` HTTP header", %{conn: conn} do
-
Pleroma.Config.put
(:admin_token, "☕️")
+
clear_config
(:admin_token, "☕️")
conn =
conn
conn =
conn
@@
-69,6
+70,7
@@
defmodule Pleroma.Web.Plugs.AdminSecretAuthenticationPlugTest do
|> AdminSecretAuthenticationPlug.call(%{})
assert conn.assigns[:user].is_admin
|> AdminSecretAuthenticationPlug.call(%{})
assert conn.assigns[:user].is_admin
+ assert conn.assigns[:token] == nil
assert PlugHelper.plug_skipped?(conn, OAuthScopesPlug)
end
end
assert PlugHelper.plug_skipped?(conn, OAuthScopesPlug)
end
end