diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-04-30 13:52:07 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-04-30 13:52:07 +0400 |
commit | 9c1adb35dea9a4e86b68b98558b85de7210d563e (patch) | |
tree | 87f74883eb4f5cd07dd8fa363dcddc473524714f /lib/pleroma/tests/oauth_test_controller.ex | |
parent | 5238ae3dd3bfba9ff84d5f47e2419227fc7c5d9a (diff) | |
parent | dae91630606d6ba408b3f340b6b450703c164ce1 (diff) | |
download | pleroma-9c1adb35dea9a4e86b68b98558b85de7210d563e.tar.gz |
Merge branch 'develop' into openapi/notifications
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 |