diff options
author | lain <lain@soykaf.club> | 2020-04-29 11:09:30 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-04-29 11:09:30 +0000 |
commit | 58fded9858edbeb318dc011cb313e82a86fbafcb (patch) | |
tree | 90539822a02e9ff1de91969ad179da907c031b4d /lib/pleroma/tests/oauth_test_controller.ex | |
parent | 699fc9569fa06278baaec6804348375cb9891185 (diff) | |
parent | 4c0e53367acd74de04de070a5e33380f5e457163 (diff) | |
download | pleroma-58fded9858edbeb318dc011cb313e82a86fbafcb.tar.gz |
Merge branch 'automatic-authentication-and-instance-publicity-checks' into 'develop'
Automatic checks of authentication / authorization / instance publicity
See merge request pleroma/pleroma!2409
Diffstat (limited to 'lib/pleroma/tests/oauth_test_controller.ex')
-rw-r--r-- | lib/pleroma/tests/oauth_test_controller.ex | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/pleroma/tests/oauth_test_controller.ex b/lib/pleroma/tests/oauth_test_controller.ex deleted file mode 100644 index 58d517f78..000000000 --- a/lib/pleroma/tests/oauth_test_controller.ex +++ /dev/null @@ -1,31 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/> -# SPDX-License-Identifier: AGPL-3.0-only - -# A test controller reachable only in :test env. -# Serves to test OAuth scopes check skipping / enforcement. -defmodule Pleroma.Tests.OAuthTestController do - @moduledoc false - - use Pleroma.Web, :controller - - alias Pleroma.Plugs.OAuthScopesPlug - - plug(:skip_plug, OAuthScopesPlug when action == :skipped_oauth) - - plug(OAuthScopesPlug, %{scopes: ["read"]} when action != :missed_oauth) - - def skipped_oauth(conn, _params) do - noop(conn) - end - - def performed_oauth(conn, _params) do - noop(conn) - end - - def missed_oauth(conn, _params) do - noop(conn) - end - - defp noop(conn), do: json(conn, %{}) -end |