diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-04-17 21:21:10 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-05-01 01:00:37 +0300 |
commit | 862d4886c9c600ff0ff85edc744e3c05a3fcd68d (patch) | |
tree | 6633381b6d96fdd3b3773c1980eea5b2dfa76a5f /test/plugs/legacy_authentication_plug_test.exs | |
parent | da4923f2e59aac7f97812a756593602083f17626 (diff) | |
download | pleroma-862d4886c9c600ff0ff85edc744e3c05a3fcd68d.tar.gz pleroma-862d4886c9c600ff0ff85edc744e3c05a3fcd68d.zip |
[#1682] Fixed Basic Auth permissions issue by disabling OAuth scopes checks when password is provided. Refactored plugs skipping functionality.
Diffstat (limited to 'test/plugs/legacy_authentication_plug_test.exs')
-rw-r--r-- | test/plugs/legacy_authentication_plug_test.exs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/plugs/legacy_authentication_plug_test.exs b/test/plugs/legacy_authentication_plug_test.exs index 7559de7d3..3b8c07627 100644 --- a/test/plugs/legacy_authentication_plug_test.exs +++ b/test/plugs/legacy_authentication_plug_test.exs @@ -8,6 +8,8 @@ defmodule Pleroma.Plugs.LegacyAuthenticationPlugTest do import Pleroma.Factory alias Pleroma.Plugs.LegacyAuthenticationPlug + alias Pleroma.Plugs.OAuthScopesPlug + alias Pleroma.Plugs.PlugHelper alias Pleroma.User setup do @@ -36,7 +38,8 @@ defmodule Pleroma.Plugs.LegacyAuthenticationPlugTest do end @tag :skip_on_mac - test "it authenticates the auth_user if present and password is correct and resets the password", + test "if `auth_user` is present and password is correct, " <> + "it authenticates the user, resets the password, marks OAuthScopesPlug as skipped", %{ conn: conn, user: user @@ -49,6 +52,7 @@ defmodule Pleroma.Plugs.LegacyAuthenticationPlugTest do conn = LegacyAuthenticationPlug.call(conn, %{}) assert conn.assigns.user.id == user.id + assert PlugHelper.plug_skipped?(conn, OAuthScopesPlug) end @tag :skip_on_mac |