commit: 66f5ae0c5a0ab57dc6bf3f52bbf976128259800f
parent bf2d6abaf2f7ccc908c512a8d5be4e091779e9e5
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 8 Aug 2023 19:08:59 +0200
router: Make /federation_status publicly available
Diffstat:
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/changelog.d/federation_status-access.change b/changelog.d/federation_status-access.change
@@ -0,0 +1 @@
+- Make `/api/v1/pleroma/federation_status` publicly available
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex
@@ -224,6 +224,12 @@ defmodule Pleroma.Web.Router do
post("/remote_interaction", UtilController, :remote_interaction)
end
+ scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
+ pipe_through(:pleroma_api)
+
+ get("/federation_status", InstancesController, :show)
+ end
+
scope "/api/v1/pleroma", Pleroma.Web do
pipe_through(:pleroma_api)
post("/uploader_callback/:upload_path", UploaderController, :callback)
@@ -604,7 +610,6 @@ defmodule Pleroma.Web.Router do
scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
pipe_through(:api)
get("/accounts/:id/scrobbles", ScrobbleController, :index)
- get("/federation_status", InstancesController, :show)
end
scope "/api/v2/pleroma", Pleroma.Web.PleromaAPI do
diff --git a/test/pleroma/web/pleroma_api/controllers/instances_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/instances_controller_test.exs
@@ -26,6 +26,8 @@ defmodule Pleroma.Web.PleromaApi.InstancesControllerTest do
constant_unreachable: constant_unreachable,
constant: constant
} do
+ clear_config([:instance, :public], false)
+
constant_host = URI.parse(constant).host
assert conn