feat(activitypub): implement FEP-2677 to identify the application actor used for federation

Instead of always assuming it will be @relay@host.tld

Closes #1367

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-12-14 16:31:58 +01:00
parent 049ffd61b7
commit f10977a99a
4 changed files with 56 additions and 5 deletions

View File

@@ -2,12 +2,16 @@ defmodule Mobilizon.Web.NodeInfoControllerTest do
use Mobilizon.Web.ConnCase
alias Mobilizon.Config
alias Mobilizon.Federation.ActivityPub.Relay
use Mobilizon.Web, :verified_routes
test "Get node info schemas", %{conn: conn} do
conn = get(conn, url(~p"/.well-known/nodeinfo"))
relay = Relay.get_actor()
relay_url = relay.url
assert json_response(conn, 200) == %{
"links" => [
%{
@@ -17,6 +21,10 @@ defmodule Mobilizon.Web.NodeInfoControllerTest do
%{
"href" => url(~p"/.well-known/nodeinfo/2.1"),
"rel" => "http://nodeinfo.diaspora.software/ns/schema/2.1"
},
%{
"href" => relay_url,
"rel" => "https://www.w3.org/ns/activitystreams#Application"
}
]
}