FederatingPlug module name
This commit is contained in:
parent
abc3c7689b
commit
8c993c5f63
|
@ -23,7 +23,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
|
||||||
alias Pleroma.Web.ActivityPub.Visibility
|
alias Pleroma.Web.ActivityPub.Visibility
|
||||||
alias Pleroma.Web.ControllerHelper
|
alias Pleroma.Web.ControllerHelper
|
||||||
alias Pleroma.Web.Endpoint
|
alias Pleroma.Web.Endpoint
|
||||||
alias Pleroma.Web.FederatingPlug
|
alias Pleroma.Web.Plugs.FederatingPlug
|
||||||
alias Pleroma.Web.Federator
|
alias Pleroma.Web.Federator
|
||||||
|
|
||||||
require Logger
|
require Logger
|
||||||
|
|
|
@ -17,7 +17,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
|
||||||
alias Pleroma.Web.Router
|
alias Pleroma.Web.Router
|
||||||
|
|
||||||
plug(Pleroma.Plugs.EnsureAuthenticatedPlug,
|
plug(Pleroma.Plugs.EnsureAuthenticatedPlug,
|
||||||
unless_func: &Pleroma.Web.FederatingPlug.federating?/1
|
unless_func: &Pleroma.Web.Plugs.FederatingPlug.federating?/1
|
||||||
)
|
)
|
||||||
|
|
||||||
plug(
|
plug(
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
defmodule Pleroma.Web.FederatingPlug do
|
defmodule Pleroma.Web.Plugs.FederatingPlug do
|
||||||
import Plug.Conn
|
import Plug.Conn
|
||||||
|
|
||||||
def init(options) do
|
def init(options) do
|
||||||
|
|
|
@ -18,7 +18,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
|
||||||
plug(:assign_id)
|
plug(:assign_id)
|
||||||
|
|
||||||
plug(Pleroma.Plugs.EnsureAuthenticatedPlug,
|
plug(Pleroma.Plugs.EnsureAuthenticatedPlug,
|
||||||
unless_func: &Pleroma.Web.FederatingPlug.federating?/1
|
unless_func: &Pleroma.Web.Plugs.FederatingPlug.federating?/1
|
||||||
)
|
)
|
||||||
|
|
||||||
@page_keys ["max_id", "min_id", "limit", "since_id", "order"]
|
@page_keys ["max_id", "min_id", "limit", "since_id", "order"]
|
||||||
|
|
|
@ -17,7 +17,7 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowController do
|
||||||
|
|
||||||
@status_types ["Article", "Event", "Note", "Video", "Page", "Question"]
|
@status_types ["Article", "Event", "Note", "Video", "Page", "Question"]
|
||||||
|
|
||||||
plug(Pleroma.Web.FederatingPlug)
|
plug(Pleroma.Web.Plugs.FederatingPlug)
|
||||||
|
|
||||||
# Note: follower can submit the form (with password auth) not being signed in (having no token)
|
# Note: follower can submit the form (with password auth) not being signed in (having no token)
|
||||||
plug(
|
plug(
|
||||||
|
|
|
@ -16,7 +16,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
||||||
alias Pleroma.Web.CommonAPI
|
alias Pleroma.Web.CommonAPI
|
||||||
alias Pleroma.Web.WebFinger
|
alias Pleroma.Web.WebFinger
|
||||||
|
|
||||||
plug(Pleroma.Web.FederatingPlug when action == :remote_subscribe)
|
plug(Pleroma.Web.Plugs.FederatingPlug when action == :remote_subscribe)
|
||||||
|
|
||||||
plug(
|
plug(
|
||||||
OAuthScopesPlug,
|
OAuthScopesPlug,
|
||||||
|
|
|
@ -8,7 +8,7 @@ defmodule Pleroma.Web.WebFinger.WebFingerController do
|
||||||
alias Pleroma.Web.WebFinger
|
alias Pleroma.Web.WebFinger
|
||||||
|
|
||||||
plug(Pleroma.Web.Plugs.SetFormatPlug)
|
plug(Pleroma.Web.Plugs.SetFormatPlug)
|
||||||
plug(Pleroma.Web.FederatingPlug)
|
plug(Pleroma.Web.Plugs.FederatingPlug)
|
||||||
|
|
||||||
def host_meta(conn, _params) do
|
def host_meta(conn, _params) do
|
||||||
xml = WebFinger.host_meta()
|
xml = WebFinger.host_meta()
|
||||||
|
|
|
@ -12,7 +12,7 @@ test "returns and halt the conn when federating is disabled" do
|
||||||
|
|
||||||
conn =
|
conn =
|
||||||
build_conn()
|
build_conn()
|
||||||
|> Pleroma.Web.FederatingPlug.call(%{})
|
|> Pleroma.Web.Plugs.FederatingPlug.call(%{})
|
||||||
|
|
||||||
assert conn.status == 404
|
assert conn.status == 404
|
||||||
assert conn.halted
|
assert conn.halted
|
||||||
|
@ -23,7 +23,7 @@ test "does nothing when federating is enabled" do
|
||||||
|
|
||||||
conn =
|
conn =
|
||||||
build_conn()
|
build_conn()
|
||||||
|> Pleroma.Web.FederatingPlug.call(%{})
|
|> Pleroma.Web.Plugs.FederatingPlug.call(%{})
|
||||||
|
|
||||||
refute conn.status
|
refute conn.status
|
||||||
refute conn.halted
|
refute conn.halted
|
||||||
|
|
Loading…
Reference in a new issue