projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add OpenAPI spec for AdminAPI.UserController
[akkoma]
/
lib
/
pleroma
/
web
/
router.ex
diff --git
a/lib/pleroma/web/router.ex
b/lib/pleroma/web/router.ex
index 297f03fbd1ba7b56966e95962036069abfc28254..de0bd27d73fa7ce5dcc7edaf6303b9f04d53d534 100644
(file)
--- a/
lib/pleroma/web/router.ex
+++ b/
lib/pleroma/web/router.ex
@@
-140,7
+140,7
@@
defmodule Pleroma.Web.Router do
plug(Pleroma.Web.Plugs.MappedSignatureToIdentityPlug)
end
plug(Pleroma.Web.Plugs.MappedSignatureToIdentityPlug)
end
- scope "/api/pleroma", Pleroma.Web.TwitterAPI do
+ scope "/api/
v1/
pleroma", Pleroma.Web.TwitterAPI do
pipe_through(:pleroma_api)
get("/password_reset/:token", PasswordController, :reset, as: :reset_password)
pipe_through(:pleroma_api)
get("/password_reset/:token", PasswordController, :reset, as: :reset_password)
@@
-150,12
+150,12
@@
defmodule Pleroma.Web.Router do
get("/healthcheck", UtilController, :healthcheck)
end
get("/healthcheck", UtilController, :healthcheck)
end
- scope "/api/pleroma", Pleroma.Web do
+ scope "/api/
v1/
pleroma", Pleroma.Web do
pipe_through(:pleroma_api)
post("/uploader_callback/:upload_path", UploaderController, :callback)
end
pipe_through(:pleroma_api)
post("/uploader_callback/:upload_path", UploaderController, :callback)
end
- scope "/api/pleroma/admin", Pleroma.Web.AdminAPI do
+ scope "/api/
v1/
pleroma/admin", Pleroma.Web.AdminAPI do
pipe_through(:admin_api)
put("/users/disable_mfa", AdminAPIController, :disable_mfa)
pipe_through(:admin_api)
put("/users/disable_mfa", AdminAPIController, :disable_mfa)
@@
-204,7
+204,7
@@
defmodule Pleroma.Web.Router do
get("/users/:nickname/credentials", AdminAPIController, :show_user_credentials)
patch("/users/:nickname/credentials", AdminAPIController, :update_user_credentials)
get("/users/:nickname/credentials", AdminAPIController, :show_user_credentials)
patch("/users/:nickname/credentials", AdminAPIController, :update_user_credentials)
- get("/users", UserController, :
list
)
+ get("/users", UserController, :
index
)
get("/users/:nickname", UserController, :show)
get("/users/:nickname/statuses", AdminAPIController, :list_user_statuses)
get("/users/:nickname/chats", AdminAPIController, :list_user_chats)
get("/users/:nickname", UserController, :show)
get("/users/:nickname/statuses", AdminAPIController, :list_user_statuses)
get("/users/:nickname/chats", AdminAPIController, :list_user_chats)
@@
-259,7
+259,7
@@
defmodule Pleroma.Web.Router do
post("/backups", AdminAPIController, :create_backup)
end
post("/backups", AdminAPIController, :create_backup)
end
- scope "/api/pleroma/emoji", Pleroma.Web.PleromaAPI do
+ scope "/api/
v1/
pleroma/emoji", Pleroma.Web.PleromaAPI do
scope "/pack" do
pipe_through(:admin_api)
scope "/pack" do
pipe_through(:admin_api)
@@
-368,6
+368,12
@@
defmodule Pleroma.Web.Router do
get("/statuses/:id/reactions", EmojiReactionController, :index)
end
get("/statuses/:id/reactions", EmojiReactionController, :index)
end
+ scope "/api/v0/pleroma", Pleroma.Web.PleromaAPI do
+ pipe_through(:authenticated_api)
+ get("/reports", ReportController, :index)
+ get("/reports/:id", ReportController, :show)
+ end
+
scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
scope [] do
pipe_through(:authenticated_api)
scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
scope [] do
pipe_through(:authenticated_api)
@@
-420,6
+426,13
@@
defmodule Pleroma.Web.Router do
get("/federation_status", InstancesController, :show)
end
get("/federation_status", InstancesController, :show)
end
+ scope "/api/v2/pleroma", Pleroma.Web.PleromaAPI do
+ scope [] do
+ pipe_through(:authenticated_api)
+ get("/chats", ChatController, :index2)
+ end
+ end
+
scope "/api/v1", Pleroma.Web.MastodonAPI do
pipe_through(:authenticated_api)
scope "/api/v1", Pleroma.Web.MastodonAPI do
pipe_through(:authenticated_api)
@@
-443,6
+456,7
@@
defmodule Pleroma.Web.Router do
get("/conversations", ConversationController, :index)
post("/conversations/:id/read", ConversationController, :mark_as_read)
get("/conversations", ConversationController, :index)
post("/conversations/:id/read", ConversationController, :mark_as_read)
+ delete("/conversations/:id", ConversationController, :delete)
get("/domain_blocks", DomainBlockController, :index)
post("/domain_blocks", DomainBlockController, :create)
get("/domain_blocks", DomainBlockController, :index)
post("/domain_blocks", DomainBlockController, :create)
@@
-801,6
+815,7
@@
defmodule Pleroma.Web.Router do
scope "/", Pleroma.Web.Fallback do
get("/registration/:token", RedirectController, :registration_page)
get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
scope "/", Pleroma.Web.Fallback do
get("/registration/:token", RedirectController, :registration_page)
get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
+ match(:*, "/api/pleroma*path", LegacyPleromaApiRerouterPlug, [])
get("/api*path", RedirectController, :api_not_implemented)
get("/*path", RedirectController, :redirector_with_preload)
get("/api*path", RedirectController, :api_not_implemented)
get("/*path", RedirectController, :redirector_with_preload)