update tests
[akkoma] / lib / pleroma / web / router.ex
index c8c1c22dd3c66b9e9484c73c09e167f130f4fe6e..c2e6e88198fcd877e2b78436f64decb69b00e7c4 100644 (file)
@@ -133,6 +133,10 @@ defmodule Pleroma.Web.Router do
     })
   end
 
+  pipeline :http_signature do
+    plug(Pleroma.Web.Plugs.HTTPSignaturePlug)
+  end
+
   scope "/api/pleroma", Pleroma.Web.TwitterAPI do
     pipe_through(:pleroma_api)
 
@@ -259,6 +263,21 @@ defmodule Pleroma.Web.Router do
     end
   end
 
+  scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
+    pipe_through(:authenticated_api)
+
+    scope [] do
+      pipe_through(:oauth_read)
+      get("/conversations/:id/statuses", PleromaAPIController, :conversation_statuses)
+      get("/conversations/:id", PleromaAPIController, :conversation)
+    end
+
+    scope [] do
+      pipe_through(:oauth_write)
+      patch("/conversations/:id", PleromaAPIController, :update_conversation)
+    end
+  end
+
   scope "/api/v1", Pleroma.Web.MastodonAPI do
     pipe_through(:authenticated_api)
 
@@ -671,7 +690,14 @@ defmodule Pleroma.Web.Router do
     pipe_through(:ap_service_actor)
 
     get("/", ActivityPubController, :relay)
-    post("/inbox", ActivityPubController, :inbox)
+
+    scope [] do
+      pipe_through(:http_signature)
+      post("/inbox", ActivityPubController, :inbox)
+    end
+
+    get("/following", ActivityPubController, :following, assigns: %{relay: true})
+    get("/followers", ActivityPubController, :followers, assigns: %{relay: true})
   end
 
   scope "/internal/fetch", Pleroma.Web.ActivityPub do