diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-08-18 18:02:09 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-08-18 18:02:09 +0300 |
commit | 27e7999a151d8068ec503c9a25aff352f4d31068 (patch) | |
tree | c6de5995748aee92878514c7a6e24c58f4641c2b /test/web/mastodon_api/controllers | |
parent | f50c653c8d63ce8fcffe62d70c61ab464e8e6c8e (diff) | |
parent | 8d70692abf64244e44ade5ef2055d1a586788dd1 (diff) | |
download | pleroma-27e7999a151d8068ec503c9a25aff352f4d31068.tar.gz pleroma-27e7999a151d8068ec503c9a25aff352f4d31068.zip |
Merge remote-tracking branch 'remotes/origin/develop' into 2168-media-preview-proxy
Diffstat (limited to 'test/web/mastodon_api/controllers')
-rw-r--r-- | test/web/mastodon_api/controllers/timeline_controller_test.exs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/timeline_controller_test.exs b/test/web/mastodon_api/controllers/timeline_controller_test.exs index 50e0d783d..71bac99f7 100644 --- a/test/web/mastodon_api/controllers/timeline_controller_test.exs +++ b/test/web/mastodon_api/controllers/timeline_controller_test.exs @@ -445,6 +445,23 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do assert length(json_response(res_conn, 200)) == 2 end + test "with default settings on private instances, returns 403 for unauthenticated users", %{ + conn: conn, + base_uri: base_uri, + error_response: error_response + } do + clear_config([:instance, :public], false) + clear_config([:restrict_unauthenticated, :timelines]) + + for local <- [true, false] do + res_conn = get(conn, "#{base_uri}?local=#{local}") + + assert json_response(res_conn, :unauthorized) == error_response + end + + ensure_authenticated_access(base_uri) + end + test "with `%{local: true, federated: true}`, returns 403 for unauthenticated users", %{ conn: conn, base_uri: base_uri, |