Add task for filtering non-whitelisted configs
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
parent
f0669997d3
commit
b66b93a94a
4 changed files with 90 additions and 1 deletions
|
|
@ -329,5 +329,23 @@ defmodule Mix.Tasks.Pleroma.ConfigTest do
|
|||
|
||||
assert config_records() == []
|
||||
end
|
||||
|
||||
test "filters non-whitelisted settings" do
|
||||
clear_config(:database_config_whitelist, [
|
||||
{:pleroma},
|
||||
{:web_push_encryption, :vapid_details}
|
||||
])
|
||||
|
||||
insert_config_record(:web_push_encryption, :non_whitelisted_key, a: 1)
|
||||
insert_config_record(:web_push_encryption, :vapid_details, b: 1)
|
||||
|
||||
MixTask.run(["filter_whitelisted", "--force"])
|
||||
|
||||
assert [
|
||||
%ConfigDB{group: :pleroma, key: :instance},
|
||||
%ConfigDB{group: :pleroma, key: Pleroma.Captcha},
|
||||
%ConfigDB{group: :web_push_encryption, key: :vapid_details}
|
||||
] = config_records()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue