1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Router do
6 use Pleroma.Web, :router
9 plug(:accepts, ["html"])
15 plug(Pleroma.Plugs.OAuthPlug)
16 plug(Pleroma.Plugs.UserEnabledPlug)
19 pipeline :expect_authentication do
20 plug(Pleroma.Plugs.ExpectAuthenticatedCheckPlug)
23 pipeline :expect_public_instance_or_authentication do
24 plug(Pleroma.Plugs.ExpectPublicOrAuthenticatedCheckPlug)
27 pipeline :authenticate do
28 plug(Pleroma.Plugs.OAuthPlug)
29 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
30 plug(Pleroma.Plugs.UserFetcherPlug)
31 plug(Pleroma.Plugs.SessionAuthenticationPlug)
32 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
33 plug(Pleroma.Plugs.AuthenticationPlug)
36 pipeline :after_auth do
37 plug(Pleroma.Plugs.UserEnabledPlug)
38 plug(Pleroma.Plugs.SetUserSessionIdPlug)
39 plug(Pleroma.Plugs.EnsureUserKeyPlug)
43 plug(:accepts, ["json"])
46 plug(OpenApiSpex.Plug.PutApiSpec, module: Pleroma.Web.ApiSpec)
50 plug(:expect_public_instance_or_authentication)
53 plug(Pleroma.Plugs.IdempotencyPlug)
56 pipeline :authenticated_api do
57 plug(:expect_authentication)
60 plug(Pleroma.Plugs.EnsureAuthenticatedPlug)
61 plug(Pleroma.Plugs.IdempotencyPlug)
64 pipeline :admin_api do
65 plug(:expect_authentication)
67 plug(Pleroma.Plugs.AdminSecretAuthenticationPlug)
69 plug(Pleroma.Plugs.EnsureAuthenticatedPlug)
70 plug(Pleroma.Plugs.UserIsAdminPlug)
71 plug(Pleroma.Plugs.IdempotencyPlug)
74 pipeline :mastodon_html do
80 pipeline :pleroma_html do
83 plug(Pleroma.Plugs.EnsureUserKeyPlug)
86 pipeline :well_known do
87 plug(:accepts, ["json", "jrd+json", "xml", "xrd+xml"])
91 plug(:accepts, ["json", "xml"])
92 plug(OpenApiSpex.Plug.PutApiSpec, module: Pleroma.Web.ApiSpec)
95 pipeline :pleroma_api do
96 plug(:accepts, ["html", "json"])
97 plug(OpenApiSpex.Plug.PutApiSpec, module: Pleroma.Web.ApiSpec)
100 pipeline :mailbox_preview do
101 plug(:accepts, ["html"])
103 plug(:put_secure_browser_headers, %{
104 "content-security-policy" =>
105 "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline' 'unsafe-eval'"
109 pipeline :http_signature do
110 plug(Pleroma.Web.Plugs.HTTPSignaturePlug)
111 plug(Pleroma.Web.Plugs.MappedSignatureToIdentityPlug)
114 scope "/api/pleroma", Pleroma.Web.TwitterAPI do
115 pipe_through(:pleroma_api)
117 get("/password_reset/:token", PasswordController, :reset, as: :reset_password)
118 post("/password_reset", PasswordController, :do_reset, as: :reset_password)
119 get("/emoji", UtilController, :emoji)
120 get("/captcha", UtilController, :captcha)
121 get("/healthcheck", UtilController, :healthcheck)
124 scope "/api/pleroma", Pleroma.Web do
125 pipe_through(:pleroma_api)
126 post("/uploader_callback/:upload_path", UploaderController, :callback)
129 scope "/api/pleroma/admin", Pleroma.Web.AdminAPI do
130 pipe_through(:admin_api)
132 post("/users/follow", AdminAPIController, :user_follow)
133 post("/users/unfollow", AdminAPIController, :user_unfollow)
135 put("/users/disable_mfa", AdminAPIController, :disable_mfa)
136 delete("/users", AdminAPIController, :user_delete)
137 post("/users", AdminAPIController, :users_create)
138 patch("/users/:nickname/toggle_activation", AdminAPIController, :user_toggle_activation)
139 patch("/users/activate", AdminAPIController, :user_activate)
140 patch("/users/deactivate", AdminAPIController, :user_deactivate)
141 patch("/users/approve", AdminAPIController, :user_approve)
142 put("/users/tag", AdminAPIController, :tag_users)
143 delete("/users/tag", AdminAPIController, :untag_users)
145 get("/users/:nickname/permission_group", AdminAPIController, :right_get)
146 get("/users/:nickname/permission_group/:permission_group", AdminAPIController, :right_get)
148 post("/users/:nickname/permission_group/:permission_group", AdminAPIController, :right_add)
151 "/users/:nickname/permission_group/:permission_group",
156 post("/users/permission_group/:permission_group", AdminAPIController, :right_add_multiple)
159 "/users/permission_group/:permission_group",
161 :right_delete_multiple
164 get("/relay", RelayController, :index)
165 post("/relay", RelayController, :follow)
166 delete("/relay", RelayController, :unfollow)
168 post("/users/invite_token", InviteController, :create)
169 get("/users/invites", InviteController, :index)
170 post("/users/revoke_invite", InviteController, :revoke)
171 post("/users/email_invite", InviteController, :email)
173 get("/users/:nickname/password_reset", AdminAPIController, :get_password_reset)
174 patch("/users/force_password_reset", AdminAPIController, :force_password_reset)
175 get("/users/:nickname/credentials", AdminAPIController, :show_user_credentials)
176 patch("/users/:nickname/credentials", AdminAPIController, :update_user_credentials)
178 get("/users", AdminAPIController, :list_users)
179 get("/users/:nickname", AdminAPIController, :user_show)
180 get("/users/:nickname/statuses", AdminAPIController, :list_user_statuses)
181 get("/users/:nickname/chats", AdminAPIController, :list_user_chats)
183 get("/instances/:instance/statuses", AdminAPIController, :list_instance_statuses)
185 get("/instance_document/:name", InstanceDocumentController, :show)
186 patch("/instance_document/:name", InstanceDocumentController, :update)
187 delete("/instance_document/:name", InstanceDocumentController, :delete)
189 patch("/users/confirm_email", AdminAPIController, :confirm_email)
190 patch("/users/resend_confirmation_email", AdminAPIController, :resend_confirmation_email)
192 get("/reports", ReportController, :index)
193 get("/reports/:id", ReportController, :show)
194 patch("/reports", ReportController, :update)
195 post("/reports/:id/notes", ReportController, :notes_create)
196 delete("/reports/:report_id/notes/:id", ReportController, :notes_delete)
198 get("/statuses/:id", StatusController, :show)
199 put("/statuses/:id", StatusController, :update)
200 delete("/statuses/:id", StatusController, :delete)
201 get("/statuses", StatusController, :index)
203 get("/config", ConfigController, :show)
204 post("/config", ConfigController, :update)
205 get("/config/descriptions", ConfigController, :descriptions)
206 get("/need_reboot", AdminAPIController, :need_reboot)
207 get("/restart", AdminAPIController, :restart)
209 get("/moderation_log", AdminAPIController, :list_log)
211 post("/reload_emoji", AdminAPIController, :reload_emoji)
212 get("/stats", AdminAPIController, :stats)
214 get("/oauth_app", OAuthAppController, :index)
215 post("/oauth_app", OAuthAppController, :create)
216 patch("/oauth_app/:id", OAuthAppController, :update)
217 delete("/oauth_app/:id", OAuthAppController, :delete)
219 get("/media_proxy_caches", MediaProxyCacheController, :index)
220 post("/media_proxy_caches/delete", MediaProxyCacheController, :delete)
221 post("/media_proxy_caches/purge", MediaProxyCacheController, :purge)
223 get("/chats/:id", ChatController, :show)
224 get("/chats/:id/messages", ChatController, :messages)
225 delete("/chats/:id/messages/:message_id", ChatController, :delete_message)
228 scope "/api/pleroma/emoji", Pleroma.Web.PleromaAPI do
231 pipe_through(:admin_api)
233 get("/import", EmojiPackController, :import_from_filesystem)
234 get("/remote", EmojiPackController, :remote)
235 post("/download", EmojiPackController, :download)
237 post("/:name", EmojiPackController, :create)
238 patch("/:name", EmojiPackController, :update)
239 delete("/:name", EmojiPackController, :delete)
241 post("/:name/files", EmojiPackController, :add_file)
242 patch("/:name/files", EmojiPackController, :update_file)
243 delete("/:name/files", EmojiPackController, :delete_file)
246 # Pack info / downloading
249 get("/", EmojiPackController, :index)
250 get("/:name", EmojiPackController, :show)
251 get("/:name/archive", EmojiPackController, :archive)
255 scope "/", Pleroma.Web.TwitterAPI do
256 pipe_through(:pleroma_html)
258 post("/main/ostatus", UtilController, :remote_subscribe)
259 get("/ostatus_subscribe", RemoteFollowController, :follow)
261 post("/ostatus_subscribe", RemoteFollowController, :do_follow)
264 scope "/api/pleroma", Pleroma.Web.TwitterAPI do
265 pipe_through(:authenticated_api)
267 post("/change_email", UtilController, :change_email)
268 post("/change_password", UtilController, :change_password)
269 post("/delete_account", UtilController, :delete_account)
270 put("/notification_settings", UtilController, :update_notificaton_settings)
271 post("/disable_account", UtilController, :disable_account)
273 post("/blocks_import", UtilController, :blocks_import)
274 post("/follow_import", UtilController, :follow_import)
277 scope "/api/pleroma", Pleroma.Web.PleromaAPI do
278 pipe_through(:authenticated_api)
280 get("/accounts/mfa", TwoFactorAuthenticationController, :settings)
281 get("/accounts/mfa/backup_codes", TwoFactorAuthenticationController, :backup_codes)
282 get("/accounts/mfa/setup/:method", TwoFactorAuthenticationController, :setup)
283 post("/accounts/mfa/confirm/:method", TwoFactorAuthenticationController, :confirm)
284 delete("/accounts/mfa/:method", TwoFactorAuthenticationController, :disable)
287 scope "/oauth", Pleroma.Web.OAuth do
290 get("/authorize", OAuthController, :authorize)
293 post("/authorize", OAuthController, :create_authorization)
294 post("/token", OAuthController, :token_exchange)
295 post("/revoke", OAuthController, :token_revoke)
296 get("/registration_details", OAuthController, :registration_details)
298 post("/mfa/challenge", MFAController, :challenge)
299 post("/mfa/verify", MFAController, :verify, as: :mfa_verify)
300 get("/mfa", MFAController, :show)
303 pipe_through(:browser)
305 get("/prepare_request", OAuthController, :prepare_request)
306 get("/:provider", OAuthController, :request)
307 get("/:provider/callback", OAuthController, :callback)
308 post("/register", OAuthController, :register)
312 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
315 get("/statuses/:id/reactions/:emoji", EmojiReactionController, :index)
316 get("/statuses/:id/reactions", EmojiReactionController, :index)
319 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
321 pipe_through(:authenticated_api)
323 post("/chats/by-account-id/:id", ChatController, :create)
324 get("/chats", ChatController, :index)
325 get("/chats/:id", ChatController, :show)
326 get("/chats/:id/messages", ChatController, :messages)
327 post("/chats/:id/messages", ChatController, :post_chat_message)
328 delete("/chats/:id/messages/:message_id", ChatController, :delete_message)
329 post("/chats/:id/read", ChatController, :mark_as_read)
330 post("/chats/:id/messages/:message_id/read", ChatController, :mark_message_as_read)
332 get("/conversations/:id/statuses", ConversationController, :statuses)
333 get("/conversations/:id", ConversationController, :show)
334 post("/conversations/read", ConversationController, :mark_as_read)
335 patch("/conversations/:id", ConversationController, :update)
337 put("/statuses/:id/reactions/:emoji", EmojiReactionController, :create)
338 delete("/statuses/:id/reactions/:emoji", EmojiReactionController, :delete)
339 post("/notifications/read", NotificationController, :mark_as_read)
341 get("/mascot", MascotController, :show)
342 put("/mascot", MascotController, :update)
344 post("/scrobble", ScrobbleController, :create)
349 get("/accounts/:id/favourites", AccountController, :favourites)
353 pipe_through(:authenticated_api)
355 post("/accounts/:id/subscribe", AccountController, :subscribe)
356 post("/accounts/:id/unsubscribe", AccountController, :unsubscribe)
359 post("/accounts/confirmation_resend", AccountController, :confirmation_resend)
362 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
364 get("/accounts/:id/scrobbles", ScrobbleController, :index)
367 scope "/api/v1", Pleroma.Web.MastodonAPI do
368 pipe_through(:authenticated_api)
370 get("/accounts/verify_credentials", AccountController, :verify_credentials)
371 patch("/accounts/update_credentials", AccountController, :update_credentials)
373 get("/accounts/relationships", AccountController, :relationships)
374 get("/accounts/:id/lists", AccountController, :lists)
375 get("/accounts/:id/identity_proofs", AccountController, :identity_proofs)
376 get("/endorsements", AccountController, :endorsements)
377 get("/blocks", AccountController, :blocks)
378 get("/mutes", AccountController, :mutes)
380 post("/follows", AccountController, :follow_by_uri)
381 post("/accounts/:id/follow", AccountController, :follow)
382 post("/accounts/:id/unfollow", AccountController, :unfollow)
383 post("/accounts/:id/block", AccountController, :block)
384 post("/accounts/:id/unblock", AccountController, :unblock)
385 post("/accounts/:id/mute", AccountController, :mute)
386 post("/accounts/:id/unmute", AccountController, :unmute)
388 get("/apps/verify_credentials", AppController, :verify_credentials)
390 get("/conversations", ConversationController, :index)
391 post("/conversations/:id/read", ConversationController, :mark_as_read)
393 get("/domain_blocks", DomainBlockController, :index)
394 post("/domain_blocks", DomainBlockController, :create)
395 delete("/domain_blocks", DomainBlockController, :delete)
397 get("/filters", FilterController, :index)
399 post("/filters", FilterController, :create)
400 get("/filters/:id", FilterController, :show)
401 put("/filters/:id", FilterController, :update)
402 delete("/filters/:id", FilterController, :delete)
404 get("/follow_requests", FollowRequestController, :index)
405 post("/follow_requests/:id/authorize", FollowRequestController, :authorize)
406 post("/follow_requests/:id/reject", FollowRequestController, :reject)
408 get("/lists", ListController, :index)
409 get("/lists/:id", ListController, :show)
410 get("/lists/:id/accounts", ListController, :list_accounts)
412 delete("/lists/:id", ListController, :delete)
413 post("/lists", ListController, :create)
414 put("/lists/:id", ListController, :update)
415 post("/lists/:id/accounts", ListController, :add_to_list)
416 delete("/lists/:id/accounts", ListController, :remove_from_list)
418 get("/markers", MarkerController, :index)
419 post("/markers", MarkerController, :upsert)
421 post("/media", MediaController, :create)
422 get("/media/:id", MediaController, :show)
423 put("/media/:id", MediaController, :update)
425 get("/notifications", NotificationController, :index)
426 get("/notifications/:id", NotificationController, :show)
428 post("/notifications/:id/dismiss", NotificationController, :dismiss)
429 post("/notifications/clear", NotificationController, :clear)
430 delete("/notifications/destroy_multiple", NotificationController, :destroy_multiple)
431 # Deprecated: was removed in Mastodon v3, use `/notifications/:id/dismiss` instead
432 post("/notifications/dismiss", NotificationController, :dismiss_via_body)
434 post("/polls/:id/votes", PollController, :vote)
436 post("/reports", ReportController, :create)
438 get("/scheduled_statuses", ScheduledActivityController, :index)
439 get("/scheduled_statuses/:id", ScheduledActivityController, :show)
441 put("/scheduled_statuses/:id", ScheduledActivityController, :update)
442 delete("/scheduled_statuses/:id", ScheduledActivityController, :delete)
444 # Unlike `GET /api/v1/accounts/:id/favourites`, demands authentication
445 get("/favourites", StatusController, :favourites)
446 get("/bookmarks", StatusController, :bookmarks)
448 post("/statuses", StatusController, :create)
449 delete("/statuses/:id", StatusController, :delete)
450 post("/statuses/:id/reblog", StatusController, :reblog)
451 post("/statuses/:id/unreblog", StatusController, :unreblog)
452 post("/statuses/:id/favourite", StatusController, :favourite)
453 post("/statuses/:id/unfavourite", StatusController, :unfavourite)
454 post("/statuses/:id/pin", StatusController, :pin)
455 post("/statuses/:id/unpin", StatusController, :unpin)
456 post("/statuses/:id/bookmark", StatusController, :bookmark)
457 post("/statuses/:id/unbookmark", StatusController, :unbookmark)
458 post("/statuses/:id/mute", StatusController, :mute_conversation)
459 post("/statuses/:id/unmute", StatusController, :unmute_conversation)
461 post("/push/subscription", SubscriptionController, :create)
462 get("/push/subscription", SubscriptionController, :show)
463 put("/push/subscription", SubscriptionController, :update)
464 delete("/push/subscription", SubscriptionController, :delete)
466 get("/suggestions", SuggestionController, :index)
468 get("/timelines/home", TimelineController, :home)
469 get("/timelines/direct", TimelineController, :direct)
470 get("/timelines/list/:list_id", TimelineController, :list)
473 scope "/api/web", Pleroma.Web do
474 pipe_through(:authenticated_api)
476 # Backend-obscure settings blob for MastoFE, don't parse/reuse elsewhere
477 put("/settings", MastoFEController, :put_settings)
480 scope "/api/v1", Pleroma.Web.MastodonAPI do
483 get("/accounts/search", SearchController, :account_search)
484 get("/search", SearchController, :search)
486 get("/accounts/:id/statuses", AccountController, :statuses)
487 get("/accounts/:id/followers", AccountController, :followers)
488 get("/accounts/:id/following", AccountController, :following)
489 get("/accounts/:id", AccountController, :show)
491 post("/accounts", AccountController, :create)
493 get("/instance", InstanceController, :show)
494 get("/instance/peers", InstanceController, :peers)
496 post("/apps", AppController, :create)
498 get("/statuses", StatusController, :index)
499 get("/statuses/:id", StatusController, :show)
500 get("/statuses/:id/context", StatusController, :context)
501 get("/statuses/:id/card", StatusController, :card)
502 get("/statuses/:id/favourited_by", StatusController, :favourited_by)
503 get("/statuses/:id/reblogged_by", StatusController, :reblogged_by)
505 get("/custom_emojis", CustomEmojiController, :index)
507 get("/trends", MastodonAPIController, :empty_array)
509 get("/timelines/public", TimelineController, :public)
510 get("/timelines/tag/:tag", TimelineController, :hashtag)
512 get("/polls/:id", PollController, :show)
515 scope "/api/v2", Pleroma.Web.MastodonAPI do
517 get("/search", SearchController, :search2)
519 post("/media", MediaController, :create2)
522 scope "/api", Pleroma.Web do
523 pipe_through(:config)
525 get("/pleroma/frontend_configurations", TwitterAPI.UtilController, :frontend_configurations)
528 scope "/api", Pleroma.Web do
532 "/account/confirm_email/:user_id/:token",
533 TwitterAPI.Controller,
540 pipe_through(:base_api)
542 get("/openapi", OpenApiSpex.Plug.RenderSpec, [])
545 scope "/api", Pleroma.Web, as: :authenticated_twitter_api do
546 pipe_through(:authenticated_api)
548 get("/oauth_tokens", TwitterAPI.Controller, :oauth_tokens)
549 delete("/oauth_tokens/:id", TwitterAPI.Controller, :revoke_token)
552 "/qvitter/statuses/notifications/read",
553 TwitterAPI.Controller,
554 :mark_notifications_as_read
559 plug(:accepts, ["html", "xml", "rss", "atom", "activity+json", "json"])
560 plug(Pleroma.Plugs.StaticFEPlug)
564 plug(:accepts, ["json", "xml"])
567 scope "/", Pleroma.Web do
568 pipe_through([:ostatus, :http_signature])
570 get("/objects/:uuid", OStatus.OStatusController, :object)
571 get("/activities/:uuid", OStatus.OStatusController, :activity)
572 get("/notice/:id", OStatus.OStatusController, :notice)
573 get("/notice/:id/embed_player", OStatus.OStatusController, :notice_player)
575 # Mastodon compatibility routes
576 get("/users/:nickname/statuses/:id", OStatus.OStatusController, :object)
577 get("/users/:nickname/statuses/:id/activity", OStatus.OStatusController, :activity)
579 get("/users/:nickname/feed", Feed.UserController, :feed, as: :user_feed)
580 get("/users/:nickname", Feed.UserController, :feed_redirect, as: :user_feed)
582 get("/tags/:tag", Feed.TagController, :feed, as: :tag_feed)
585 scope "/", Pleroma.Web do
586 pipe_through(:browser)
587 get("/mailer/unsubscribe/:token", Mailer.SubscriptionController, :unsubscribe)
590 pipeline :ap_service_actor do
591 plug(:accepts, ["activity+json", "json"])
594 # Server to Server (S2S) AP interactions
595 pipeline :activitypub do
596 plug(:ap_service_actor)
597 plug(:http_signature)
600 # Client to Server (C2S) AP interactions
601 pipeline :activitypub_client do
602 plug(:ap_service_actor)
608 scope "/", Pleroma.Web.ActivityPub do
609 pipe_through([:activitypub_client])
611 get("/api/ap/whoami", ActivityPubController, :whoami)
612 get("/users/:nickname/inbox", ActivityPubController, :read_inbox)
614 get("/users/:nickname/outbox", ActivityPubController, :outbox)
615 post("/users/:nickname/outbox", ActivityPubController, :update_outbox)
616 post("/api/ap/upload_media", ActivityPubController, :upload_media)
618 # The following two are S2S as well, see `ActivityPub.fetch_follow_information_for_user/1`:
619 get("/users/:nickname/followers", ActivityPubController, :followers)
620 get("/users/:nickname/following", ActivityPubController, :following)
623 scope "/", Pleroma.Web.ActivityPub do
624 pipe_through(:activitypub)
625 post("/inbox", ActivityPubController, :inbox)
626 post("/users/:nickname/inbox", ActivityPubController, :inbox)
629 scope "/relay", Pleroma.Web.ActivityPub do
630 pipe_through(:ap_service_actor)
632 get("/", ActivityPubController, :relay)
635 pipe_through(:http_signature)
636 post("/inbox", ActivityPubController, :inbox)
639 get("/following", ActivityPubController, :relay_following)
640 get("/followers", ActivityPubController, :relay_followers)
643 scope "/internal/fetch", Pleroma.Web.ActivityPub do
644 pipe_through(:ap_service_actor)
646 get("/", ActivityPubController, :internal_fetch)
647 post("/inbox", ActivityPubController, :inbox)
650 scope "/.well-known", Pleroma.Web do
651 pipe_through(:well_known)
653 get("/host-meta", WebFinger.WebFingerController, :host_meta)
654 get("/webfinger", WebFinger.WebFingerController, :webfinger)
655 get("/nodeinfo", Nodeinfo.NodeinfoController, :schemas)
658 scope "/nodeinfo", Pleroma.Web do
659 get("/:version", Nodeinfo.NodeinfoController, :nodeinfo)
662 scope "/", Pleroma.Web do
665 get("/web/manifest.json", MastoFEController, :manifest)
668 scope "/", Pleroma.Web do
669 pipe_through(:mastodon_html)
671 get("/web/login", MastodonAPI.AuthController, :login)
672 delete("/auth/sign_out", MastodonAPI.AuthController, :logout)
674 post("/auth/password", MastodonAPI.AuthController, :password_reset)
676 get("/web/*path", MastoFEController, :index)
678 get("/embed/:id", EmbedController, :show)
681 scope "/proxy/", Pleroma.Web.MediaProxy do
682 get("/preview/:sig/:url", MediaProxyController, :preview)
683 get("/preview/:sig/:url/:filename", MediaProxyController, :preview)
684 get("/:sig/:url", MediaProxyController, :remote)
685 get("/:sig/:url/:filename", MediaProxyController, :remote)
688 if Pleroma.Config.get(:env) == :dev do
690 pipe_through([:mailbox_preview])
692 forward("/mailbox", Plug.Swoosh.MailboxPreview, base_path: "/dev/mailbox")
696 # Test-only routes needed to test action dispatching and plug chain execution
697 if Pleroma.Config.get(:env) == :test do
700 :fallback_oauth_check,
702 :fallback_oauth_skip_publicity_check,
703 :skip_oauth_skip_publicity_check,
704 :missing_oauth_check_definition
707 scope "/test/api", Pleroma.Tests do
710 for action <- @test_actions do
711 get("/#{action}", AuthTestController, action)
715 scope "/test/authenticated_api", Pleroma.Tests do
716 pipe_through(:authenticated_api)
718 for action <- @test_actions do
719 get("/#{action}", AuthTestController, action)
724 scope "/", Pleroma.Web.MongooseIM do
725 get("/user_exists", MongooseIMController, :user_exists)
726 get("/check_password", MongooseIMController, :check_password)
729 scope "/", Fallback do
730 get("/registration/:token", RedirectController, :registration_page)
731 get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
732 get("/api*path", RedirectController, :api_not_implemented)
733 get("/*path", RedirectController, :redirector_with_preload)
735 options("/*path", RedirectController, :empty)