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 put("/users/tag", AdminAPIController, :tag_users)
142 delete("/users/tag", AdminAPIController, :untag_users)
144 get("/users/:nickname/permission_group", AdminAPIController, :right_get)
145 get("/users/:nickname/permission_group/:permission_group", AdminAPIController, :right_get)
147 post("/users/:nickname/permission_group/:permission_group", AdminAPIController, :right_add)
150 "/users/:nickname/permission_group/:permission_group",
155 post("/users/permission_group/:permission_group", AdminAPIController, :right_add_multiple)
158 "/users/permission_group/:permission_group",
160 :right_delete_multiple
163 get("/relay", RelayController, :index)
164 post("/relay", RelayController, :follow)
165 delete("/relay", RelayController, :unfollow)
167 post("/users/invite_token", InviteController, :create)
168 get("/users/invites", InviteController, :index)
169 post("/users/revoke_invite", InviteController, :revoke)
170 post("/users/email_invite", InviteController, :email)
172 get("/users/:nickname/password_reset", AdminAPIController, :get_password_reset)
173 patch("/users/force_password_reset", AdminAPIController, :force_password_reset)
174 get("/users/:nickname/credentials", AdminAPIController, :show_user_credentials)
175 patch("/users/:nickname/credentials", AdminAPIController, :update_user_credentials)
177 get("/users", AdminAPIController, :list_users)
178 get("/users/:nickname", AdminAPIController, :user_show)
179 get("/users/:nickname/statuses", AdminAPIController, :list_user_statuses)
181 get("/instances/:instance/statuses", AdminAPIController, :list_instance_statuses)
183 patch("/users/confirm_email", AdminAPIController, :confirm_email)
184 patch("/users/resend_confirmation_email", AdminAPIController, :resend_confirmation_email)
186 get("/reports", ReportController, :index)
187 get("/reports/:id", ReportController, :show)
188 patch("/reports", ReportController, :update)
189 post("/reports/:id/notes", ReportController, :notes_create)
190 delete("/reports/:report_id/notes/:id", ReportController, :notes_delete)
192 get("/statuses/:id", StatusController, :show)
193 put("/statuses/:id", StatusController, :update)
194 delete("/statuses/:id", StatusController, :delete)
195 get("/statuses", StatusController, :index)
197 get("/config", ConfigController, :show)
198 post("/config", ConfigController, :update)
199 get("/config/descriptions", ConfigController, :descriptions)
200 get("/need_reboot", AdminAPIController, :need_reboot)
201 get("/restart", AdminAPIController, :restart)
203 get("/moderation_log", AdminAPIController, :list_log)
205 post("/reload_emoji", AdminAPIController, :reload_emoji)
206 get("/stats", AdminAPIController, :stats)
208 get("/oauth_app", OAuthAppController, :index)
209 post("/oauth_app", OAuthAppController, :create)
210 patch("/oauth_app/:id", OAuthAppController, :update)
211 delete("/oauth_app/:id", OAuthAppController, :delete)
213 get("/media_proxy_caches", MediaProxyCacheController, :index)
214 post("/media_proxy_caches/delete", MediaProxyCacheController, :delete)
215 post("/media_proxy_caches/purge", MediaProxyCacheController, :purge)
218 scope "/api/pleroma/emoji", Pleroma.Web.PleromaAPI do
221 pipe_through(:admin_api)
223 get("/import", EmojiPackController, :import_from_filesystem)
224 get("/remote", EmojiPackController, :remote)
225 post("/download", EmojiPackController, :download)
227 post("/:name", EmojiPackController, :create)
228 patch("/:name", EmojiPackController, :update)
229 delete("/:name", EmojiPackController, :delete)
231 post("/:name/files", EmojiPackController, :add_file)
232 patch("/:name/files", EmojiPackController, :update_file)
233 delete("/:name/files", EmojiPackController, :delete_file)
236 # Pack info / downloading
239 get("/", EmojiPackController, :index)
240 get("/:name", EmojiPackController, :show)
241 get("/:name/archive", EmojiPackController, :archive)
245 scope "/", Pleroma.Web.TwitterAPI do
246 pipe_through(:pleroma_html)
248 post("/main/ostatus", UtilController, :remote_subscribe)
249 get("/ostatus_subscribe", RemoteFollowController, :follow)
251 post("/ostatus_subscribe", RemoteFollowController, :do_follow)
254 scope "/api/pleroma", Pleroma.Web.TwitterAPI do
255 pipe_through(:authenticated_api)
257 post("/change_email", UtilController, :change_email)
258 post("/change_password", UtilController, :change_password)
259 post("/delete_account", UtilController, :delete_account)
260 put("/notification_settings", UtilController, :update_notificaton_settings)
261 post("/disable_account", UtilController, :disable_account)
263 post("/blocks_import", UtilController, :blocks_import)
264 post("/follow_import", UtilController, :follow_import)
267 scope "/api/pleroma", Pleroma.Web.PleromaAPI do
268 pipe_through(:authenticated_api)
270 get("/accounts/mfa", TwoFactorAuthenticationController, :settings)
271 get("/accounts/mfa/backup_codes", TwoFactorAuthenticationController, :backup_codes)
272 get("/accounts/mfa/setup/:method", TwoFactorAuthenticationController, :setup)
273 post("/accounts/mfa/confirm/:method", TwoFactorAuthenticationController, :confirm)
274 delete("/accounts/mfa/:method", TwoFactorAuthenticationController, :disable)
277 scope "/oauth", Pleroma.Web.OAuth do
280 get("/authorize", OAuthController, :authorize)
283 post("/authorize", OAuthController, :create_authorization)
284 post("/token", OAuthController, :token_exchange)
285 post("/revoke", OAuthController, :token_revoke)
286 get("/registration_details", OAuthController, :registration_details)
288 post("/mfa/challenge", MFAController, :challenge)
289 post("/mfa/verify", MFAController, :verify, as: :mfa_verify)
290 get("/mfa", MFAController, :show)
293 pipe_through(:browser)
295 get("/prepare_request", OAuthController, :prepare_request)
296 get("/:provider", OAuthController, :request)
297 get("/:provider/callback", OAuthController, :callback)
298 post("/register", OAuthController, :register)
302 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
305 get("/statuses/:id/reactions/:emoji", EmojiReactionController, :index)
306 get("/statuses/:id/reactions", EmojiReactionController, :index)
309 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
311 pipe_through(:authenticated_api)
313 post("/chats/by-account-id/:id", ChatController, :create)
314 get("/chats", ChatController, :index)
315 get("/chats/:id", ChatController, :show)
316 get("/chats/:id/messages", ChatController, :messages)
317 post("/chats/:id/messages", ChatController, :post_chat_message)
318 delete("/chats/:id/messages/:message_id", ChatController, :delete_message)
319 post("/chats/:id/read", ChatController, :mark_as_read)
320 post("/chats/:id/messages/:message_id/read", ChatController, :mark_message_as_read)
322 get("/conversations/:id/statuses", ConversationController, :statuses)
323 get("/conversations/:id", ConversationController, :show)
324 post("/conversations/read", ConversationController, :mark_as_read)
325 patch("/conversations/:id", ConversationController, :update)
327 put("/statuses/:id/reactions/:emoji", EmojiReactionController, :create)
328 delete("/statuses/:id/reactions/:emoji", EmojiReactionController, :delete)
329 post("/notifications/read", NotificationController, :mark_as_read)
331 patch("/accounts/update_avatar", AccountController, :update_avatar)
332 patch("/accounts/update_banner", AccountController, :update_banner)
333 patch("/accounts/update_background", AccountController, :update_background)
335 get("/mascot", MascotController, :show)
336 put("/mascot", MascotController, :update)
338 post("/scrobble", ScrobbleController, :create)
343 get("/accounts/:id/favourites", AccountController, :favourites)
347 pipe_through(:authenticated_api)
349 post("/accounts/:id/subscribe", AccountController, :subscribe)
350 post("/accounts/:id/unsubscribe", AccountController, :unsubscribe)
353 post("/accounts/confirmation_resend", AccountController, :confirmation_resend)
356 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
358 get("/accounts/:id/scrobbles", ScrobbleController, :index)
361 scope "/api/v1", Pleroma.Web.MastodonAPI do
362 pipe_through(:authenticated_api)
364 get("/accounts/verify_credentials", AccountController, :verify_credentials)
365 patch("/accounts/update_credentials", AccountController, :update_credentials)
367 get("/accounts/relationships", AccountController, :relationships)
368 get("/accounts/:id/lists", AccountController, :lists)
369 get("/accounts/:id/identity_proofs", AccountController, :identity_proofs)
370 get("/endorsements", AccountController, :endorsements)
371 get("/blocks", AccountController, :blocks)
372 get("/mutes", AccountController, :mutes)
374 post("/follows", AccountController, :follow_by_uri)
375 post("/accounts/:id/follow", AccountController, :follow)
376 post("/accounts/:id/unfollow", AccountController, :unfollow)
377 post("/accounts/:id/block", AccountController, :block)
378 post("/accounts/:id/unblock", AccountController, :unblock)
379 post("/accounts/:id/mute", AccountController, :mute)
380 post("/accounts/:id/unmute", AccountController, :unmute)
382 get("/apps/verify_credentials", AppController, :verify_credentials)
384 get("/conversations", ConversationController, :index)
385 post("/conversations/:id/read", ConversationController, :mark_as_read)
387 get("/domain_blocks", DomainBlockController, :index)
388 post("/domain_blocks", DomainBlockController, :create)
389 delete("/domain_blocks", DomainBlockController, :delete)
391 get("/filters", FilterController, :index)
393 post("/filters", FilterController, :create)
394 get("/filters/:id", FilterController, :show)
395 put("/filters/:id", FilterController, :update)
396 delete("/filters/:id", FilterController, :delete)
398 get("/follow_requests", FollowRequestController, :index)
399 post("/follow_requests/:id/authorize", FollowRequestController, :authorize)
400 post("/follow_requests/:id/reject", FollowRequestController, :reject)
402 get("/lists", ListController, :index)
403 get("/lists/:id", ListController, :show)
404 get("/lists/:id/accounts", ListController, :list_accounts)
406 delete("/lists/:id", ListController, :delete)
407 post("/lists", ListController, :create)
408 put("/lists/:id", ListController, :update)
409 post("/lists/:id/accounts", ListController, :add_to_list)
410 delete("/lists/:id/accounts", ListController, :remove_from_list)
412 get("/markers", MarkerController, :index)
413 post("/markers", MarkerController, :upsert)
415 post("/media", MediaController, :create)
416 get("/media/:id", MediaController, :show)
417 put("/media/:id", MediaController, :update)
419 get("/notifications", NotificationController, :index)
420 get("/notifications/:id", NotificationController, :show)
422 post("/notifications/:id/dismiss", NotificationController, :dismiss)
423 post("/notifications/clear", NotificationController, :clear)
424 delete("/notifications/destroy_multiple", NotificationController, :destroy_multiple)
425 # Deprecated: was removed in Mastodon v3, use `/notifications/:id/dismiss` instead
426 post("/notifications/dismiss", NotificationController, :dismiss_via_body)
428 post("/polls/:id/votes", PollController, :vote)
430 post("/reports", ReportController, :create)
432 get("/scheduled_statuses", ScheduledActivityController, :index)
433 get("/scheduled_statuses/:id", ScheduledActivityController, :show)
435 put("/scheduled_statuses/:id", ScheduledActivityController, :update)
436 delete("/scheduled_statuses/:id", ScheduledActivityController, :delete)
438 # Unlike `GET /api/v1/accounts/:id/favourites`, demands authentication
439 get("/favourites", StatusController, :favourites)
440 get("/bookmarks", StatusController, :bookmarks)
442 post("/statuses", StatusController, :create)
443 delete("/statuses/:id", StatusController, :delete)
444 post("/statuses/:id/reblog", StatusController, :reblog)
445 post("/statuses/:id/unreblog", StatusController, :unreblog)
446 post("/statuses/:id/favourite", StatusController, :favourite)
447 post("/statuses/:id/unfavourite", StatusController, :unfavourite)
448 post("/statuses/:id/pin", StatusController, :pin)
449 post("/statuses/:id/unpin", StatusController, :unpin)
450 post("/statuses/:id/bookmark", StatusController, :bookmark)
451 post("/statuses/:id/unbookmark", StatusController, :unbookmark)
452 post("/statuses/:id/mute", StatusController, :mute_conversation)
453 post("/statuses/:id/unmute", StatusController, :unmute_conversation)
455 post("/push/subscription", SubscriptionController, :create)
456 get("/push/subscription", SubscriptionController, :show)
457 put("/push/subscription", SubscriptionController, :update)
458 delete("/push/subscription", SubscriptionController, :delete)
460 get("/suggestions", SuggestionController, :index)
462 get("/timelines/home", TimelineController, :home)
463 get("/timelines/direct", TimelineController, :direct)
464 get("/timelines/list/:list_id", TimelineController, :list)
467 scope "/api/web", Pleroma.Web do
468 pipe_through(:authenticated_api)
470 # Backend-obscure settings blob for MastoFE, don't parse/reuse elsewhere
471 put("/settings", MastoFEController, :put_settings)
474 scope "/api/v1", Pleroma.Web.MastodonAPI do
477 get("/accounts/search", SearchController, :account_search)
478 get("/search", SearchController, :search)
480 get("/accounts/:id/statuses", AccountController, :statuses)
481 get("/accounts/:id/followers", AccountController, :followers)
482 get("/accounts/:id/following", AccountController, :following)
483 get("/accounts/:id", AccountController, :show)
485 post("/accounts", AccountController, :create)
487 get("/instance", InstanceController, :show)
488 get("/instance/peers", InstanceController, :peers)
490 post("/apps", AppController, :create)
492 get("/statuses", StatusController, :index)
493 get("/statuses/:id", StatusController, :show)
494 get("/statuses/:id/context", StatusController, :context)
495 get("/statuses/:id/card", StatusController, :card)
496 get("/statuses/:id/favourited_by", StatusController, :favourited_by)
497 get("/statuses/:id/reblogged_by", StatusController, :reblogged_by)
499 get("/custom_emojis", CustomEmojiController, :index)
501 get("/trends", MastodonAPIController, :empty_array)
503 get("/timelines/public", TimelineController, :public)
504 get("/timelines/tag/:tag", TimelineController, :hashtag)
506 get("/polls/:id", PollController, :show)
509 scope "/api/v2", Pleroma.Web.MastodonAPI do
511 get("/search", SearchController, :search2)
513 post("/media", MediaController, :create2)
516 scope "/api", Pleroma.Web do
517 pipe_through(:config)
519 get("/help/test", TwitterAPI.UtilController, :help_test)
520 post("/help/test", TwitterAPI.UtilController, :help_test)
521 get("/statusnet/config", TwitterAPI.UtilController, :config)
522 get("/statusnet/version", TwitterAPI.UtilController, :version)
523 get("/pleroma/frontend_configurations", TwitterAPI.UtilController, :frontend_configurations)
526 scope "/api", Pleroma.Web do
530 "/account/confirm_email/:user_id/:token",
531 TwitterAPI.Controller,
538 pipe_through(:base_api)
540 get("/openapi", OpenApiSpex.Plug.RenderSpec, [])
543 scope "/api", Pleroma.Web, as: :authenticated_twitter_api do
544 pipe_through(:authenticated_api)
546 get("/oauth_tokens", TwitterAPI.Controller, :oauth_tokens)
547 delete("/oauth_tokens/:id", TwitterAPI.Controller, :revoke_token)
550 "/qvitter/statuses/notifications/read",
551 TwitterAPI.Controller,
552 :mark_notifications_as_read
557 plug(:accepts, ["html", "xml", "rss", "atom", "activity+json", "json"])
558 plug(Pleroma.Plugs.StaticFEPlug)
562 plug(:accepts, ["json", "xml"])
565 scope "/", Pleroma.Web do
566 pipe_through([:ostatus, :http_signature])
568 get("/objects/:uuid", OStatus.OStatusController, :object)
569 get("/activities/:uuid", OStatus.OStatusController, :activity)
570 get("/notice/:id", OStatus.OStatusController, :notice)
571 get("/notice/:id/embed_player", OStatus.OStatusController, :notice_player)
573 # Mastodon compatibility routes
574 get("/users/:nickname/statuses/:id", OStatus.OStatusController, :object)
575 get("/users/:nickname/statuses/:id/activity", OStatus.OStatusController, :activity)
577 get("/users/:nickname/feed", Feed.UserController, :feed, as: :user_feed)
578 get("/users/:nickname", Feed.UserController, :feed_redirect, as: :user_feed)
580 get("/tags/:tag", Feed.TagController, :feed, as: :tag_feed)
583 scope "/", Pleroma.Web do
584 pipe_through(:browser)
585 get("/mailer/unsubscribe/:token", Mailer.SubscriptionController, :unsubscribe)
588 pipeline :ap_service_actor do
589 plug(:accepts, ["activity+json", "json"])
592 # Server to Server (S2S) AP interactions
593 pipeline :activitypub do
594 plug(:ap_service_actor)
595 plug(:http_signature)
598 # Client to Server (C2S) AP interactions
599 pipeline :activitypub_client do
600 plug(:ap_service_actor)
606 scope "/", Pleroma.Web.ActivityPub do
607 pipe_through([:activitypub_client])
609 get("/api/ap/whoami", ActivityPubController, :whoami)
610 get("/users/:nickname/inbox", ActivityPubController, :read_inbox)
612 get("/users/:nickname/outbox", ActivityPubController, :outbox)
613 post("/users/:nickname/outbox", ActivityPubController, :update_outbox)
614 post("/api/ap/upload_media", ActivityPubController, :upload_media)
616 # The following two are S2S as well, see `ActivityPub.fetch_follow_information_for_user/1`:
617 get("/users/:nickname/followers", ActivityPubController, :followers)
618 get("/users/:nickname/following", ActivityPubController, :following)
621 scope "/", Pleroma.Web.ActivityPub do
622 pipe_through(:activitypub)
623 post("/inbox", ActivityPubController, :inbox)
624 post("/users/:nickname/inbox", ActivityPubController, :inbox)
627 scope "/relay", Pleroma.Web.ActivityPub do
628 pipe_through(:ap_service_actor)
630 get("/", ActivityPubController, :relay)
633 pipe_through(:http_signature)
634 post("/inbox", ActivityPubController, :inbox)
637 get("/following", ActivityPubController, :relay_following)
638 get("/followers", ActivityPubController, :relay_followers)
641 scope "/internal/fetch", Pleroma.Web.ActivityPub do
642 pipe_through(:ap_service_actor)
644 get("/", ActivityPubController, :internal_fetch)
645 post("/inbox", ActivityPubController, :inbox)
648 scope "/.well-known", Pleroma.Web do
649 pipe_through(:well_known)
651 get("/host-meta", WebFinger.WebFingerController, :host_meta)
652 get("/webfinger", WebFinger.WebFingerController, :webfinger)
653 get("/nodeinfo", Nodeinfo.NodeinfoController, :schemas)
656 scope "/nodeinfo", Pleroma.Web do
657 get("/:version", Nodeinfo.NodeinfoController, :nodeinfo)
660 scope "/", Pleroma.Web do
663 get("/web/manifest.json", MastoFEController, :manifest)
666 scope "/", Pleroma.Web do
667 pipe_through(:mastodon_html)
669 get("/web/login", MastodonAPI.AuthController, :login)
670 delete("/auth/sign_out", MastodonAPI.AuthController, :logout)
672 post("/auth/password", MastodonAPI.AuthController, :password_reset)
674 get("/web/*path", MastoFEController, :index)
676 get("/embed/:id", EmbedController, :show)
679 scope "/proxy/", Pleroma.Web.MediaProxy do
680 get("/:sig/:url", MediaProxyController, :remote)
681 get("/:sig/:url/:filename", MediaProxyController, :remote)
684 if Pleroma.Config.get(:env) == :dev do
686 pipe_through([:mailbox_preview])
688 forward("/mailbox", Plug.Swoosh.MailboxPreview, base_path: "/dev/mailbox")
692 # Test-only routes needed to test action dispatching and plug chain execution
693 if Pleroma.Config.get(:env) == :test do
696 :fallback_oauth_check,
698 :fallback_oauth_skip_publicity_check,
699 :skip_oauth_skip_publicity_check,
700 :missing_oauth_check_definition
703 scope "/test/api", Pleroma.Tests do
706 for action <- @test_actions do
707 get("/#{action}", AuthTestController, action)
711 scope "/test/authenticated_api", Pleroma.Tests do
712 pipe_through(:authenticated_api)
714 for action <- @test_actions do
715 get("/#{action}", AuthTestController, action)
720 scope "/", Pleroma.Web.MongooseIM do
721 get("/user_exists", MongooseIMController, :user_exists)
722 get("/check_password", MongooseIMController, :check_password)
725 scope "/", Fallback do
726 get("/registration/:token", RedirectController, :registration_page)
727 get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
728 get("/api*path", RedirectController, :api_not_implemented)
729 get("/*path", RedirectController, :redirector_with_preload)
731 options("/*path", RedirectController, :empty)