EnsurePublicOrAuthenticatedPlug module name
authorAlexander Strizhakov <alex.strizhakov@gmail.com>
Wed, 24 Jun 2020 07:53:10 +0000 (10:53 +0300)
committerAlexander Strizhakov <alex.strizhakov@gmail.com>
Tue, 13 Oct 2020 13:43:57 +0000 (16:43 +0300)
16 files changed:
lib/pleroma/tests/auth_test_controller.ex
lib/pleroma/web.ex
lib/pleroma/web/masto_fe_controller.ex
lib/pleroma/web/mastodon_api/controllers/account_controller.ex
lib/pleroma/web/mastodon_api/controllers/app_controller.ex
lib/pleroma/web/mastodon_api/controllers/custom_emoji_controller.ex
lib/pleroma/web/mastodon_api/controllers/instance_controller.ex
lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
lib/pleroma/web/mastodon_api/controllers/status_controller.ex
lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex
lib/pleroma/web/o_auth/o_auth_controller.ex
lib/pleroma/web/pleroma_api/controllers/account_controller.ex
lib/pleroma/web/plugs/ensure_public_or_authenticated_plug.ex
lib/pleroma/web/plugs/expect_public_or_authenticated_check_plug.ex
lib/pleroma/web/twitter_api/controller.ex
test/pleroma/web/plugs/ensure_public_or_authenticated_plug_test.exs

index 296cae522b5e692cbecaf5033e5defd889aff98c..320df7e5ad43efcf119124a5dbd1b75db85bc489 100644 (file)
@@ -8,7 +8,7 @@ defmodule Pleroma.Tests.AuthTestController do
 
   use Pleroma.Web, :controller
 
 
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.User
 
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.User
 
index 34656c953282ba8bff8e1fe2b9af2ab86a1972e3..667ef67a80b3f7f0b442954007c288e164adc860 100644 (file)
@@ -21,7 +21,7 @@ defmodule Pleroma.Web do
   """
 
   alias Pleroma.Plugs.EnsureAuthenticatedPlug
   """
 
   alias Pleroma.Plugs.EnsureAuthenticatedPlug
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
   alias Pleroma.Web.Plugs.ExpectAuthenticatedCheckPlug
   alias Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.Plugs.ExpectAuthenticatedCheckPlug
   alias Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug
   alias Pleroma.Web.Plugs.OAuthScopesPlug
index 6e348db1441c3dd64a2af07bc37fdf16d2d0ddd0..8d99f8907ae3d691295535b82fbbac2d147429cf 100644 (file)
@@ -5,7 +5,7 @@
 defmodule Pleroma.Web.MastoFEController do
   use Pleroma.Web, :controller
 
 defmodule Pleroma.Web.MastoFEController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.User
 
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.User
 
index 518fa775c9802a2c1d20400c8e78732f60f2db05..1c8199504a41b4d913879cbef01a4fbdbb01baaf 100644 (file)
@@ -15,7 +15,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
     ]
 
   alias Pleroma.Maps
     ]
 
   alias Pleroma.Maps
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.Plugs.RateLimiter
   alias Pleroma.User
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.Plugs.RateLimiter
   alias Pleroma.User
index 098859cd3f84b5a9a26ff07a1c40cb24d9508628..ed2f92fa6dc0430762bb13cb8dcf2a226439d949 100644 (file)
@@ -5,7 +5,7 @@
 defmodule Pleroma.Web.MastodonAPI.AppController do
   use Pleroma.Web, :controller
 
 defmodule Pleroma.Web.MastodonAPI.AppController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Repo
   alias Pleroma.Web.OAuth.App
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Repo
   alias Pleroma.Web.OAuth.App
index 29f1fdb9a12891073afa36fdf2c08733a6c84578..872cb1f4de04986f2e0e2d6db15e57d9dca783b5 100644 (file)
@@ -9,7 +9,7 @@ defmodule Pleroma.Web.MastodonAPI.CustomEmojiController do
 
   plug(
     :skip_plug,
 
   plug(
     :skip_plug,
-    [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug]
+    [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]
     when action == :index
   )
 
     when action == :index
   )
 
index 1280f10cb43878c8da9f831bb02c05c9e17de952..07a32491a69322b5466672b5ee1ab56a785c7c26 100644 (file)
@@ -9,7 +9,7 @@ defmodule Pleroma.Web.MastodonAPI.InstanceController do
 
   plug(
     :skip_plug,
 
   plug(
     :skip_plug,
-    [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug]
+    [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]
     when action in [:show, :peers]
   )
 
     when action in [:show, :peers]
   )
 
index 12c99d8c841d37ab06deee7e838c056c4183d92a..9cf682c7b8a5dd163b35701ef805c2c8d927fffd 100644 (file)
@@ -17,7 +17,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
 
   plug(
     :skip_plug,
 
   plug(
     :skip_plug,
-    [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug]
+    [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]
     when action in [:empty_array, :empty_object]
   )
 
     when action in [:empty_array, :empty_object]
   )
 
index c160ac27d28610a68b3dd74232aa29df16cb190a..ec2605022d3f8905b5d4a5bdcc094e9d2ddda814 100644 (file)
@@ -25,7 +25,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
   alias Pleroma.Web.MastodonAPI.ScheduledActivityView
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
   alias Pleroma.Web.MastodonAPI.ScheduledActivityView
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
-  plug(:skip_plug, Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug when action in [:index, :show])
+
+  plug(
+    :skip_plug,
+    Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug when action in [:index, :show]
+  )
 
   @unauthenticated_access %{fallback: :proceed_unauthenticated, scopes: []}
 
 
   @unauthenticated_access %{fallback: :proceed_unauthenticated, scopes: []}
 
index 74a4bf689205f916e16a519140057e8e9b64ef27..834452dd6250ace304ef9e8c482f6c93d8bb4725 100644 (file)
@@ -10,7 +10,7 @@ defmodule Pleroma.Web.MastodonAPI.TimelineController do
 
   alias Pleroma.Config
   alias Pleroma.Pagination
 
   alias Pleroma.Config
   alias Pleroma.Pagination
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.Plugs.RateLimiter
   alias Pleroma.User
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.Plugs.RateLimiter
   alias Pleroma.User
index 65a2aa91b5e4dbbd4c952d8c1e5fa4c6b21793bd..7826170216c9ccc53df7fb2beb90e97880fd47cf 100644 (file)
@@ -33,7 +33,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
 
   plug(:skip_plug, [
     Pleroma.Web.Plugs.OAuthScopesPlug,
 
   plug(:skip_plug, [
     Pleroma.Web.Plugs.OAuthScopesPlug,
-    Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+    Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
   ])
 
   plug(RateLimiter, [name: :authentication] when action == :create_authorization)
   ])
 
   plug(RateLimiter, [name: :authentication] when action == :create_authorization)
index 8b9cf410f34d8cb011787ce7e8ee311290243739..90c63b4f5661bcd11b2ebedbd8c793ecc0af10e2 100644 (file)
@@ -8,7 +8,7 @@ defmodule Pleroma.Web.PleromaAPI.AccountController do
   import Pleroma.Web.ControllerHelper,
     only: [json_response: 3, add_link_headers: 2, assign_account_by_id: 2]
 
   import Pleroma.Web.ControllerHelper,
     only: [json_response: 3, add_link_headers: 2, assign_account_by_id: 2]
 
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.Plugs.RateLimiter
   alias Pleroma.User
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.Plugs.RateLimiter
   alias Pleroma.User
index 7265bb87aaa0a158f94c9da3dc16260fd1fa4d28..3bebdac6db6e983cfeeafe4a018f3db035fcca07 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug do
+defmodule Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug do
   import Pleroma.Web.TranslationHelpers
   import Plug.Conn
 
   import Pleroma.Web.TranslationHelpers
   import Plug.Conn
 
index d1b66efaebc938413e36170bd666a9f64a0eecfd..ace512a78625deac63c333f89f18a2ee67511701 100644 (file)
@@ -4,7 +4,7 @@
 
 defmodule Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug do
   @moduledoc """
 
 defmodule Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug do
   @moduledoc """
-  Marks `Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug` as expected to be executed later in plug
+  Marks `Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug` as expected to be executed later in plug
   chain.
 
   No-op plug which affects `Pleroma.Web` operation (is checked with `PlugHelper.plug_called?/2`).
   chain.
 
   No-op plug which affects `Pleroma.Web` operation (is checked with `PlugHelper.plug_called?/2`).
index 429d8013bc42cbca18fceafd5d421c07de8f732b..dc9c41f16359407d903f2525dc0b7fd05ebb81ef 100644 (file)
@@ -6,7 +6,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
   use Pleroma.Web, :controller
 
   alias Pleroma.Notification
   use Pleroma.Web, :controller
 
   alias Pleroma.Notification
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.OAuth.Token
   alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.OAuth.Token
index 9cd5bc715b8b2c74a9f24c4886357d945747f23f..a73175fa6f951ec674895b813bad7b51b3e9a5eb 100644 (file)
@@ -6,7 +6,7 @@ defmodule Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
   alias Pleroma.Config
   use Pleroma.Web.ConnCase, async: true
 
   alias Pleroma.Config
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
   alias Pleroma.User
 
   setup do: clear_config([:instance, :public])
   alias Pleroma.User
 
   setup do: clear_config([:instance, :public])