Co-authored-by: Zeky Abubaker <zeky.abubaker@aa.com>
Signed-off-by: Lucas De Souza <lucas.desouza@aa.com>
This commit is contained in:
Lucas De Souza
2022-11-28 12:16:00 -06:00
parent ac87547571
commit b285e53d4a
@@ -96,21 +96,14 @@ export class DefaultCatalogRulesEnforcer implements CatalogRulesEnforcer {
if (config.has('catalog.rules')) {
const globalRules = config
.getConfigArray('catalog.rules')
.map(ruleConfig => {
const rule: CatalogRule = {
allow: ruleConfig.getStringArray('allow').map(kind => ({ kind })),
};
const locConf = ruleConfig.getOptionalConfigArray('locations');
if (locConf)
rule.locations = locConf.map(locationConfig => ({
.map(ruleConf => ({
allow: ruleConf.getStringArray('allow').map(kind => ({ kind })),
locations: ruleConf.getOptionalConfigArray('locations')?.map(locationConfig => ({
match: locationConfig.getOptionalString('match'),
type: locationConfig.getString('type'),
target: locationConfig.getOptionalString('target'),
}));
return rule;
});
target: locationConfig.getOptionalString('target')
}))
}));
rules.push(...globalRules);
} else {
rules.push(...DefaultCatalogRulesEnforcer.defaultRules);