Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed May 23, 2024
1 parent 4647d71 commit 2bd4bc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/web/controllers/incoming_activity_pub_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ defmodule ActivityPub.Web.IncomingActivityPubController do
use ActivityPub.Web, :controller

import Untangle
use Arrows

alias ActivityPub.Config
# alias ActivityPub.Actor
Expand Down Expand Up @@ -51,10 +52,12 @@ defmodule ActivityPub.Web.IncomingActivityPubController do

def outbox_info(conn, params) do
if Config.federating?() do
Utils.error_json(conn, "this API path only accepts GET requests", 403)
"this API path only accepts GET requests"
else
Utils.error_json(conn, "this instance is not currently federating", 403)
"this instance is not currently federating"
end
|> debug()
|> Utils.error_json(conn, ..., 403)
end

defp apply_process(conn, %{"type" => "Delete"} = params, fun) do
Expand Down
5 changes: 4 additions & 1 deletion lib/web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ defmodule ActivityPub.Web.Router do
# URLs for interop with Mastodon clients / AP testing tools
post("/users/:username", IncomingActivityPubController, :inbox)
post("/users/:username/inbox", IncomingActivityPubController, :inbox)
# return error saying only POST supported - TODO: implement this for AP C2S API

# return error saying not supported
post("/users/:username/outbox", IncomingActivityPubController, :outbox_info)
end

Expand All @@ -97,6 +98,8 @@ defmodule ActivityPub.Web.Router do
pipe_through(:signed_activity_pub_incoming)

post("/actors/:username/inbox", IncomingActivityPubController, :inbox)
# TODO: implement this for AP C2S API
post("/actors/:username/outbox", IncomingActivityPubController, :outbox_info)
post("/shared_inbox", IncomingActivityPubController, :inbox)
end

Expand Down

0 comments on commit 2bd4bc6

Please sign in to comment.