834479d56f
ember-cli-api-double has been upgraded for 3 things: 1. Use the correct configuration flags 2. Automatically include the necessary files to enable the api doubles without requiring a server. This can be disabled to provide custom functionality (so we can stitch our BDD style testing in with this) 3. When used statically, read the cookies from the users browser to enable basic ad-hoc double editing (e.g. CONSUL_SERVICE_COUNT=100000) Once upgraded we've now moved the config to the correct place, added a new environment (staging) to use the static-style of doubles The test environment continues to use custom cookie setting and url checking so we disable this 'auto importing' by setting 'auto-import' to false for the configuration for the addon. We also added a couple of new package script targets to explicitly serve or build the UI with the entirely static UI.
49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
export default function(type, value) {
|
|
const obj = {};
|
|
if (type !== '*') {
|
|
let key = '';
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
|
switch (type) {
|
|
case 'dc':
|
|
key = 'CONSUL_DATACENTER_COUNT';
|
|
break;
|
|
case 'service':
|
|
key = 'CONSUL_SERVICE_COUNT';
|
|
break;
|
|
case 'node':
|
|
case 'instance':
|
|
key = 'CONSUL_NODE_COUNT';
|
|
break;
|
|
case 'kv':
|
|
key = 'CONSUL_KV_COUNT';
|
|
break;
|
|
case 'acl':
|
|
key = 'CONSUL_ACL_COUNT';
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
|
break;
|
|
case 'session':
|
|
key = 'CONSUL_SESSION_COUNT';
|
|
break;
|
|
case 'intention':
|
|
key = 'CONSUL_INTENTION_COUNT';
|
|
break;
|
|
case 'policy':
|
|
key = 'CONSUL_POLICY_COUNT';
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
|
break;
|
|
case 'role':
|
|
key = 'CONSUL_ROLE_COUNT';
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
|
break;
|
|
case 'token':
|
|
key = 'CONSUL_TOKEN_COUNT';
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
|
break;
|
|
}
|
|
if (key) {
|
|
obj[key] = value;
|
|
}
|
|
}
|
|
return obj;
|
|
}
|