@axway/axway-central-cli 3.15.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +17 -1
- package/dist/commands/install/gitHubSaasAgents.js +1 -2
- package/dist/commands/install/graylogAgent.js +1 -2
- package/dist/commands/install/helpers/inputs.js +8 -0
- package/dist/commands/install/helpers/templates/graylogTemplates.js +1 -1
- package/dist/commands/install/helpers/templates/traceableTemplates.js +14 -7
- package/dist/commands/install/platform.js +17 -2
- package/dist/commands/install/swaggerHubSaasAgents.js +1 -2
- package/dist/commands/install/traceableAgents.js +5 -6
- package/dist/common/types.js +7 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -51,4 +51,20 @@ const cliParams = exports.cliParams = {
|
|
|
51
51
|
},
|
|
52
52
|
extensions
|
|
53
53
|
};
|
|
54
|
-
var _default = exports.default = new _cliKit.default(
|
|
54
|
+
var _default = exports.default = new _cliKit.default({
|
|
55
|
+
title: 'Axway Central CLI',
|
|
56
|
+
name: 'central',
|
|
57
|
+
banner: '',
|
|
58
|
+
version,
|
|
59
|
+
commands: {
|
|
60
|
+
completion: _completion.completion,
|
|
61
|
+
apply: _apply.apply,
|
|
62
|
+
config: _config.config,
|
|
63
|
+
create: _create.create,
|
|
64
|
+
delete: _delete.deleteCmd,
|
|
65
|
+
edit: _edit.edit,
|
|
66
|
+
get: _get.get,
|
|
67
|
+
install: _install.install
|
|
68
|
+
},
|
|
69
|
+
extensions
|
|
70
|
+
});
|
|
@@ -281,8 +281,7 @@ const GitHubSaaSInstallMethods = exports.GitHubSaaSInstallMethods = {
|
|
|
281
281
|
FinalizeGatewayInstall: completeInstall,
|
|
282
282
|
ConfigFiles: [],
|
|
283
283
|
AgentNameMap: {
|
|
284
|
-
[_types.AgentTypes.da]: _types.AgentNames.GITHUB_DA
|
|
285
|
-
[_types.AgentTypes.ta]: _types.AgentNames.GITHUB_DA
|
|
284
|
+
[_types.AgentTypes.da]: _types.AgentNames.GITHUB_DA
|
|
286
285
|
},
|
|
287
286
|
GatewayDisplay: _types.SaaSGatewayTypes.GITHUB
|
|
288
287
|
};
|
|
@@ -138,8 +138,7 @@ const GraylogInstallMethods = exports.GraylogInstallMethods = {
|
|
|
138
138
|
FinalizeGatewayInstall: completeInstall,
|
|
139
139
|
ConfigFiles: Object.values(ConfigFiles),
|
|
140
140
|
AgentNameMap: {
|
|
141
|
-
[_types.AgentTypes.
|
|
142
|
-
[_types.AgentTypes.ta]: _types.AgentNames.GRAYLOG_TA
|
|
141
|
+
[_types.AgentTypes.ca]: _types.AgentNames.GRAYLOG_CA
|
|
143
142
|
},
|
|
144
143
|
GatewayDisplay: _types.GatewayTypes.GRAYLOG
|
|
145
144
|
};
|
|
@@ -36,6 +36,7 @@ const k8sClusterMessages = exports.k8sClusterMessages = {
|
|
|
36
36
|
const agentMessages = exports.agentMessages = {
|
|
37
37
|
enterDiscoveryAgentName: 'Enter a new discovery agent name',
|
|
38
38
|
enterTraceabilityAgentName: 'Enter a new traceability agent name',
|
|
39
|
+
enterComplianceAgentName: 'Enter a new compliance agent name',
|
|
39
40
|
getAgentsError: 'Error getting agents.',
|
|
40
41
|
agentAlreadyExists: 'Agent already exists. Please enter a new name.',
|
|
41
42
|
selectAgentType: 'Select the type of agent(s) you want to install'
|
|
@@ -353,6 +354,13 @@ const askAgentName = async (client, defsManager, agentType, scopeName) => {
|
|
|
353
354
|
msg = agentMessages.enterTraceabilityAgentName;
|
|
354
355
|
break;
|
|
355
356
|
}
|
|
357
|
+
case _types.AgentTypes.ca:
|
|
358
|
+
{
|
|
359
|
+
resourceType = 'ComplianceAgent';
|
|
360
|
+
resourceShortName = 'ca';
|
|
361
|
+
msg = agentMessages.enterComplianceAgentName;
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
356
364
|
}
|
|
357
365
|
let {
|
|
358
366
|
data: agents
|
|
@@ -68,7 +68,7 @@ env:
|
|
|
68
68
|
CENTRAL_ORGANIZATIONID: "{{centralConfig.orgId}}"
|
|
69
69
|
CENTRAL_TEAM: {{centralConfig.ampcTeamName}}
|
|
70
70
|
CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
|
|
71
|
-
CENTRAL_AGENTNAME: {{centralConfig.
|
|
71
|
+
CENTRAL_AGENTNAME: {{centralConfig.caAgentName}}
|
|
72
72
|
CENTRAL_AUTH_CLIENTID: {{centralConfig.dosaAccount.clientId}}
|
|
73
73
|
TRACEABILITY_PROTOCOL: {{traceabilityConfig.protocol}}
|
|
74
74
|
`;
|
|
@@ -3,23 +3,31 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.traceableHelmOverrideTemplate = exports.traceableEnvVarTemplate = exports.TraceableAgentValues = void 0;
|
|
6
|
+
exports.traceableHelmOverrideTemplate = exports.traceableEnvVarTemplate = exports.TraceableAgentValues = exports.ComplianceAgentValues = void 0;
|
|
7
7
|
var _types = require("../../../../common/types");
|
|
8
8
|
var _handlebars = _interopRequireDefault(require("handlebars"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
12
12
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
class ComplianceAgentValues {
|
|
14
|
+
constructor() {
|
|
15
|
+
_defineProperty(this, "centralEnvironments", void 0);
|
|
16
|
+
this.centralEnvironments = [];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
/**
|
|
14
21
|
* @description Parameters to provide to the Traceable handlebars templates.
|
|
15
22
|
*/
|
|
16
|
-
|
|
23
|
+
exports.ComplianceAgentValues = ComplianceAgentValues;
|
|
24
|
+
class TraceableAgentValues extends ComplianceAgentValues {
|
|
17
25
|
constructor() {
|
|
26
|
+
super();
|
|
18
27
|
_defineProperty(this, "namespace", void 0);
|
|
19
28
|
_defineProperty(this, "traceableToken", void 0);
|
|
20
29
|
_defineProperty(this, "traceableRegion", void 0);
|
|
21
30
|
_defineProperty(this, "environments", void 0);
|
|
22
|
-
_defineProperty(this, "centralEnvironments", void 0);
|
|
23
31
|
_defineProperty(this, "centralConfig", void 0);
|
|
24
32
|
_defineProperty(this, "traceabilityConfig", void 0);
|
|
25
33
|
_defineProperty(this, "traceableSecret", void 0);
|
|
@@ -31,7 +39,6 @@ class TraceableAgentValues {
|
|
|
31
39
|
this.traceableToken = '';
|
|
32
40
|
this.traceableRegion = _types.TraceableRegionType.US;
|
|
33
41
|
this.environments = [];
|
|
34
|
-
this.centralEnvironments = [];
|
|
35
42
|
this.centralConfig = new _types.CentralAgentConfig();
|
|
36
43
|
this.traceabilityConfig = new _types.TraceabilityConfig();
|
|
37
44
|
this.traceableSecret = '';
|
|
@@ -39,7 +46,7 @@ class TraceableAgentValues {
|
|
|
39
46
|
}
|
|
40
47
|
}
|
|
41
48
|
exports.TraceableAgentValues = TraceableAgentValues;
|
|
42
|
-
_handlebars.default.registerHelper(
|
|
49
|
+
_handlebars.default.registerHelper('formatIndex', index => {
|
|
43
50
|
return index + 1;
|
|
44
51
|
});
|
|
45
52
|
|
|
@@ -83,7 +90,7 @@ env:
|
|
|
83
90
|
CENTRAL_ORGANIZATIONID: "{{centralConfig.orgId}}"
|
|
84
91
|
CENTRAL_TEAM: {{centralConfig.ampcTeamName}}
|
|
85
92
|
CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
|
|
86
|
-
CENTRAL_AGENTNAME: {{centralConfig.
|
|
93
|
+
CENTRAL_AGENTNAME: {{centralConfig.caAgentName}}
|
|
87
94
|
CENTRAL_AUTH_CLIENTID: {{centralConfig.dosaAccount.clientId}}
|
|
88
95
|
TRACEABILITY_PROTOCOL: {{traceabilityConfig.protocol}}
|
|
89
96
|
`;
|
|
@@ -109,7 +116,7 @@ TRACEABLE_ENVIRONMENTMAPPING_AMPLIFY_{{formatIndex @index}}={{.}}
|
|
|
109
116
|
{{/compare}}
|
|
110
117
|
|
|
111
118
|
# Amplify Central configs
|
|
112
|
-
CENTRAL_AGENTNAME={{centralConfig.
|
|
119
|
+
CENTRAL_AGENTNAME={{centralConfig.caAgentName}}
|
|
113
120
|
CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
|
|
114
121
|
CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
115
122
|
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
@@ -97,10 +97,17 @@ const getCentralConfig = async (apiServerClient, platformClient, defsManager, ap
|
|
|
97
97
|
centralConfig.daAgentName = await helpers.askAgentName(apiServerClient, defsManager, _types.AgentTypes.da, centralConfig.ampcEnvInfo.name);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
//
|
|
100
|
+
// Initialize agent names
|
|
101
101
|
centralConfig.taAgentName = '';
|
|
102
|
+
centralConfig.caAgentName = '';
|
|
103
|
+
|
|
104
|
+
// Determine if we should use CA (compliance) or TA agent. Compliance is good for TRACEABLE and GRAYLOG (atm)
|
|
105
|
+
const isCaType = installConfig.gatewayType === _types.GatewayTypes.TRACEABLE || installConfig.gatewayType === _types.GatewayTypes.GRAYLOG;
|
|
106
|
+
const agentType = isCaType ? _types.AgentTypes.ca : _types.AgentTypes.ta;
|
|
107
|
+
const agentNameProperty = isCaType ? 'caAgentName' : 'taAgentName';
|
|
102
108
|
if (installConfig.switches.isTaEnabled && !installConfig.switches.isHostedInstall) {
|
|
103
|
-
|
|
109
|
+
const agentName = await helpers.askAgentName(apiServerClient, defsManager, agentType, centralConfig.ampcEnvInfo.name);
|
|
110
|
+
centralConfig[agentNameProperty] = agentName;
|
|
104
111
|
}
|
|
105
112
|
return centralConfig;
|
|
106
113
|
};
|
|
@@ -143,6 +150,14 @@ const finalizeCentralInstall = async (apiServerClient, platformClient, defsManag
|
|
|
143
150
|
if (installConfig.centralConfig.taAgentName != '') {
|
|
144
151
|
installConfig.centralConfig.taAgentName = await helpers.createNewAgentResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.GatewayTypeToDataPlane[installConfig.gatewayType], _types.AgentResourceKind.ta, _types.AgentTypes.ta, installConfig.centralConfig.ampcTeamName, installConfig.centralConfig.taAgentName);
|
|
145
152
|
}
|
|
153
|
+
|
|
154
|
+
// Create ComplianceAgent Resource
|
|
155
|
+
if (installConfig.centralConfig.caAgentName != '') {
|
|
156
|
+
installConfig.centralConfig.caAgentName = await helpers.createNewAgentResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.GatewayTypeToDataPlane[installConfig.gatewayType], _types.AgentResourceKind.ca, _types.AgentTypes.ca, installConfig.centralConfig.ampcTeamName, installConfig.centralConfig.caAgentName, undefined, undefined, undefined, {
|
|
157
|
+
managedEnvironment: installConfig.gatewayConfig.centralEnvironments
|
|
158
|
+
} // cast applied here
|
|
159
|
+
);
|
|
160
|
+
}
|
|
146
161
|
if (installConfig.bundleType === _types.BundleType.TRACEABILITY_OFFLINE || installConfig.gatewayType === _types.GatewayTypes.ISTIO) {
|
|
147
162
|
installConfig.centralConfig.environmentId = await helpers.getEnvironmentId(apiServerClient, defsManager, installConfig.centralConfig.environment);
|
|
148
163
|
}
|
|
@@ -259,8 +259,7 @@ const SwaggerHubSaaSInstallMethods = exports.SwaggerHubSaaSInstallMethods = {
|
|
|
259
259
|
FinalizeGatewayInstall: completeInstall,
|
|
260
260
|
ConfigFiles: [],
|
|
261
261
|
AgentNameMap: {
|
|
262
|
-
[_types.AgentTypes.da]: _types.AgentNames.SWAGGERHUB_DA
|
|
263
|
-
[_types.AgentTypes.ta]: _types.AgentNames.SWAGGERHUB_DA
|
|
262
|
+
[_types.AgentTypes.da]: _types.AgentNames.SWAGGERHUB_DA
|
|
264
263
|
},
|
|
265
264
|
GatewayDisplay: _types.SaaSGatewayTypes.SWAGGERHUB
|
|
266
265
|
};
|
|
@@ -20,7 +20,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
20
20
|
const {
|
|
21
21
|
log
|
|
22
22
|
} = (0, _snooplogg.default)('central: install: agents: Traceable');
|
|
23
|
-
const
|
|
23
|
+
const caImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.TRACEABLE_CA}`;
|
|
24
24
|
const amplifyAgentsNs = exports.amplifyAgentsNs = 'amplify-agents';
|
|
25
25
|
|
|
26
26
|
// ConfigFiles - all the config file that are used in the setup
|
|
@@ -142,12 +142,12 @@ const dockerSuccessMsg = installConfig => {
|
|
|
142
142
|
if (installConfig.switches.isTaEnabled) {
|
|
143
143
|
dockerInfo = `To utilize the agent, pull the latest Docker image and run it using the appropriate supplied environment file, (${helpers.configFiles.AGENT_ENV_VARS}):`;
|
|
144
144
|
console.log(_chalk.default.whiteBright(dockerInfo), '\n');
|
|
145
|
-
const
|
|
145
|
+
const caImageVersion = `${caImage}:${installConfig.taVersion}`;
|
|
146
146
|
console.log(_chalk.default.white('Pull the latest image of the Agent:'));
|
|
147
|
-
console.log(_chalk.default.cyan(`docker pull ${
|
|
147
|
+
console.log(_chalk.default.cyan(`docker pull ${caImageVersion}`));
|
|
148
148
|
console.log(_chalk.default.white(_utils.isWindows ? startAgentWinMsg : startAgentLinuxMsg));
|
|
149
149
|
console.log(_chalk.default.cyan(_utils.isWindows ? runAgentWinMsg : runAgentLinuxMsg));
|
|
150
|
-
console.log('\t', _chalk.default.cyan(`-v /data ${
|
|
150
|
+
console.log('\t', _chalk.default.cyan(`-v /data ${caImageVersion}`), '\n');
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
const helmSuccessMsg = namespace => {
|
|
@@ -225,8 +225,7 @@ const TraceableInstallMethods = exports.TraceableInstallMethods = {
|
|
|
225
225
|
FinalizeGatewayInstall: completeInstall,
|
|
226
226
|
ConfigFiles: Object.values(ConfigFiles),
|
|
227
227
|
AgentNameMap: {
|
|
228
|
-
[_types.AgentTypes.
|
|
229
|
-
[_types.AgentTypes.ta]: _types.AgentNames.TRACEABLE_TA
|
|
228
|
+
[_types.AgentTypes.ca]: _types.AgentNames.TRACEABLE_CA
|
|
230
229
|
},
|
|
231
230
|
GatewayDisplay: _types.GatewayTypes.TRACEABLE
|
|
232
231
|
};
|
package/dist/common/types.js
CHANGED
|
@@ -237,10 +237,10 @@ let AgentNames = exports.AgentNames = /*#__PURE__*/function (AgentNames) {
|
|
|
237
237
|
AgentNames["KAFKA_DA"] = "kafka-discovery-agent";
|
|
238
238
|
AgentNames["KAFKA_TA"] = "kafka-traceability-agent";
|
|
239
239
|
AgentNames["SWAGGERHUB_DA"] = "swaggerhub-discovery-agent";
|
|
240
|
-
AgentNames["
|
|
240
|
+
AgentNames["GRAYLOG_CA"] = "graylog-compliance-agent";
|
|
241
241
|
AgentNames["IBMAPICONNECT_DA"] = "ibm-apiconnect-discovery-agent";
|
|
242
242
|
AgentNames["IBMAPICONNECT_TA"] = "ibm-apiconnect-traceability-agent";
|
|
243
|
-
AgentNames["
|
|
243
|
+
AgentNames["TRACEABLE_CA"] = "traceable-compliance-agent";
|
|
244
244
|
AgentNames["SOFTWAREAGWEBMETHODS_DA"] = "software-ag-webmethods-discovery-agent";
|
|
245
245
|
AgentNames["SOFTWAREAGWEBMETHODS_TA"] = "software-ag-webmethods-traceability-agent";
|
|
246
246
|
AgentNames["BACKSTAGE_DA"] = "backstage-discovery-agent";
|
|
@@ -320,11 +320,13 @@ const GatewayTypeToDataPlane = exports.GatewayTypeToDataPlane = {
|
|
|
320
320
|
let AgentResourceKind = exports.AgentResourceKind = /*#__PURE__*/function (AgentResourceKind) {
|
|
321
321
|
AgentResourceKind["da"] = "DiscoveryAgent";
|
|
322
322
|
AgentResourceKind["ta"] = "TraceabilityAgent";
|
|
323
|
+
AgentResourceKind["ca"] = "ComplianceAgent";
|
|
323
324
|
return AgentResourceKind;
|
|
324
325
|
}({});
|
|
325
326
|
let AgentTypes = exports.AgentTypes = /*#__PURE__*/function (AgentTypes) {
|
|
326
327
|
AgentTypes["da"] = "da";
|
|
327
328
|
AgentTypes["ta"] = "ta";
|
|
329
|
+
AgentTypes["ca"] = "ca";
|
|
328
330
|
return AgentTypes;
|
|
329
331
|
}({}); // AWSRegions - base set of regions, may use option outside this list
|
|
330
332
|
let AWSRegions = exports.AWSRegions = /*#__PURE__*/function (AWSRegions) {
|
|
@@ -382,6 +384,7 @@ class CentralAgentConfig {
|
|
|
382
384
|
_defineProperty(this, "ingestionProtocol", void 0);
|
|
383
385
|
_defineProperty(this, "daAgentName", void 0);
|
|
384
386
|
_defineProperty(this, "taAgentName", void 0);
|
|
387
|
+
_defineProperty(this, "caAgentName", void 0);
|
|
385
388
|
_defineProperty(this, "dosaAccount", void 0);
|
|
386
389
|
_defineProperty(this, "environment", void 0);
|
|
387
390
|
_defineProperty(this, "environmentId", void 0);
|
|
@@ -396,6 +399,7 @@ class CentralAgentConfig {
|
|
|
396
399
|
_defineProperty(this, "axwayManaged", void 0);
|
|
397
400
|
_defineProperty(this, "apiServerClient", void 0);
|
|
398
401
|
_defineProperty(this, "definitionManager", void 0);
|
|
402
|
+
_defineProperty(this, "gatewayConfig", void 0);
|
|
399
403
|
_defineProperty(this, "setBaseHost", async () => {
|
|
400
404
|
this.url = await (0, _dataService.getBaseUrl)(undefined, undefined, this.region);
|
|
401
405
|
[this.scheme, this.host] = this.url.split('://');
|
|
@@ -406,6 +410,7 @@ class CentralAgentConfig {
|
|
|
406
410
|
this.ingestionProtocol = IngestionProtocol.Lumberjack;
|
|
407
411
|
this.daAgentName = '';
|
|
408
412
|
this.taAgentName = '';
|
|
413
|
+
this.caAgentName = '';
|
|
409
414
|
this.ampcEnvInfo = new EnvironmentConfigInfo();
|
|
410
415
|
this.ampcDosaInfo = new DOSAConfigInfo();
|
|
411
416
|
this.dosaAccount = new DosaAccount();
|