瀏覽代碼

Fix compile cycle in Pleroma.Tests.AuthTestController

elixir-1.11-ci
Alex Gleason 3 年之前
父節點
當前提交
15e2aaa9f6
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 7211D1F99744FBB7
共有 1 個檔案被更改,包括 2 行新增10 行删除
  1. +2
    -10
      lib/pleroma/tests/auth_test_controller.ex

+ 2
- 10
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)


Loading…
取消
儲存