Refactor Mobilizon.Federation.ActivityPub and add typespecs

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-09-28 19:40:37 +02:00
parent 41f086e2c9
commit b5d9b82bdd
125 changed files with 2497 additions and 1673 deletions

View File

@@ -17,6 +17,7 @@ defmodule Mobilizon.Web.WebFingerController do
@doc """
Provides /.well-known/host-meta
"""
@spec host_meta(Plug.Conn.t(), any()) :: Plug.Conn.t() | no_return
def host_meta(conn, _params) do
xml = WebFinger.host_meta()
@@ -28,6 +29,7 @@ defmodule Mobilizon.Web.WebFingerController do
@doc """
Provides /.well-known/webfinger
"""
@spec webfinger(Plug.Conn.t(), any()) :: Plug.Conn.t() | no_return
def webfinger(conn, %{"resource" => resource}) do
case WebFinger.webfinger(resource, "JSON") do
{:ok, response} -> json(conn, response)