Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
feat: build a whitelist of any query param to possible values
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-conde committed Dec 3, 2021
1 parent c881ec7 commit b6144ec
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/util/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const startConfig = async () => {
conf.PRX_TARGET = yonius.conf("PROXY_TARGET", "https://app.platforme.com/");
conf.PRX_TARGET = yonius.conf("PRX_TARGET", conf.PRX_TARGET);
conf.PRX_KEEPALIVE = yonius.conf("PRX_KEEPALIVE", 600000, "int");
conf.WHITELIST = yonius.conf("WHITELIST", "", "list");
conf.WHITELIST = _buildWhiteList();
};

const startLogging = async () => {
Expand All @@ -40,6 +40,16 @@ const startLogging = async () => {
}
};

const _buildWhiteList = () => {
const whiteList = {};
const WHITELIST = yonius.conf("WHITELIST", [], "list");
WHITELIST.forEach(list => {
const [param, values] = list.split(":");
whiteList[param] = values.split(",");
});
return whiteList;
};

module.exports = {
conf: conf,
start: start,
Expand Down

0 comments on commit b6144ec

Please sign in to comment.