diff options
| author | lain <lain@soykaf.club> | 2020-08-17 12:26:53 +0000 |
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-08-17 12:26:53 +0000 |
| commit | e154fcf5258879c68fd7bd9fddd56d3dcb787826 (patch) | |
| tree | 49baeee246b7493acbbeb9dc112488cbac4b69ea /test/web/mastodon_api/controllers | |
| parent | 1f2aad6fda22a3af8b475b5e4a01eae95a3438da (diff) | |
| parent | 60ac83a4c196233ed13c3da9ca296b0a4224e9a3 (diff) | |
| download | pleroma-e154fcf5258879c68fd7bd9fddd56d3dcb787826.tar.gz pleroma-e154fcf5258879c68fd7bd9fddd56d3dcb787826.zip | |
Merge branch '2046-default-restrict-unauthenticated-basing-on-instance-privacy' into 'develop'
[#2046] Defaulted pleroma/restrict_unauthenticated basing on instance privacy
Closes #2046
See merge request pleroma/pleroma!2890
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, |
