|> ConfigDB.convert()
Enum.each(received_configs, fn %{"value" => value, "db" => db} ->
- assert db in [config1.key, config2.key, db_keys]
+ assert db in [[config1.key], [config2.key], db_keys]
assert value in [
ConfigDB.from_binary_with_convert(config1.value),
%{group: ":pleroma", key: ":key1", value: "value1"},
%{
group: ":ueberauth",
- key: "Ueberauth.Strategy.Twitter.OAuth",
+ key: "Ueberauth",
value: [%{"tuple" => [":consumer_secret", "aaaa"]}]
},
%{
%{
"group" => ":pleroma",
"key" => ":key1",
- "value" => "value1"
+ "value" => "value1",
+ "db" => [":key1"]
},
%{
"group" => ":ueberauth",
- "key" => "Ueberauth.Strategy.Twitter.OAuth",
- "value" => [%{"tuple" => [":consumer_secret", "aaaa"]}]
+ "key" => "Ueberauth",
+ "value" => [%{"tuple" => [":consumer_secret", "aaaa"]}],
+ "db" => [":consumer_secret"]
},
%{
"group" => ":pleroma",
%{":nested_22" => "nested_value222"},
%{":nested_33" => %{":nested_44" => "nested_444"}}
]
- }
+ },
+ "db" => [":key2"]
},
%{
"group" => ":pleroma",
"value" => [
%{"nested_3" => ":nested_3", "nested_33" => "nested_33"},
%{"nested_4" => true}
- ]
+ ],
+ "db" => [":key3"]
},
%{
"group" => ":pleroma",
"key" => ":key4",
- "value" => %{"endpoint" => "https://example.com", ":nested_5" => ":upload"}
+ "value" => %{"endpoint" => "https://example.com", ":nested_5" => ":upload"},
+ "db" => [":key4"]
},
%{
"group" => ":idna",
"key" => ":key5",
- "value" => %{"tuple" => ["string", "Pleroma.Captcha.NotReal", []]}
+ "value" => %{"tuple" => ["string", "Pleroma.Captcha.NotReal", []]},
+ "db" => [":key5"]
}
]
}
assert json_response(conn, 200) == %{
"configs" => [
- %{"group" => ":quack", "key" => ":level", "value" => ":info"},
- %{"group" => ":quack", "key" => ":meta", "value" => [":none"]},
+ %{
+ "group" => ":quack",
+ "key" => ":level",
+ "value" => ":info",
+ "db" => [":level"]
+ },
+ %{
+ "group" => ":quack",
+ "key" => ":meta",
+ "value" => [":none"],
+ "db" => [":meta"]
+ },
%{
"group" => ":quack",
"key" => ":webhook_url",
- "value" => "https://hooks.slack.com/services/KEY"
+ "value" => "https://hooks.slack.com/services/KEY",
+ "db" => [":webhook_url"]
}
]
}
%{"tuple" => [":key1", 1]},
%{"tuple" => [":key2", 2]},
%{"tuple" => [":key3", 3]}
- ]
+ ],
+ "db" => [":key1", ":key2", ":key3"]
}
]
}
]
]
}
- ]
+ ],
+ "db" => [":key1", ":key3", ":key2"]
}
]
}
[%{"tuple" => [":versions", [":tlsv1", ":tlsv1.1", ":tlsv1.2"]]}]
]
}
- ]
+ ],
+ "db" => [":ssl_options"]
}
]
}
"value" => [
":console",
%{"tuple" => ["ExSyslogger", ":ex_syslogger"]}
- ]
+ ],
+ "db" => [":backends"]
}
]
}
%{
"group" => ":tesla",
"key" => ":adapter",
- "value" => "Tesla.Adapter.Httpc"
+ "value" => "Tesla.Adapter.Httpc",
+ "db" => [":adapter"]
}
]
}
%{
"group" => ":pleroma",
"key" => config1.key,
- "value" => "another_value"
+ "value" => "another_value",
+ "db" => [":keyaa1"]
}
]
}
%{"tuple" => [":name", "Pleroma"]}
]
},
- %{"group" => ":tesla", "key" => ":adapter", "value" => "Tesla.Adapter.Httpc"}
+ %{
+ "group" => ":tesla",
+ "key" => ":adapter",
+ "value" => "Tesla.Adapter.Httpc"
+ }
]
})
%{"tuple" => [":regex3", "~r/https:\\/\\/example.com/i"]},
%{"tuple" => [":regex4", "~r/https:\\/\\/example.com/s"]},
%{"tuple" => [":name", "Pleroma"]}
+ ],
+ "db" => [
+ ":enabled",
+ ":method",
+ ":seconds_valid",
+ ":path",
+ ":key1",
+ ":partial_chain",
+ ":regex1",
+ ":regex2",
+ ":regex3",
+ ":regex4",
+ ":name"
]
},
- %{"group" => ":tesla", "key" => ":adapter", "value" => "Tesla.Adapter.Httpc"}
+ %{
+ "group" => ":tesla",
+ "key" => ":adapter",
+ "value" => "Tesla.Adapter.Httpc",
+ "db" => [":adapter"]
+ }
]
}
end
]
]
}
- ]
+ ],
+ "db" => [":http"]
}
]
}
}
]
}
- ]
+ ],
+ "db" => [":key2", ":key3"]
}
]
}
%{
"group" => ":pleroma",
"key" => ":key1",
- "value" => %{"key" => "some_val"}
+ "value" => %{"key" => "some_val"},
+ "db" => [":key1"]
}
]
}
%{"tuple" => [":transmogrifier", 20]},
%{"tuple" => [":scheduled_activities", 10]},
%{"tuple" => [":background", 5]}
+ ],
+ "db" => [
+ ":federator_incoming",
+ ":federator_outgoing",
+ ":web_push",
+ ":mailer",
+ ":transmogrifier",
+ ":scheduled_activities",
+ ":background"
]
}
]
%{
"group" => ":pleroma",
"key" => ":keyaa1",
- "value" => [%{"tuple" => [":subkey2", "val2"]}]
+ "value" => [%{"tuple" => [":subkey2", "val2"]}],
+ "db" => [":subkey2"]
}
]
}
"value" => [
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]},
%{"tuple" => [":send_user_agent", false]}
- ]
+ ],
+ "db" => [":proxy_url", ":send_user_agent"]
}
]
}
"value" => [
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]},
%{"tuple" => [":send_user_agent", false]}
- ]
+ ],
+ "db" => [":proxy_url", ":send_user_agent"]
}
]
}
"value" => [
%{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]},
%{"tuple" => [":send_user_agent", false]}
- ]
+ ],
+ "db" => [":proxy_url", ":send_user_agent"]
}
]
}