ConfigController: Don't allow updating the whitelist
This commit is contained in:
parent
77a1d79f92
commit
0b871ff1f2
1 changed files with 25 additions and 0 deletions
|
|
@ -1220,6 +1220,31 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
|
|||
assert Application.get_env(:not_real, :anything) == "value6"
|
||||
end
|
||||
|
||||
test "doesn't allow updating the database_config_whitelist itself", %{conn: conn} do
|
||||
original_whitelist = Pleroma.Config.get(:database_config_whitelist)
|
||||
|
||||
refute ConfigDB.get_by_group_and_key(:pleroma, :database_config_whitelist)
|
||||
|
||||
conn =
|
||||
conn
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|> post("/api/pleroma/admin/config", %{
|
||||
configs: [
|
||||
%{
|
||||
group: ":pleroma",
|
||||
key: ":database_config_whitelist",
|
||||
value: [%{"tuple" => [":pleroma", ":key1"]}]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
%{"configs" => configs} = json_response_and_validate_schema(conn, 200)
|
||||
|
||||
assert configs == []
|
||||
assert Pleroma.Config.get(:database_config_whitelist) == original_whitelist
|
||||
refute ConfigDB.get_by_group_and_key(:pleroma, :database_config_whitelist)
|
||||
end
|
||||
|
||||
test "args for Pleroma.Upload.Filter.Mogrify with custom tuples", %{conn: conn} do
|
||||
assert conn
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue