Fix object spoofing vulnerability in attachments
Validate the content-type of the response when fetching an object, according to https://www.w3.org/TR/activitypub/#x3-2-retrieving-objects. content-type headers had to be added to many mocks in order to support this, some of this was done with a regex. While I did go over the resulting files to check I didn't modify anything unrelated, there is a possibility I missed something. Closes pleroma#1948
This commit is contained in:
parent
99bc175f02
commit
6ca709816f
@ -232,8 +232,24 @@ defmodule Pleroma.Object.Fetcher do
|
|||||||
|> sign_fetch(id, date)
|
|> sign_fetch(id, date)
|
||||||
|
|
||||||
case HTTP.get(id, headers) do
|
case HTTP.get(id, headers) do
|
||||||
{:ok, %{body: body, status: code}} when code in 200..299 ->
|
{:ok, %{body: body, status: code, headers: headers}} when code in 200..299 ->
|
||||||
{:ok, body}
|
case List.keyfind(headers, "content-type", 0) do
|
||||||
|
{_, content_type} ->
|
||||||
|
case Plug.Conn.Utils.media_type(content_type) do
|
||||||
|
{:ok, "application", "activity+json", _} ->
|
||||||
|
{:ok, body}
|
||||||
|
|
||||||
|
{:ok, "application", "ld+json",
|
||||||
|
%{"profile" => "https://www.w3.org/ns/activitystreams"}} ->
|
||||||
|
{:ok, body}
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
{:error, {:content_type, content_type}}
|
||||||
|
end
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
{:error, {:content_type, nil}}
|
||||||
|
end
|
||||||
|
|
||||||
{:ok, %{status: code}} when code in [404, 410] ->
|
{:ok, %{status: code}} when code in [404, 410] ->
|
||||||
{:error, "Object has been deleted"}
|
{:error, "Object has been deleted"}
|
||||||
|
26
test/fixtures/spoofed-object.json
vendored
Normal file
26
test/fixtures/spoofed-object.json
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"@context": [
|
||||||
|
"https://www.w3.org/ns/activitystreams",
|
||||||
|
"https://patch.cx/schemas/litepub-0.1.jsonld",
|
||||||
|
{
|
||||||
|
"@language": "und"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"actor": "https://patch.cx/users/rin",
|
||||||
|
"attachment": [],
|
||||||
|
"attributedTo": "https://patch.cx/users/rin",
|
||||||
|
"cc": [
|
||||||
|
"https://patch.cx/users/rin/followers"
|
||||||
|
],
|
||||||
|
"content": "Oracle Corporation (NYSE: ORCL) today announced that it has signed a definitive merger agreement to acquire Pleroma AG (FRA: PLA), for $26.50 per share (approximately $10.3 billion). The transaction has been approved by the boards of directors of both companies and should close by early January.",
|
||||||
|
"context": "https://patch.cx/contexts/spoof",
|
||||||
|
"id": "https://patch.cx/objects/spoof",
|
||||||
|
"published": "2020-10-23T18:02:06.038856Z",
|
||||||
|
"sensitive": false,
|
||||||
|
"summary": "Oracle buys Pleroma",
|
||||||
|
"tag": [],
|
||||||
|
"to": [
|
||||||
|
"https://www.w3.org/ns/activitystreams#Public"
|
||||||
|
],
|
||||||
|
"type": "Note"
|
||||||
|
}
|
@ -21,6 +21,17 @@ defmodule Pleroma.Object.FetcherTest do
|
|||||||
%{method: :get, url: "https://mastodon.example.org/users/userisgone404"} ->
|
%{method: :get, url: "https://mastodon.example.org/users/userisgone404"} ->
|
||||||
%Tesla.Env{status: 404}
|
%Tesla.Env{status: 404}
|
||||||
|
|
||||||
|
%{
|
||||||
|
method: :get,
|
||||||
|
url:
|
||||||
|
"https://patch.cx/media/03ca3c8b4ac3ddd08bf0f84be7885f2f88de0f709112131a22d83650819e36c2.json"
|
||||||
|
} ->
|
||||||
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
headers: [{"content-type", "application/json"}],
|
||||||
|
body: File.read!("test/fixtures/spoofed-object.json")
|
||||||
|
}
|
||||||
|
|
||||||
env ->
|
env ->
|
||||||
apply(HttpRequestMock, :request, [env])
|
apply(HttpRequestMock, :request, [env])
|
||||||
end)
|
end)
|
||||||
@ -34,19 +45,22 @@ defmodule Pleroma.Object.FetcherTest do
|
|||||||
%{method: :get, url: "https://social.sakamoto.gq/notice/9wTkLEnuq47B25EehM"} ->
|
%{method: :get, url: "https://social.sakamoto.gq/notice/9wTkLEnuq47B25EehM"} ->
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/fetch_mocks/9wTkLEnuq47B25EehM.json")
|
body: File.read!("test/fixtures/fetch_mocks/9wTkLEnuq47B25EehM.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
}
|
}
|
||||||
|
|
||||||
%{method: :get, url: "https://social.sakamoto.gq/users/eal"} ->
|
%{method: :get, url: "https://social.sakamoto.gq/users/eal"} ->
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/fetch_mocks/eal.json")
|
body: File.read!("test/fixtures/fetch_mocks/eal.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
}
|
}
|
||||||
|
|
||||||
%{method: :get, url: "https://busshi.moe/users/tuxcrafting/statuses/104410921027210069"} ->
|
%{method: :get, url: "https://busshi.moe/users/tuxcrafting/statuses/104410921027210069"} ->
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/fetch_mocks/104410921027210069.json")
|
body: File.read!("test/fixtures/fetch_mocks/104410921027210069.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
}
|
}
|
||||||
|
|
||||||
%{method: :get, url: "https://busshi.moe/users/tuxcrafting"} ->
|
%{method: :get, url: "https://busshi.moe/users/tuxcrafting"} ->
|
||||||
@ -132,6 +146,13 @@ defmodule Pleroma.Object.FetcherTest do
|
|||||||
"http://mastodon.example.org/@admin/99541947525187367"
|
"http://mastodon.example.org/@admin/99541947525187367"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "it does not fetch a spoofed object uploaded on an instance as an attachment" do
|
||||||
|
assert {:error, _} =
|
||||||
|
Fetcher.fetch_object_from_id(
|
||||||
|
"https://patch.cx/media/03ca3c8b4ac3ddd08bf0f84be7885f2f88de0f709112131a22d83650819e36c2.json"
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "implementation quirks" do
|
describe "implementation quirks" do
|
||||||
|
@ -281,7 +281,11 @@ defmodule Pleroma.ObjectTest do
|
|||||||
setup do
|
setup do
|
||||||
mock(fn
|
mock(fn
|
||||||
%{method: :get, url: "https://patch.cx/objects/9a172665-2bc5-452d-8428-2361d4c33b1d"} ->
|
%{method: :get, url: "https://patch.cx/objects/9a172665-2bc5-452d-8428-2361d4c33b1d"} ->
|
||||||
%Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/poll_original.json")}
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/tesla_mock/poll_original.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
|
}
|
||||||
|
|
||||||
env ->
|
env ->
|
||||||
apply(HttpRequestMock, :request, [env])
|
apply(HttpRequestMock, :request, [env])
|
||||||
@ -315,7 +319,8 @@ defmodule Pleroma.ObjectTest do
|
|||||||
|
|
||||||
mock_modified.(%Tesla.Env{
|
mock_modified.(%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/poll_modified.json")
|
body: File.read!("test/fixtures/tesla_mock/poll_modified.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
})
|
})
|
||||||
|
|
||||||
updated_object = Object.get_by_id_and_maybe_refetch(object.id, interval: -1)
|
updated_object = Object.get_by_id_and_maybe_refetch(object.id, interval: -1)
|
||||||
@ -359,7 +364,8 @@ defmodule Pleroma.ObjectTest do
|
|||||||
|
|
||||||
mock_modified.(%Tesla.Env{
|
mock_modified.(%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/poll_modified.json")
|
body: File.read!("test/fixtures/tesla_mock/poll_modified.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
})
|
})
|
||||||
|
|
||||||
updated_object = Object.get_by_id_and_maybe_refetch(object.id, interval: 100)
|
updated_object = Object.get_by_id_and_maybe_refetch(object.id, interval: 100)
|
||||||
@ -387,7 +393,8 @@ defmodule Pleroma.ObjectTest do
|
|||||||
|
|
||||||
mock_modified.(%Tesla.Env{
|
mock_modified.(%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/poll_modified.json")
|
body: File.read!("test/fixtures/tesla_mock/poll_modified.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
})
|
})
|
||||||
|
|
||||||
updated_object = Object.get_by_id_and_maybe_refetch(object.id, interval: -1)
|
updated_object = Object.get_by_id_and_maybe_refetch(object.id, interval: -1)
|
||||||
|
@ -1426,19 +1426,25 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||||||
mock(fn env ->
|
mock(fn env ->
|
||||||
case env.url do
|
case env.url do
|
||||||
"http://localhost:4001/users/masto_hidden_counters/following" ->
|
"http://localhost:4001/users/masto_hidden_counters/following" ->
|
||||||
json(%{
|
json(
|
||||||
"@context" => "https://www.w3.org/ns/activitystreams",
|
%{
|
||||||
"id" => "http://localhost:4001/users/masto_hidden_counters/followers"
|
"@context" => "https://www.w3.org/ns/activitystreams",
|
||||||
})
|
"id" => "http://localhost:4001/users/masto_hidden_counters/followers"
|
||||||
|
},
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
|
)
|
||||||
|
|
||||||
"http://localhost:4001/users/masto_hidden_counters/following?page=1" ->
|
"http://localhost:4001/users/masto_hidden_counters/following?page=1" ->
|
||||||
%Tesla.Env{status: 403, body: ""}
|
%Tesla.Env{status: 403, body: ""}
|
||||||
|
|
||||||
"http://localhost:4001/users/masto_hidden_counters/followers" ->
|
"http://localhost:4001/users/masto_hidden_counters/followers" ->
|
||||||
json(%{
|
json(
|
||||||
"@context" => "https://www.w3.org/ns/activitystreams",
|
%{
|
||||||
"id" => "http://localhost:4001/users/masto_hidden_counters/following"
|
"@context" => "https://www.w3.org/ns/activitystreams",
|
||||||
})
|
"id" => "http://localhost:4001/users/masto_hidden_counters/following"
|
||||||
|
},
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
|
)
|
||||||
|
|
||||||
"http://localhost:4001/users/masto_hidden_counters/followers?page=1" ->
|
"http://localhost:4001/users/masto_hidden_counters/followers?page=1" ->
|
||||||
%Tesla.Env{status: 403, body: ""}
|
%Tesla.Env{status: 403, body: ""}
|
||||||
@ -2278,7 +2284,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||||||
Tesla.Mock.mock(fn
|
Tesla.Mock.mock(fn
|
||||||
%{method: :get, url: "https://princess.cat/users/mewmew"} ->
|
%{method: :get, url: "https://princess.cat/users/mewmew"} ->
|
||||||
file = File.read!("test/fixtures/mewmew_no_name.json")
|
file = File.read!("test/fixtures/mewmew_no_name.json")
|
||||||
%Tesla.Env{status: 200, body: file}
|
%Tesla.Env{status: 200, body: file, headers: HttpRequestMock.activitypub_object_headers()}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
{:ok, user} = ActivityPub.make_user_from_ap_id("https://princess.cat/users/mewmew")
|
{:ok, user} = ActivityPub.make_user_from_ap_id("https://princess.cat/users/mewmew")
|
||||||
|
@ -60,7 +60,11 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AnnounceHandlingTest do
|
|||||||
|
|
||||||
Tesla.Mock.mock(fn
|
Tesla.Mock.mock(fn
|
||||||
%{method: :get} ->
|
%{method: :get} ->
|
||||||
%Tesla.Env{status: 200, body: File.read!("test/fixtures/mastodon-note-object.json")}
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/mastodon-note-object.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
|
}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_user = insert(:user, local: false, ap_id: data["actor"])
|
_user = insert(:user, local: false, ap_id: data["actor"])
|
||||||
|
@ -13,7 +13,11 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.ArticleHandlingTest do
|
|||||||
|
|
||||||
test "Pterotype (Wordpress Plugin) Article" do
|
test "Pterotype (Wordpress Plugin) Article" do
|
||||||
Tesla.Mock.mock(fn %{url: "https://wedistribute.org/wp-json/pterotype/v1/actor/-blog"} ->
|
Tesla.Mock.mock(fn %{url: "https://wedistribute.org/wp-json/pterotype/v1/actor/-blog"} ->
|
||||||
%Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/wedistribute-user.json")}
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/tesla_mock/wedistribute-user.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
|
}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
data =
|
data =
|
||||||
@ -36,13 +40,15 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.ArticleHandlingTest do
|
|||||||
%{url: "https://baptiste.gelez.xyz/~/PlumeDevelopment/this-month-in-plume-june-2018/"} ->
|
%{url: "https://baptiste.gelez.xyz/~/PlumeDevelopment/this-month-in-plume-june-2018/"} ->
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/baptiste.gelex.xyz-article.json")
|
body: File.read!("test/fixtures/tesla_mock/baptiste.gelex.xyz-article.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
}
|
}
|
||||||
|
|
||||||
%{url: "https://baptiste.gelez.xyz/@/BaptisteGelez"} ->
|
%{url: "https://baptiste.gelez.xyz/@/BaptisteGelez"} ->
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/baptiste.gelex.xyz-user.json")
|
body: File.read!("test/fixtures/tesla_mock/baptiste.gelex.xyz-user.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -61,7 +67,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.ArticleHandlingTest do
|
|||||||
Tesla.Mock.mock(fn %{url: "https://prismo.news/@mxb"} ->
|
Tesla.Mock.mock(fn %{url: "https://prismo.news/@mxb"} ->
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/https___prismo.news__mxb.json")
|
body: File.read!("test/fixtures/tesla_mock/https___prismo.news__mxb.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -48,7 +48,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AudioHandlingTest do
|
|||||||
%{url: "https://channels.tests.funkwhale.audio/federation/actors/compositions"} ->
|
%{url: "https://channels.tests.funkwhale.audio/federation/actors/compositions"} ->
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/funkwhale_channel.json")
|
body: File.read!("test/fixtures/tesla_mock/funkwhale_channel.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -13,13 +13,15 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.EventHandlingTest do
|
|||||||
%{url: "https://mobilizon.org/events/252d5816-00a3-4a89-a66f-15bf65c33e39"} ->
|
%{url: "https://mobilizon.org/events/252d5816-00a3-4a89-a66f-15bf65c33e39"} ->
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/mobilizon.org-event.json")
|
body: File.read!("test/fixtures/tesla_mock/mobilizon.org-event.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
}
|
}
|
||||||
|
|
||||||
%{url: "https://mobilizon.org/@tcit"} ->
|
%{url: "https://mobilizon.org/@tcit"} ->
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/mobilizon.org-user.json")
|
body: File.read!("test/fixtures/tesla_mock/mobilizon.org-user.json"),
|
||||||
|
headers: HttpRequestMock.activitypub_object_headers()
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
defmodule HttpRequestMock do
|
defmodule HttpRequestMock do
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
|
def activitypub_object_headers, do: [{"content-type", "application/activity+json"}]
|
||||||
|
|
||||||
def request(
|
def request(
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
url: url,
|
url: url,
|
||||||
@ -34,7 +36,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/https___osada.macgirvin.com_channel_mike.json")
|
body: File.read!("test/fixtures/tesla_mock/https___osada.macgirvin.com_channel_mike.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -42,7 +45,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/moonman@shitposter.club.json")
|
body: File.read!("test/fixtures/tesla_mock/moonman@shitposter.club.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -50,7 +54,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/status.emelie.json")
|
body: File.read!("test/fixtures/tesla_mock/status.emelie.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -66,7 +71,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/emelie.json")
|
body: File.read!("test/fixtures/tesla_mock/emelie.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -78,7 +84,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/rinpatch.json")
|
body: File.read!("test/fixtures/tesla_mock/rinpatch.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -86,7 +93,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/poll_attachment.json")
|
body: File.read!("test/fixtures/tesla_mock/poll_attachment.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -99,7 +107,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/webfinger_emelie.json")
|
body: File.read!("test/fixtures/tesla_mock/webfinger_emelie.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -112,7 +121,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/mike@osada.macgirvin.com.json")
|
body: File.read!("test/fixtures/tesla_mock/mike@osada.macgirvin.com.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -190,7 +200,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/lucifermysticus.json")
|
body: File.read!("test/fixtures/tesla_mock/lucifermysticus.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -198,7 +209,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/https___prismo.news__mxb.json")
|
body: File.read!("test/fixtures/tesla_mock/https___prismo.news__mxb.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -211,7 +223,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/kaniini@hubzilla.example.org.json")
|
body: File.read!("test/fixtures/tesla_mock/kaniini@hubzilla.example.org.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -219,7 +232,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/rye.json")
|
body: File.read!("test/fixtures/tesla_mock/rye.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -227,7 +241,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/rye.json")
|
body: File.read!("test/fixtures/tesla_mock/rye.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -246,7 +261,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/puckipedia.com.json")
|
body: File.read!("test/fixtures/tesla_mock/puckipedia.com.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -254,7 +270,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/7even.json")
|
body: File.read!("test/fixtures/tesla_mock/7even.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -262,7 +279,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/peertube.moe-vid.json")
|
body: File.read!("test/fixtures/tesla_mock/peertube.moe-vid.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -270,7 +288,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/https___framatube.org_accounts_framasoft.json")
|
body: File.read!("test/fixtures/tesla_mock/https___framatube.org_accounts_framasoft.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -278,7 +297,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/framatube.org-video.json")
|
body: File.read!("test/fixtures/tesla_mock/framatube.org-video.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -286,7 +306,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/craigmaloney.json")
|
body: File.read!("test/fixtures/tesla_mock/craigmaloney.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -294,7 +315,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/peertube-social.json")
|
body: File.read!("test/fixtures/tesla_mock/peertube-social.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -304,7 +326,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/mobilizon.org-event.json")
|
body: File.read!("test/fixtures/tesla_mock/mobilizon.org-event.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -312,7 +335,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/mobilizon.org-user.json")
|
body: File.read!("test/fixtures/tesla_mock/mobilizon.org-user.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -320,7 +344,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/baptiste.gelex.xyz-user.json")
|
body: File.read!("test/fixtures/tesla_mock/baptiste.gelex.xyz-user.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -328,7 +353,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/baptiste.gelex.xyz-article.json")
|
body: File.read!("test/fixtures/tesla_mock/baptiste.gelex.xyz-article.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -336,7 +362,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/wedistribute-article.json")
|
body: File.read!("test/fixtures/tesla_mock/wedistribute-article.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -344,7 +371,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/wedistribute-user.json")
|
body: File.read!("test/fixtures/tesla_mock/wedistribute-user.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -352,7 +380,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/admin@mastdon.example.org.json")
|
body: File.read!("test/fixtures/tesla_mock/admin@mastdon.example.org.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -362,7 +391,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/relay@mastdon.example.org.json")
|
body: File.read!("test/fixtures/tesla_mock/relay@mastdon.example.org.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -482,7 +512,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/pekorino@pawoo.net_host_meta.json")
|
body: File.read!("test/fixtures/tesla_mock/pekorino@pawoo.net_host_meta.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -543,7 +574,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/mastodon-note-object.json")
|
body: File.read!("test/fixtures/mastodon-note-object.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -567,7 +599,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/mayumayu.json")
|
body: File.read!("test/fixtures/tesla_mock/mayumayu.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -580,7 +613,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/mayumayupost.json")
|
body: File.read!("test/fixtures/tesla_mock/mayumayupost.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -795,7 +829,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/winterdienst_webfinger.json")
|
body: File.read!("test/fixtures/tesla_mock/winterdienst_webfinger.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -867,12 +902,21 @@ defmodule HttpRequestMock do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get("https://mastodon.social/users/lambadalambda", _, _, _) do
|
def get("https://mastodon.social/users/lambadalambda", _, _, _) do
|
||||||
{:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/lambadalambda.json")}}
|
{:ok,
|
||||||
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/lambadalambda.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def get("https://apfed.club/channel/indio", _, _, _) do
|
def get("https://apfed.club/channel/indio", _, _, _) do
|
||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/osada-user-indio.json")}}
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/tesla_mock/osada-user-indio.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def get("https://social.heldscal.la/user/23211", _, _, [{"accept", "application/activity+json"}]) do
|
def get("https://social.heldscal.la/user/23211", _, _, [{"accept", "application/activity+json"}]) do
|
||||||
@ -895,7 +939,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/users_mock/masto_closed_followers.json")
|
body: File.read!("test/fixtures/users_mock/masto_closed_followers.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -903,7 +948,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/users_mock/masto_closed_followers_page.json")
|
body: File.read!("test/fixtures/users_mock/masto_closed_followers_page.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -911,7 +957,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/users_mock/masto_closed_following.json")
|
body: File.read!("test/fixtures/users_mock/masto_closed_following.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -919,7 +966,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/users_mock/masto_closed_following_page.json")
|
body: File.read!("test/fixtures/users_mock/masto_closed_following_page.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -927,7 +975,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/users_mock/friendica_followers.json")
|
body: File.read!("test/fixtures/users_mock/friendica_followers.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -935,7 +984,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/users_mock/friendica_following.json")
|
body: File.read!("test/fixtures/users_mock/friendica_following.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -943,7 +993,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/users_mock/pleroma_followers.json")
|
body: File.read!("test/fixtures/users_mock/pleroma_followers.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -951,7 +1002,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/users_mock/pleroma_following.json")
|
body: File.read!("test/fixtures/users_mock/pleroma_following.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1049,7 +1101,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/https__info.pleroma.site_activity.json")
|
body: File.read!("test/fixtures/tesla_mock/https__info.pleroma.site_activity.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1063,7 +1116,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/https__info.pleroma.site_activity2.json")
|
body: File.read!("test/fixtures/tesla_mock/https__info.pleroma.site_activity2.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1077,7 +1131,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/https__info.pleroma.site_activity3.json")
|
body: File.read!("test/fixtures/tesla_mock/https__info.pleroma.site_activity3.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1110,7 +1165,12 @@ defmodule HttpRequestMock do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get("http://mastodon.example.org/@admin/99541947525187367", _, _, _) do
|
def get("http://mastodon.example.org/@admin/99541947525187367", _, _, _) do
|
||||||
{:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/mastodon-post-activity.json")}}
|
{:ok,
|
||||||
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/mastodon-post-activity.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def get("https://info.pleroma.site/activity4.json", _, _, _) do
|
def get("https://info.pleroma.site/activity4.json", _, _, _) do
|
||||||
@ -1137,7 +1197,8 @@ defmodule HttpRequestMock do
|
|||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{
|
%Tesla.Env{
|
||||||
status: 200,
|
status: 200,
|
||||||
body: File.read!("test/fixtures/tesla_mock/misskey_poll_no_end_date.json")
|
body: File.read!("test/fixtures/tesla_mock/misskey_poll_no_end_date.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
}}
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1146,11 +1207,21 @@ defmodule HttpRequestMock do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get("https://skippers-bin.com/users/7v1w1r8ce6", _, _, _) do
|
def get("https://skippers-bin.com/users/7v1w1r8ce6", _, _, _) do
|
||||||
{:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/sjw.json")}}
|
{:ok,
|
||||||
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/tesla_mock/sjw.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def get("https://patch.cx/users/rin", _, _, _) do
|
def get("https://patch.cx/users/rin", _, _, _) do
|
||||||
{:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/rin.json")}}
|
{:ok,
|
||||||
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/tesla_mock/rin.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(
|
def get(
|
||||||
@ -1160,12 +1231,20 @@ defmodule HttpRequestMock do
|
|||||||
_
|
_
|
||||||
) do
|
) do
|
||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/funkwhale_audio.json")}}
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/tesla_mock/funkwhale_audio.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def get("https://channels.tests.funkwhale.audio/federation/actors/compositions", _, _, _) do
|
def get("https://channels.tests.funkwhale.audio/federation/actors/compositions", _, _, _) do
|
||||||
{:ok,
|
{:ok,
|
||||||
%Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/funkwhale_channel.json")}}
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/tesla_mock/funkwhale_channel.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def get("http://example.com/rel_me/error", _, _, _) do
|
def get("http://example.com/rel_me/error", _, _, _) do
|
||||||
@ -1173,7 +1252,12 @@ defmodule HttpRequestMock do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get("https://relay.mastodon.host/actor", _, _, _) do
|
def get("https://relay.mastodon.host/actor", _, _, _) do
|
||||||
{:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/relay/relay.json")}}
|
{:ok,
|
||||||
|
%Tesla.Env{
|
||||||
|
status: 200,
|
||||||
|
body: File.read!("test/fixtures/relay/relay.json"),
|
||||||
|
headers: activitypub_object_headers()
|
||||||
|
}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def get("http://localhost:4001/", _, "", [{"accept", "text/html"}]) do
|
def get("http://localhost:4001/", _, "", [{"accept", "text/html"}]) do
|
||||||
|
Loading…
Reference in New Issue
Block a user