diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-07-13 22:47:47 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-07-13 22:47:47 -0500 |
commit | deb3f911366925bcc342a4a0deb44a2e7da7f1ba (patch) | |
tree | c8e587198f64c4c5f991a05561943c6bd0af465b /lib/pleroma/tests | |
parent | 5e88796784e0ac2dbf57d9cf954fdc8ae8aeae43 (diff) | |
parent | 173e977e283789a814278c63bc81f40a13942e21 (diff) | |
download | pleroma-deb3f911366925bcc342a4a0deb44a2e7da7f1ba.tar.gz |
Merge remote-tracking branch 'pleroma/develop' into admin-api-users-sort
Diffstat (limited to 'lib/pleroma/tests')
-rw-r--r-- | lib/pleroma/tests/auth_test_controller.ex | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/pleroma/tests/auth_test_controller.ex b/lib/pleroma/tests/auth_test_controller.ex index ddf3fea4f..76514948b 100644 --- a/lib/pleroma/tests/auth_test_controller.ex +++ b/lib/pleroma/tests/auth_test_controller.ex @@ -9,7 +9,6 @@ defmodule Pleroma.Tests.AuthTestController do use Pleroma.Web, :controller alias Pleroma.User - alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug alias Pleroma.Web.Plugs.OAuthScopesPlug # Serves only with proper OAuth token (:api and :authenticated_api) @@ -47,10 +46,7 @@ defmodule Pleroma.Tests.AuthTestController do # Via :authenticated_api, serves if token is present and has requested scopes # # Suggested use: as :fallback_oauth_check but open with nil :user for :api on private instances - plug( - :skip_plug, - EnsurePublicOrAuthenticatedPlug when action == :fallback_oauth_skip_publicity_check - ) + plug(:skip_public_check when action == :fallback_oauth_skip_publicity_check) plug( OAuthScopesPlug, @@ -62,11 +58,7 @@ defmodule Pleroma.Tests.AuthTestController do # Via :authenticated_api, serves if :user is set (regardless of token presence and its scopes) # # Suggested use: making an :api endpoint always accessible (e.g. email confirmation endpoint) - plug( - :skip_plug, - [OAuthScopesPlug, EnsurePublicOrAuthenticatedPlug] - when action == :skip_oauth_skip_publicity_check - ) + plug(:skip_auth when action == :skip_oauth_skip_publicity_check) # Via :authenticated_api, always fails with 403 (endpoint is insecure) # Via :api, drops :user if present and serves if public (private instance rejects on no user) |