router: Make /federation_status publicly available

This commit is contained in:
Haelwenn (lanodan) Monnier 2023-08-08 19:08:59 +02:00
parent bf2d6abaf2
commit 66f5ae0c5a
3 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1 @@
- Make `/api/v1/pleroma/federation_status` publicly available

View File

@ -224,6 +224,12 @@ defmodule Pleroma.Web.Router do
post("/remote_interaction", UtilController, :remote_interaction) post("/remote_interaction", UtilController, :remote_interaction)
end 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 scope "/api/v1/pleroma", Pleroma.Web do
pipe_through(:pleroma_api) pipe_through(:pleroma_api)
post("/uploader_callback/:upload_path", UploaderController, :callback) post("/uploader_callback/:upload_path", UploaderController, :callback)
@ -604,7 +610,6 @@ defmodule Pleroma.Web.Router do
scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
pipe_through(:api) pipe_through(:api)
get("/accounts/:id/scrobbles", ScrobbleController, :index) get("/accounts/:id/scrobbles", ScrobbleController, :index)
get("/federation_status", InstancesController, :show)
end end
scope "/api/v2/pleroma", Pleroma.Web.PleromaAPI do scope "/api/v2/pleroma", Pleroma.Web.PleromaAPI do

View File

@ -26,6 +26,8 @@ test "GET /api/v1/pleroma/federation_status", %{
constant_unreachable: constant_unreachable, constant_unreachable: constant_unreachable,
constant: constant constant: constant
} do } do
clear_config([:instance, :public], false)
constant_host = URI.parse(constant).host constant_host = URI.parse(constant).host
assert conn assert conn