projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Expand and authorize streams in Streamer directly (backport from !2519)
[akkoma]
/
test
/
plugs
/
http_signature_plug_test.exs
diff --git
a/test/plugs/http_signature_plug_test.exs
b/test/plugs/http_signature_plug_test.exs
index 007193dd96c961abbcebb6dc4fb170154407198b..e6cbde8031d23a1546cdd0e8d3ae657d82b00eaa 100644
(file)
--- a/
test/plugs/http_signature_plug_test.exs
+++ b/
test/plugs/http_signature_plug_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.HTTPSignaturePlugTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.HTTPSignaturePlugTest do
@@
-7,6
+7,7
@@
defmodule Pleroma.Web.Plugs.HTTPSignaturePlugTest do
alias Pleroma.Web.Plugs.HTTPSignaturePlug
import Plug.Conn
alias Pleroma.Web.Plugs.HTTPSignaturePlug
import Plug.Conn
+ import Phoenix.Controller, only: [put_format: 2]
import Mock
test "it call HTTPSignatures to check validity if the actor sighed it" do
import Mock
test "it call HTTPSignatures to check validity if the actor sighed it" do
@@
-20,6
+21,7
@@
defmodule Pleroma.Web.Plugs.HTTPSignaturePlugTest do
"signature",
"keyId=\"http://mastodon.example.org/users/admin#main-key"
)
"signature",
"keyId=\"http://mastodon.example.org/users/admin#main-key"
)
+ |> put_format("activity+json")
|> HTTPSignaturePlug.call(%{})
assert conn.assigns.valid_signature == true
|> HTTPSignaturePlug.call(%{})
assert conn.assigns.valid_signature == true
@@
-28,7
+30,7
@@
defmodule Pleroma.Web.Plugs.HTTPSignaturePlugTest do
end
end
end
end
- describe "requ
ri
es a signature when `authorized_fetch_mode` is enabled" do
+ describe "requ
ir
es a signature when `authorized_fetch_mode` is enabled" do
setup do
Pleroma.Config.put([:activitypub, :authorized_fetch_mode], true)
setup do
Pleroma.Config.put([:activitypub, :authorized_fetch_mode], true)
@@
-37,7
+39,7
@@
defmodule Pleroma.Web.Plugs.HTTPSignaturePlugTest do
end)
params = %{"actor" => "http://mastodon.example.org/users/admin"}
end)
params = %{"actor" => "http://mastodon.example.org/users/admin"}
- conn = build_conn(:get, "/doesntmattter", params)
+ conn = build_conn(:get, "/doesntmattter", params)
|> put_format("activity+json")
[conn: conn]
end
[conn: conn]
end