@axway/axway-central-cli 2.23.0 → 2.25.0-rc.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/README.md +0 -44
- package/dist/commands/install/agents.js +3 -1
- package/dist/commands/install/gitHubSaasAgents.js +14 -3
- package/dist/commands/install/gitLabAgents.js +1 -1
- package/dist/commands/install/helpers/index.js +12 -0
- package/dist/commands/install/helpers/regex.js +12 -8
- package/dist/commands/install/helpers/templates/kafkaTemplates.js +171 -0
- package/dist/commands/install/kafkaAgents.js +272 -0
- package/dist/commands/install/platform.js +10 -8
- package/dist/common/dataService.js +1 -1
- package/dist/common/types.js +6 -1
- package/package.json +1 -1
- package/da.yaml +0 -47
package/README.md
CHANGED
|
@@ -229,50 +229,6 @@ The ability to create/update proxies have been deprecated from the CLI verison 2
|
|
|
229
229
|
|
|
230
230
|
---
|
|
231
231
|
|
|
232
|
-
- **v0**
|
|
233
|
-
|
|
234
|
-
```yaml
|
|
235
|
-
apiVersion: v1
|
|
236
|
-
proxy:
|
|
237
|
-
name: 'Musical Instruments'
|
|
238
|
-
basePath: /api/v1
|
|
239
|
-
swagger: 'https://ec062a054a2977120b7e721801edb38ca24dfbb3.cloudapp-enterprise.appcelerator.com/apidoc/swagger.json'
|
|
240
|
-
policy:
|
|
241
|
-
type: api-key
|
|
242
|
-
app: 'Sample App'
|
|
243
|
-
tags: ['musical', 'instruments']
|
|
244
|
-
team:
|
|
245
|
-
name: 'Default Team'
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
- **v1**
|
|
249
|
-
|
|
250
|
-
```yaml
|
|
251
|
-
apiVersion: v1
|
|
252
|
-
version: v1
|
|
253
|
-
proxy:
|
|
254
|
-
name: 'Musical Instruments'
|
|
255
|
-
basePath: /api/v1
|
|
256
|
-
swagger: 'https://ec062a054a2977120b7e721801edb38ca24dfbb3.cloudapp-enterprise.appcelerator.com/apidoc/swagger.json'
|
|
257
|
-
policies:
|
|
258
|
-
clientAuth:
|
|
259
|
-
type: api-key
|
|
260
|
-
app: 'Sample App'
|
|
261
|
-
backendAuth:
|
|
262
|
-
type: auth-http-basic
|
|
263
|
-
username: Joe
|
|
264
|
-
password: changeme
|
|
265
|
-
rateLimit:
|
|
266
|
-
perProxy: 5
|
|
267
|
-
perProxyAndApp: 3
|
|
268
|
-
apps:
|
|
269
|
-
- name: 'Second Sample App'
|
|
270
|
-
team:
|
|
271
|
-
name: 'Default Team'
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
---
|
|
275
|
-
|
|
276
232
|
## GET
|
|
277
233
|
|
|
278
234
|
Prints a table of the most important information about the specified resources.
|
|
@@ -24,6 +24,7 @@ var apigeeSaaSAgents = _interopRequireWildcard(require("./apigeexSaasAgents"));
|
|
|
24
24
|
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
25
25
|
var istioAgents = _interopRequireWildcard(require("./istioAgents"));
|
|
26
26
|
var saasAgents = _interopRequireWildcard(require("./awsSaasAgents"));
|
|
27
|
+
var kafkaAgents = _interopRequireWildcard(require("./kafkaAgents"));
|
|
27
28
|
var platform = _interopRequireWildcard(require("./platform"));
|
|
28
29
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -44,7 +45,8 @@ const agentInstallFlows = {
|
|
|
44
45
|
[_types.GatewayTypes.GITLAB]: gitLabAgents.GitLabInstallMethods,
|
|
45
46
|
[_types.GatewayTypes.APIGEEX_GATEWAY]: apigeeSaaSAgents.APIGEEXSaaSInstallMethods,
|
|
46
47
|
[_types.GatewayTypes.AZURE_GATEWAY]: azureAgents.AzureInstallMethods,
|
|
47
|
-
[_types.GatewayTypes.ISTIO]: istioAgents.IstioInstallMethods
|
|
48
|
+
[_types.GatewayTypes.ISTIO]: istioAgents.IstioInstallMethods,
|
|
49
|
+
[_types.GatewayTypes.KAFKA]: kafkaAgents.KafkaInstallMethods
|
|
48
50
|
};
|
|
49
51
|
const saasAgentInstallFlows = {
|
|
50
52
|
[_types.GatewayTypes.AWS_GATEWAY]: saasAgents.AWSSaaSInstallMethods,
|
|
@@ -37,10 +37,12 @@ class GitHubDataplaneConfig extends DataplaneConfig {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
class GitHubFilterConfig {
|
|
40
|
-
constructor(paths, pattern) {
|
|
40
|
+
constructor(paths, branch, pattern) {
|
|
41
41
|
_defineProperty(this, "paths", void 0);
|
|
42
|
+
_defineProperty(this, "branch", void 0);
|
|
42
43
|
_defineProperty(this, "pattern", void 0);
|
|
43
44
|
this.paths = paths;
|
|
45
|
+
this.branch = branch;
|
|
44
46
|
this.pattern = pattern;
|
|
45
47
|
}
|
|
46
48
|
}
|
|
@@ -53,6 +55,7 @@ class SaasAgentValues {
|
|
|
53
55
|
_defineProperty(this, "centralConfig", void 0);
|
|
54
56
|
_defineProperty(this, "repositoryOwner", void 0);
|
|
55
57
|
_defineProperty(this, "repositoryName", void 0);
|
|
58
|
+
_defineProperty(this, "repositoryBranch", void 0);
|
|
56
59
|
_defineProperty(this, "filePaths", void 0);
|
|
57
60
|
_defineProperty(this, "filePatterns", void 0);
|
|
58
61
|
this.frequencyDA = '';
|
|
@@ -62,6 +65,7 @@ class SaasAgentValues {
|
|
|
62
65
|
this.centralConfig = new _types.CentralAgentConfig();
|
|
63
66
|
this.repositoryOwner = '';
|
|
64
67
|
this.repositoryName = '';
|
|
68
|
+
this.repositoryBranch = '';
|
|
65
69
|
this.filePaths = [];
|
|
66
70
|
this.filePatterns = [];
|
|
67
71
|
}
|
|
@@ -88,6 +92,7 @@ const SaasPrompts = {
|
|
|
88
92
|
ACCESS_TOKEN: 'Enter the GitHub Access Token the agent will use',
|
|
89
93
|
REPOSITORY_OWNER: 'Enter the GitHub Repository Owner the agent will use',
|
|
90
94
|
REPOSITORY_NAME: 'Enter the Repository Name the agent will use',
|
|
95
|
+
REPOSITORY_BRANCH: 'Enter the Repository Branch the agent will use',
|
|
91
96
|
FILE_PATHS: 'Enter a File Path within the repository that the agent will use',
|
|
92
97
|
FILE_PATTERNS: 'Enter a File Pattern that the agent will use (Optional)',
|
|
93
98
|
DA_FREQUENCY: 'How often should the discovery run, leave blank for integrating in CI/CD process',
|
|
@@ -166,7 +171,13 @@ const gatewayConnectivity = async installConfig => {
|
|
|
166
171
|
hostedAgentValues.repositoryName = await (0, _basicPrompts.askInput)({
|
|
167
172
|
msg: SaasPrompts.REPOSITORY_NAME,
|
|
168
173
|
defaultValue: hostedAgentValues.repositoryName !== '' ? hostedAgentValues.repositoryName : undefined,
|
|
169
|
-
validate: (0, _basicPrompts.validateRegex)(helpers.GitHubRegexPatterns.
|
|
174
|
+
validate: (0, _basicPrompts.validateRegex)(helpers.GitHubRegexPatterns.gitHubRepositoryNameRegex, helpers.invalidValueExampleErrMsg('Repository Name', 'axway-github-repo-name'))
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// get repository branch
|
|
178
|
+
hostedAgentValues.repositoryBranch = await (0, _basicPrompts.askInput)({
|
|
179
|
+
msg: SaasPrompts.REPOSITORY_BRANCH,
|
|
180
|
+
defaultValue: hostedAgentValues.repositoryBranch !== '' ? hostedAgentValues.repositoryBranch : undefined
|
|
170
181
|
});
|
|
171
182
|
|
|
172
183
|
// get File Paths
|
|
@@ -241,7 +252,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
|
|
|
241
252
|
production: installConfig.centralConfig.production
|
|
242
253
|
}) : installConfig.centralConfig.ampcEnvInfo.name;
|
|
243
254
|
if (installConfig.gatewayType === _types.GatewayTypes.GITHUB) {
|
|
244
|
-
gitHubAgentValues.dataplaneConfig = new GitHubDataplaneConfig(gitHubAgentValues.repositoryName, gitHubAgentValues.repositoryOwner, new GitHubFilterConfig(gitHubAgentValues.filePaths, gitHubAgentValues.filePatterns));
|
|
255
|
+
gitHubAgentValues.dataplaneConfig = new GitHubDataplaneConfig(gitHubAgentValues.repositoryName, gitHubAgentValues.repositoryOwner, new GitHubFilterConfig(gitHubAgentValues.filePaths, gitHubAgentValues.repositoryBranch, gitHubAgentValues.filePatterns));
|
|
245
256
|
}
|
|
246
257
|
|
|
247
258
|
// create the data plane resource
|
|
@@ -52,7 +52,7 @@ const askForGitLabToken = async () => await (0, _basicPrompts.askInput)({
|
|
|
52
52
|
});
|
|
53
53
|
const askForGitLabBaseURL = async () => await (0, _basicPrompts.askInput)({
|
|
54
54
|
msg: gitLabPrompts.BASE_URL,
|
|
55
|
-
validate: (0, _basicPrompts.validateRegex)(helpers.GitLabRegexPatterns.gitLabBaseURLRegex, helpers.invalidValueExampleErrMsg('BaseURL', '
|
|
55
|
+
validate: (0, _basicPrompts.validateRegex)(helpers.GitLabRegexPatterns.gitLabBaseURLRegex, helpers.invalidValueExampleErrMsg('BaseURL', 'https://www.testdomain.com'))
|
|
56
56
|
});
|
|
57
57
|
const askForGitLabRepositoryID = async () => await (0, _basicPrompts.askInput)({
|
|
58
58
|
msg: gitLabPrompts.REPOSITORY_ID,
|
|
@@ -140,6 +140,18 @@ Object.keys(_gitLabTemplates).forEach(function (key) {
|
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
});
|
|
143
|
+
var _kafkaTemplates = require("./templates/kafkaTemplates");
|
|
144
|
+
Object.keys(_kafkaTemplates).forEach(function (key) {
|
|
145
|
+
if (key === "default" || key === "__esModule") return;
|
|
146
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
147
|
+
if (key in exports && exports[key] === _kafkaTemplates[key]) return;
|
|
148
|
+
Object.defineProperty(exports, key, {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function () {
|
|
151
|
+
return _kafkaTemplates[key];
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
});
|
|
143
155
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
144
156
|
const streamPipeline = exports.streamPipeline = _util.default.promisify(_stream.default.pipeline);
|
|
145
157
|
const unzip = async filePath => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.resourceRegex = exports.percentageRegex = exports.namespaceRegex = exports.maskingRegex = exports.invalidResourceMsg = exports.invalidPercentage = exports.invalidNamespace = exports.invalidDosaName = exports.invalidDomainName = exports.frequencyRegex = exports.dosaRegex = exports.domainNameRegex = exports.GitLabRegexPatterns = exports.GitHubRegexPatterns = exports.AzureRegexPatterns = exports.AWSRegexPatterns = exports.APIGEEXRegexPatterns = void 0;
|
|
6
|
+
exports.resourceRegex = exports.percentageRegex = exports.namespaceRegex = exports.maskingRegex = exports.invalidResourceMsg = exports.invalidPercentage = exports.invalidNamespace = exports.invalidDosaName = exports.invalidDomainName = exports.frequencyRegex = exports.dosaRegex = exports.domainNameRegex = exports.KafkaRegexPatterns = exports.GitLabRegexPatterns = exports.GitHubRegexPatterns = exports.AzureRegexPatterns = exports.AWSRegexPatterns = exports.APIGEEXRegexPatterns = void 0;
|
|
7
7
|
const resourceRegex = exports.resourceRegex = '^(?:[a-z0-9]*(?:\\.(?=[a-z0-9])|-+(?=[a-z0-9]))?)+[a-z0-9]$';
|
|
8
8
|
const namespaceRegex = exports.namespaceRegex = '^[a-z0-9]?(?:[-a-z0-9]*[a-z0-9]){1,100}?$';
|
|
9
9
|
const domainNameRegex = exports.domainNameRegex = '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)+([A-Za-z]){2,}$';
|
|
@@ -31,13 +31,13 @@ const AWSRegexPatterns = exports.AWSRegexPatterns = {
|
|
|
31
31
|
AWS_REGEXP_ACCESS_KEY_ID: '((?:ASIA|AKIA|AROA|AIDA)([A-Z0-7]{16}))',
|
|
32
32
|
AWS_REGEXP_SECRET_ACCESS_KEY: '[a-zA-Z0-9+/]{40}',
|
|
33
33
|
AWS_REGEXP_ROLE_ARN: '^arn:aws[a-zA-Z-]*:iam::\\d{12}:role\\/?[a-zA-Z0-9+=,.@\\-_\\/]{1,128}$',
|
|
34
|
-
AWS_ACCESS_LOG_ARN: '^arn:aws[a-zA-Z-]*:logs:[a-zA-Z0-9
|
|
34
|
+
AWS_ACCESS_LOG_ARN: '^arn:aws[a-zA-Z-]*:logs:[a-zA-Z0-9\-]*:\\d{12}:log-group:[a-zA-Z0-9_\\-\\/\\.#]{1,512}$'
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
// APIGEEXRegexPatterns - regex patters to validate user inputs
|
|
38
38
|
const APIGEEXRegexPatterns = exports.APIGEEXRegexPatterns = {
|
|
39
39
|
APIGEEX_REGEXP_PROJECT_ID: '^[a-z][a-z0-9-]{4,28}[a-z0-9]$',
|
|
40
|
-
AWS_REGEXP_EMAIL_ADDRESS: '^(([^<>()[]
|
|
40
|
+
AWS_REGEXP_EMAIL_ADDRESS: '^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$'
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
// AzureRegexPatterns - regex patters to validate user inputs
|
|
@@ -49,12 +49,16 @@ const AzureRegexPatterns = exports.AzureRegexPatterns = {
|
|
|
49
49
|
const GitHubRegexPatterns = exports.GitHubRegexPatterns = {
|
|
50
50
|
gitHubAccessTokenRegex: '^ghp_[a-zA-Z0-9]{36}$',
|
|
51
51
|
gitHubRepositoryOwnerRegex: '^(?!-)(?!.*--)[a-zA-Z0-9-]{1,37}(?<!-)$',
|
|
52
|
-
gitHubRepositoryNameRegex: '^[w
|
|
53
|
-
gitHubFilePathRegex: '
|
|
52
|
+
gitHubRepositoryNameRegex: '^[\\w-\\.]+$',
|
|
53
|
+
gitHubFilePathRegex: '^\/.*$'
|
|
54
54
|
};
|
|
55
55
|
const GitLabRegexPatterns = exports.GitLabRegexPatterns = {
|
|
56
|
-
gitLabAccessTokenRegex: '^[0-9a-zA-Z
|
|
57
|
-
gitLabBaseURLRegex: '^(http
|
|
56
|
+
gitLabAccessTokenRegex: '^[0-9a-zA-Z\-]{20}$',
|
|
57
|
+
gitLabBaseURLRegex: '^(http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$',
|
|
58
58
|
gitHubRepositoryIDRegex: '^[0-9]*$',
|
|
59
|
-
gitLabPathRegex: '
|
|
59
|
+
gitLabPathRegex: '^\/.*$'
|
|
60
|
+
};
|
|
61
|
+
const KafkaRegexPatterns = exports.KafkaRegexPatterns = {
|
|
62
|
+
bootstrapServerRegex: '^(SASL_SSL:\/\/|SASL_PLAINTEXT:\/\/|PLAINTEXT:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z0-9]{1,5}(:[0-9]{1,5})$',
|
|
63
|
+
schemaRegistryURLRegex: '^(http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$'
|
|
60
64
|
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.kafkaTAEnvVarTemplate = exports.kafkaDAEnvVarTemplate = exports.KafkaAgentValues = void 0;
|
|
7
|
+
var _types = require("../../../../common/types");
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
/**
|
|
12
|
+
* @description Parameters to provide to the Kafka handlebars templates.
|
|
13
|
+
*/
|
|
14
|
+
class KafkaAgentValues {
|
|
15
|
+
constructor() {
|
|
16
|
+
_defineProperty(this, "cloudEnabled", void 0);
|
|
17
|
+
_defineProperty(this, "cloudEnvironmentId", void 0);
|
|
18
|
+
_defineProperty(this, "cloudAPIKey", void 0);
|
|
19
|
+
_defineProperty(this, "cloudAPISecret", void 0);
|
|
20
|
+
_defineProperty(this, "cloudClusterId", void 0);
|
|
21
|
+
_defineProperty(this, "clusterServer", void 0);
|
|
22
|
+
_defineProperty(this, "clusterAPIKey", void 0);
|
|
23
|
+
_defineProperty(this, "clusterAPISecret", void 0);
|
|
24
|
+
_defineProperty(this, "clusterSaslMechanism", void 0);
|
|
25
|
+
_defineProperty(this, "clusterSaslUser", void 0);
|
|
26
|
+
_defineProperty(this, "clusterSaslPassword", void 0);
|
|
27
|
+
_defineProperty(this, "schemaRegistryEnabled", void 0);
|
|
28
|
+
_defineProperty(this, "schemaRegistryUrl", void 0);
|
|
29
|
+
_defineProperty(this, "schemaRegistryAuthEnabled", void 0);
|
|
30
|
+
_defineProperty(this, "schemaRegistryAPIKey", void 0);
|
|
31
|
+
_defineProperty(this, "schemaRegistryAPISecret", void 0);
|
|
32
|
+
_defineProperty(this, "centralConfig", void 0);
|
|
33
|
+
_defineProperty(this, "traceabilityConfig", void 0);
|
|
34
|
+
this.cloudEnabled = false;
|
|
35
|
+
this.cloudEnvironmentId = '';
|
|
36
|
+
this.cloudAPIKey = '';
|
|
37
|
+
this.cloudAPISecret = '';
|
|
38
|
+
this.cloudClusterId = '';
|
|
39
|
+
this.clusterServer = '';
|
|
40
|
+
this.clusterAPIKey = '';
|
|
41
|
+
this.clusterAPISecret = '';
|
|
42
|
+
this.clusterSaslMechanism = '';
|
|
43
|
+
this.clusterSaslUser = '';
|
|
44
|
+
this.clusterSaslPassword = '';
|
|
45
|
+
this.schemaRegistryEnabled = false;
|
|
46
|
+
this.schemaRegistryUrl = '';
|
|
47
|
+
this.schemaRegistryAuthEnabled = true;
|
|
48
|
+
this.schemaRegistryAPIKey = '';
|
|
49
|
+
this.schemaRegistryAPISecret = '';
|
|
50
|
+
this.centralConfig = new _types.CentralAgentConfig();
|
|
51
|
+
this.traceabilityConfig = new _types.TraceabilityConfig();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @description Generates the Kafka DA env vars file.
|
|
57
|
+
*/
|
|
58
|
+
exports.KafkaAgentValues = KafkaAgentValues;
|
|
59
|
+
const kafkaDAEnvVarTemplate = () => {
|
|
60
|
+
return `# Kafka cluster configs
|
|
61
|
+
{{#if cloudEnabled}}
|
|
62
|
+
KAFKA_CLOUD_ENABLED={{cloudEnabled}}
|
|
63
|
+
KAFKA_CLOUD_ENVIRONMENT={{cloudEnvironmentId}}
|
|
64
|
+
KAFKA_CLOUD_AUTH_APIKEY_ID={{cloudAPIKey}}
|
|
65
|
+
KAFKA_CLOUD_AUTH_APIKEY_SECRET={{cloudAPISecret}}
|
|
66
|
+
KAFKA_CLUSTER_ID={{cloudClusterId}}
|
|
67
|
+
KAFKA_CLUSTER_AUTH_APIKEY_ID={{clusterAPIKey}}
|
|
68
|
+
KAFKA_CLUSTER_AUTH_APIKEY_SECRET={{clusterAPISecret}}
|
|
69
|
+
{{else}}
|
|
70
|
+
KAFKA_CLUSTER_SERVERS={{clusterServer}}
|
|
71
|
+
{{#compare . clusterSaslMechanism "NONE" operator="!="}}
|
|
72
|
+
KAFKA_CLUSTER_AUTH_SASL_MECHANISM={{clusterSaslMechanism}}
|
|
73
|
+
KAFKA_CLUSTER_AUTH_SASL_USERNAME={{clusterSaslUser}}
|
|
74
|
+
KAFKA_CLUSTER_AUTH_SASL_PASSWORD={{clusterSaslPassword}}
|
|
75
|
+
{{/compare}}
|
|
76
|
+
{{/if}}
|
|
77
|
+
|
|
78
|
+
{{#if cloudEnabled}}
|
|
79
|
+
KAFKA_SCHEMAREGISTRY_ENABLED=true
|
|
80
|
+
KAFKA_SCHEMAREGISTRY_AUTH_APIKEY_ID={{schemaRegistryAPIKey}}
|
|
81
|
+
KAFKA_SCHEMAREGISTRY_AUTH_APIKEY_SECRET={{schemaRegistryAPISecret}}
|
|
82
|
+
{{else}}
|
|
83
|
+
{{#if schemaRegistryEnabled}}
|
|
84
|
+
KAFKA_SCHEMAREGISTRY_ENABLED=true
|
|
85
|
+
KAFKA_SCHEMAREGISTRY_URL={{schemaRegistryUrl}}
|
|
86
|
+
{{#if schemaRegistryAuthEnabled}}
|
|
87
|
+
KAFKA_SCHEMAREGISTRY_AUTH_SASL_MECHANISM={{clusterSaslMechanism}}
|
|
88
|
+
KAFKA_SCHEMAREGISTRY_AUTH_SASL_USERNAME={{clusterSaslUser}}
|
|
89
|
+
KAFKA_SCHEMAREGISTRY_AUTH_SASL_PASSWORD={{clusterSaslPassword}}
|
|
90
|
+
{{/if}}
|
|
91
|
+
{{/if}}
|
|
92
|
+
{{/if}}
|
|
93
|
+
|
|
94
|
+
# Amplify Central configs
|
|
95
|
+
CENTRAL_AGENTNAME={{centralConfig.daAgentName}}
|
|
96
|
+
CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
|
|
97
|
+
CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
98
|
+
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
99
|
+
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
100
|
+
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
101
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
102
|
+
CENTRAL_SINGLEURL={{centralConfig.singleEntryPointUrl}}
|
|
103
|
+
{{#compare . centralConfig.region "US" operator="!="}}
|
|
104
|
+
CENTRAL_URL={{centralConfig.url}}
|
|
105
|
+
{{/compare}}
|
|
106
|
+
|
|
107
|
+
# Logging configs
|
|
108
|
+
# Define the logging level: info, debug, error
|
|
109
|
+
LOG_LEVEL=info
|
|
110
|
+
# Specify where to send the log: stdout, file, both
|
|
111
|
+
LOG_OUTPUT=stdout
|
|
112
|
+
# Define where the log files are written
|
|
113
|
+
LOG_FILE_PATH=logs
|
|
114
|
+
`;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @description Generates the Kafka TA env vars file.
|
|
119
|
+
*/
|
|
120
|
+
exports.kafkaDAEnvVarTemplate = kafkaDAEnvVarTemplate;
|
|
121
|
+
const kafkaTAEnvVarTemplate = () => {
|
|
122
|
+
return `# Kafka cluster configs
|
|
123
|
+
{{#if cloudEnabled}}
|
|
124
|
+
KAFKA_CLOUD_ENABLED={{cloudEnabled}}
|
|
125
|
+
KAFKA_CLOUD_ENVIRONMENT={{cloudEnvironmentId}}
|
|
126
|
+
KAFKA_CLOUD_AUTH_APIKEY_ID={{cloudAPIKey}}
|
|
127
|
+
KAFKA_CLOUD_AUTH_APIKEY_SECRET={{cloudAPISecret}}
|
|
128
|
+
KAFKA_CLUSTER_ID={{cloudClusterId}}
|
|
129
|
+
KAFKA_CLUSTER_AUTH_APIKEY_ID={{clusterAPIKey}}
|
|
130
|
+
KAFKA_CLUSTER_AUTH_APIKEY_SECRET={{clusterAPISecret}}
|
|
131
|
+
{{else}}
|
|
132
|
+
KAFKA_CLUSTER_SERVERS={{clusterServer}}
|
|
133
|
+
{{#compare . clusterSaslMechanism "NONE" operator="!="}}
|
|
134
|
+
KAFKA_CLUSTER_AUTH_SASL_MECHANISM={{clusterSaslMechanism}}
|
|
135
|
+
KAFKA_CLUSTER_AUTH_SASL_USERNAME={{clusterSaslUser}}
|
|
136
|
+
KAFKA_CLUSTER_AUTH_SASL_PASSWORD={{clusterSaslPassword}}
|
|
137
|
+
{{/compare}}
|
|
138
|
+
{{/if}}
|
|
139
|
+
|
|
140
|
+
# Amplify Central configs
|
|
141
|
+
CENTRAL_AGENTNAME={{centralConfig.taAgentName}}
|
|
142
|
+
CENTRAL_AUTH_CLIENTID={{centralConfig.dosaAccount.clientId}}
|
|
143
|
+
CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
|
|
144
|
+
CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
|
|
145
|
+
CENTRAL_ENVIRONMENT={{centralConfig.environment}}
|
|
146
|
+
CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
|
|
147
|
+
CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
148
|
+
CENTRAL_SINGLEURL={{centralConfig.singleEntryPointUrl}}
|
|
149
|
+
{{#compare . centralConfig.region "US" operator="!="}}
|
|
150
|
+
CENTRAL_URL={{centralConfig.url}}
|
|
151
|
+
CENTRAL_DEPLOYMENT={{centralConfig.deployment}}
|
|
152
|
+
|
|
153
|
+
TRACEABILITY_HOST={{traceabilityConfig.host}}
|
|
154
|
+
{{/compare}}
|
|
155
|
+
{{#compare . centralConfig.region "US"}}
|
|
156
|
+
|
|
157
|
+
{{/compare}}
|
|
158
|
+
{{#compare . traceabilityConfig.protocol "https"}}
|
|
159
|
+
TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
|
|
160
|
+
{{/compare}}
|
|
161
|
+
|
|
162
|
+
# Logging configs
|
|
163
|
+
# Define the logging level: info, debug, error
|
|
164
|
+
LOG_LEVEL=info
|
|
165
|
+
# Specify where to send the log: stdout, file, both
|
|
166
|
+
LOG_OUTPUT=stdout
|
|
167
|
+
# Define where the log files are written
|
|
168
|
+
LOG_FILE_PATH=logs
|
|
169
|
+
`;
|
|
170
|
+
};
|
|
171
|
+
exports.kafkaTAEnvVarTemplate = kafkaTAEnvVarTemplate;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.testables = exports.gatewayConnectivity = exports.completeInstall = exports.askSaslMechanism = exports.askIsSchemaRegistryAuthEnabled = exports.askIsCloudEnabled = exports.askConfigType = exports.askBundleType = exports.SaslMechanismTypes = exports.KafkaInstallMethods = exports.DeploymentTypes = exports.ConfigFiles = void 0;
|
|
7
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
+
var _snooplogg = _interopRequireDefault(require("snooplogg"));
|
|
9
|
+
var _basicPrompts = require("../../common/basicPrompts");
|
|
10
|
+
var _types = require("../../common/types");
|
|
11
|
+
var _utils = require("../../common/utils");
|
|
12
|
+
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
13
|
+
var _kafkaTemplates = require("./helpers/templates/kafkaTemplates");
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
const {
|
|
19
|
+
log
|
|
20
|
+
} = (0, _snooplogg.default)('central: install: agents: kafka');
|
|
21
|
+
const daImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.KAFKA_DA}`;
|
|
22
|
+
const taImage = `${_types.PublicDockerRepoBaseUrl}${_types.BasePaths.DockerAgentPublicRepo}/${_types.AgentNames.KAFKA_TA}`;
|
|
23
|
+
|
|
24
|
+
// ConfigFiles - all the config file that are used in the setup
|
|
25
|
+
const ConfigFiles = exports.ConfigFiles = {
|
|
26
|
+
DAEnvVars: `${helpers.configFiles.DA_ENV_VARS}`,
|
|
27
|
+
TAEnvVars: `${helpers.configFiles.TA_ENV_VARS}`
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// DeploymentTypes - types of Kafka cluster deployments
|
|
31
|
+
let DeploymentTypes = exports.DeploymentTypes = /*#__PURE__*/function (DeploymentTypes) {
|
|
32
|
+
DeploymentTypes["CONFLUENT_CLOUD"] = "Confluent Cloud";
|
|
33
|
+
DeploymentTypes["CONFLUENT_PLATFORM"] = "Confluent Platform";
|
|
34
|
+
return DeploymentTypes;
|
|
35
|
+
}({}); // SaslMechanismTypes - SASL authentication mechanism types
|
|
36
|
+
let SaslMechanismTypes = exports.SaslMechanismTypes = /*#__PURE__*/function (SaslMechanismTypes) {
|
|
37
|
+
SaslMechanismTypes["SCRAM_SHA_256"] = "SCRAM-SHA-256";
|
|
38
|
+
SaslMechanismTypes["SCRAM_SHA_512"] = "SCRAM-SHA-512";
|
|
39
|
+
SaslMechanismTypes["PLAIN"] = "PLAIN";
|
|
40
|
+
SaslMechanismTypes["NONE"] = "NONE";
|
|
41
|
+
return SaslMechanismTypes;
|
|
42
|
+
}({}); // KafkaPrompts - prompts for user inputs
|
|
43
|
+
const prompts = {
|
|
44
|
+
deploymentTypeMsg: 'Select the type of deployment you wish to configure',
|
|
45
|
+
enterEnvironmentId: 'Enter the Environment Id',
|
|
46
|
+
enterClusterId: 'Enter the Cluster Id',
|
|
47
|
+
enterCloudAPIKey: 'Enter the Cloud API Key Id',
|
|
48
|
+
enterCloudAPISecret: 'Enter the Cloud API Key Secret',
|
|
49
|
+
enterClusterServer: 'Enter the Bootstrap Server Name',
|
|
50
|
+
enterClusterAPIKey: 'Enter the Cluster API Key Id',
|
|
51
|
+
enterClusterAPISecret: 'Enter the Cluster API Key Secret',
|
|
52
|
+
saslMechanismMsg: "Select the SASL Mechanism you wish to use for authentication",
|
|
53
|
+
enterSaslUsername: "Enter the SASL Username",
|
|
54
|
+
enterSaslPassword: "Enter the SASL Password",
|
|
55
|
+
schemaRegistryEnabledMsg: 'Do you want to use Schema Registry with Kafka cluster?',
|
|
56
|
+
enterSchemaRegistryUrl: 'Enter the Schema Registry Url',
|
|
57
|
+
schemaRegistryAuthEnabled: 'Do you want to authenticate Schema Registry with SASL User?',
|
|
58
|
+
enterSchemaRegistryAPIKey: 'Enter the Schema Registry API Key Id',
|
|
59
|
+
enterSchemaRegistryAPISecret: 'Enter the Schema Registry API Key Secret'
|
|
60
|
+
};
|
|
61
|
+
const askBundleType = async () => {
|
|
62
|
+
return await (0, _basicPrompts.askList)({
|
|
63
|
+
msg: helpers.agentMessages.selectAgentType,
|
|
64
|
+
choices: [_types.BundleType.ALL_AGENTS, _types.BundleType.DISCOVERY, _types.BundleType.TRACEABILITY]
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
exports.askBundleType = askBundleType;
|
|
68
|
+
const askConfigType = async () => {
|
|
69
|
+
return _types.AgentConfigTypes.DOCKERIZED;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
//
|
|
73
|
+
// Questions for the configuration of Kafka agents
|
|
74
|
+
//
|
|
75
|
+
exports.askConfigType = askConfigType;
|
|
76
|
+
const askIsCloudEnabled = async () => {
|
|
77
|
+
const deploymentType = await (0, _basicPrompts.askList)({
|
|
78
|
+
msg: prompts.deploymentTypeMsg,
|
|
79
|
+
default: DeploymentTypes.CONFLUENT_CLOUD,
|
|
80
|
+
choices: [{
|
|
81
|
+
name: DeploymentTypes.CONFLUENT_CLOUD,
|
|
82
|
+
value: DeploymentTypes.CONFLUENT_CLOUD
|
|
83
|
+
}, {
|
|
84
|
+
name: DeploymentTypes.CONFLUENT_PLATFORM,
|
|
85
|
+
value: DeploymentTypes.CONFLUENT_PLATFORM
|
|
86
|
+
}]
|
|
87
|
+
});
|
|
88
|
+
return deploymentType == DeploymentTypes.CONFLUENT_CLOUD;
|
|
89
|
+
};
|
|
90
|
+
exports.askIsCloudEnabled = askIsCloudEnabled;
|
|
91
|
+
const askEnvironmentId = async () => await (0, _basicPrompts.askInput)({
|
|
92
|
+
msg: prompts.enterEnvironmentId
|
|
93
|
+
});
|
|
94
|
+
const askClusterId = async () => await (0, _basicPrompts.askInput)({
|
|
95
|
+
msg: prompts.enterClusterId
|
|
96
|
+
});
|
|
97
|
+
const askCloudAPIKey = async () => await (0, _basicPrompts.askInput)({
|
|
98
|
+
msg: prompts.enterCloudAPIKey
|
|
99
|
+
});
|
|
100
|
+
const askCloudAPISecret = async () => await (0, _basicPrompts.askInput)({
|
|
101
|
+
msg: prompts.enterCloudAPISecret
|
|
102
|
+
});
|
|
103
|
+
const askClusterServer = async () => await (0, _basicPrompts.askInput)({
|
|
104
|
+
msg: prompts.enterClusterServer,
|
|
105
|
+
validate: (0, _basicPrompts.validateRegex)(helpers.KafkaRegexPatterns.bootstrapServerRegex, helpers.invalidValueExampleErrMsg('Bootstrap Server Name', 'SASL_SSL://somehost.testdomain.com:9092'))
|
|
106
|
+
});
|
|
107
|
+
const askClusterAPIKey = async () => await (0, _basicPrompts.askInput)({
|
|
108
|
+
msg: prompts.enterClusterAPIKey
|
|
109
|
+
});
|
|
110
|
+
const askClusterAPISecret = async () => await (0, _basicPrompts.askInput)({
|
|
111
|
+
msg: prompts.enterClusterAPISecret
|
|
112
|
+
});
|
|
113
|
+
const askSaslMechanism = async () => {
|
|
114
|
+
return await (0, _basicPrompts.askList)({
|
|
115
|
+
msg: prompts.saslMechanismMsg,
|
|
116
|
+
default: SaslMechanismTypes.PLAIN,
|
|
117
|
+
choices: [{
|
|
118
|
+
name: SaslMechanismTypes.NONE,
|
|
119
|
+
value: SaslMechanismTypes.NONE
|
|
120
|
+
}, {
|
|
121
|
+
name: SaslMechanismTypes.PLAIN,
|
|
122
|
+
value: SaslMechanismTypes.PLAIN
|
|
123
|
+
}, {
|
|
124
|
+
name: SaslMechanismTypes.SCRAM_SHA_256,
|
|
125
|
+
value: SaslMechanismTypes.SCRAM_SHA_256
|
|
126
|
+
}, {
|
|
127
|
+
name: SaslMechanismTypes.SCRAM_SHA_512,
|
|
128
|
+
value: SaslMechanismTypes.SCRAM_SHA_512
|
|
129
|
+
}]
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
exports.askSaslMechanism = askSaslMechanism;
|
|
133
|
+
const askSaslUsername = async () => await (0, _basicPrompts.askInput)({
|
|
134
|
+
msg: prompts.enterSaslUsername
|
|
135
|
+
});
|
|
136
|
+
const askSaslPassword = async () => await (0, _basicPrompts.askInput)({
|
|
137
|
+
msg: prompts.enterSaslPassword
|
|
138
|
+
});
|
|
139
|
+
const askIsSchemaRegistryEnabled = async () => {
|
|
140
|
+
const enabled = await (0, _basicPrompts.askList)({
|
|
141
|
+
msg: prompts.schemaRegistryEnabledMsg,
|
|
142
|
+
default: _types.YesNo.Yes,
|
|
143
|
+
choices: _types.YesNoChoices
|
|
144
|
+
});
|
|
145
|
+
return enabled == _types.YesNo.Yes;
|
|
146
|
+
};
|
|
147
|
+
const askIsSchemaRegistryAuthEnabled = async () => {
|
|
148
|
+
const enabled = await (0, _basicPrompts.askList)({
|
|
149
|
+
msg: prompts.schemaRegistryAuthEnabled,
|
|
150
|
+
default: _types.YesNo.Yes,
|
|
151
|
+
choices: _types.YesNoChoices
|
|
152
|
+
});
|
|
153
|
+
return enabled == _types.YesNo.Yes;
|
|
154
|
+
};
|
|
155
|
+
exports.askIsSchemaRegistryAuthEnabled = askIsSchemaRegistryAuthEnabled;
|
|
156
|
+
const askSchemaRegistryUrl = async () => await (0, _basicPrompts.askInput)({
|
|
157
|
+
msg: prompts.enterSchemaRegistryUrl,
|
|
158
|
+
validate: (0, _basicPrompts.validateRegex)(helpers.KafkaRegexPatterns.schemaRegistryURLRegex, helpers.invalidValueExampleErrMsg('Schema Registry Url', 'https://www.testdomain.com'))
|
|
159
|
+
});
|
|
160
|
+
const askSchemaRegistryAPIKey = async () => await (0, _basicPrompts.askInput)({
|
|
161
|
+
msg: prompts.enterSchemaRegistryAPIKey
|
|
162
|
+
});
|
|
163
|
+
const askSchemaRegistryAPISecret = async () => await (0, _basicPrompts.askInput)({
|
|
164
|
+
msg: prompts.enterSchemaRegistryAPISecret
|
|
165
|
+
});
|
|
166
|
+
const gatewayConnectivity = async installConfig => {
|
|
167
|
+
const kafkaAgentValues = new _kafkaTemplates.KafkaAgentValues();
|
|
168
|
+
kafkaAgentValues.cloudEnabled = await askIsCloudEnabled();
|
|
169
|
+
if (kafkaAgentValues.cloudEnabled) {
|
|
170
|
+
kafkaAgentValues.cloudEnvironmentId = await askEnvironmentId();
|
|
171
|
+
kafkaAgentValues.cloudClusterId = await askClusterId();
|
|
172
|
+
kafkaAgentValues.cloudAPIKey = await askCloudAPIKey();
|
|
173
|
+
kafkaAgentValues.cloudAPISecret = await askCloudAPISecret();
|
|
174
|
+
kafkaAgentValues.clusterAPIKey = await askClusterAPIKey();
|
|
175
|
+
kafkaAgentValues.clusterAPISecret = await askClusterAPISecret();
|
|
176
|
+
} else {
|
|
177
|
+
kafkaAgentValues.clusterServer = await askClusterServer();
|
|
178
|
+
kafkaAgentValues.clusterSaslMechanism = await askSaslMechanism();
|
|
179
|
+
if (kafkaAgentValues.clusterSaslMechanism !== SaslMechanismTypes.NONE) {
|
|
180
|
+
kafkaAgentValues.clusterSaslUser = await askSaslUsername();
|
|
181
|
+
kafkaAgentValues.clusterSaslPassword = await askSaslPassword();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (installConfig.switches.isDaEnabled) {
|
|
185
|
+
if (kafkaAgentValues.cloudEnabled) {
|
|
186
|
+
kafkaAgentValues.schemaRegistryAPIKey = await askSchemaRegistryAPIKey();
|
|
187
|
+
kafkaAgentValues.schemaRegistryAPISecret = await askSchemaRegistryAPISecret();
|
|
188
|
+
} else {
|
|
189
|
+
kafkaAgentValues.schemaRegistryEnabled = await askIsSchemaRegistryEnabled();
|
|
190
|
+
if (kafkaAgentValues.schemaRegistryEnabled) {
|
|
191
|
+
kafkaAgentValues.schemaRegistryUrl = await askSchemaRegistryUrl();
|
|
192
|
+
kafkaAgentValues.schemaRegistryAuthEnabled = await askIsSchemaRegistryAuthEnabled();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return kafkaAgentValues;
|
|
197
|
+
};
|
|
198
|
+
exports.gatewayConnectivity = gatewayConnectivity;
|
|
199
|
+
const generateSuccessHelpMsg = installConfig => {
|
|
200
|
+
if (installConfig.centralConfig.ampcDosaInfo.isNew && !installConfig.switches.isHelmInstall) {
|
|
201
|
+
console.log(_chalk.default.yellow('\nPlease make sure to copy the "private_key.pem" and "public_key.pem" files for the existing service account you selected.'));
|
|
202
|
+
}
|
|
203
|
+
dockerSuccessMsg(installConfig);
|
|
204
|
+
console.log(_chalk.default.gray(`\nAdditional information about agent features can be found here:\n${helpers.agentsDocsUrl.AZURE}`));
|
|
205
|
+
};
|
|
206
|
+
const dockerSuccessMsg = installConfig => {
|
|
207
|
+
let dockerInfo;
|
|
208
|
+
const runDaLinuxMsg = `docker run -it --env-file ${helpers.pwd}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
|
|
209
|
+
const runDaWinMsg = `docker run -it --env-file ${helpers.pwdWin}/${helpers.configFiles.DA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
|
|
210
|
+
const runTaLinuxMsg = `docker run -it --env-file ${helpers.pwd}/${helpers.configFiles.TA_ENV_VARS} -v ${helpers.pwd}:/keys ${helpers.eolChar}`;
|
|
211
|
+
const runTaWinMsg = `docker run -it --env-file ${helpers.pwdWin}/${helpers.configFiles.TA_ENV_VARS} -v ${helpers.pwdWin}:/keys ${helpers.eolCharWin}`;
|
|
212
|
+
const startDaLinuxMsg = `\nStart the Discovery Agent on a Linux based machine`;
|
|
213
|
+
const startDaWinMsg = `\nStart the Discovery Agent on a Windows machine`;
|
|
214
|
+
const startTaLinuxMsg = `\nStart the Traceability Agent on a Linux based machine`;
|
|
215
|
+
const startTaWinMsg = `\nStart the Traceability Agent on a Windows machine`;
|
|
216
|
+
if (installConfig.switches.isDaEnabled && installConfig.switches.isTaEnabled) {
|
|
217
|
+
dockerInfo = `To utilize the agents, pull the latest Docker images and run them using the appropriate supplied environment files, (${helpers.configFiles.DA_ENV_VARS} & ${helpers.configFiles.TA_ENV_VARS}):`;
|
|
218
|
+
} else if (installConfig.switches.isDaEnabled) {
|
|
219
|
+
dockerInfo = `To utilize the discovery agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.DA_ENV_VARS}):`;
|
|
220
|
+
} else {
|
|
221
|
+
dockerInfo = `To utilize the traceability agent, pull the latest Docker image and run it using the supplied environment file, (${helpers.configFiles.TA_ENV_VARS}):`;
|
|
222
|
+
}
|
|
223
|
+
console.log(_chalk.default.whiteBright(dockerInfo), '\n');
|
|
224
|
+
if (installConfig.switches.isDaEnabled) {
|
|
225
|
+
const daImageVersion = `${daImage}:${installConfig.daVersion}`;
|
|
226
|
+
console.log(_chalk.default.white('Pull the latest image of the Discovery Agent:'));
|
|
227
|
+
console.log(_chalk.default.cyan(`docker pull ${daImageVersion}`));
|
|
228
|
+
console.log(_chalk.default.white(_utils.isWindows ? startDaWinMsg : startDaLinuxMsg));
|
|
229
|
+
console.log(_chalk.default.cyan(_utils.isWindows ? runDaWinMsg : runDaLinuxMsg));
|
|
230
|
+
console.log('\t', _chalk.default.cyan(`-v /data ${daImageVersion}`), '\n');
|
|
231
|
+
}
|
|
232
|
+
if (installConfig.switches.isTaEnabled) {
|
|
233
|
+
const taImageVersion = `${taImage}:${installConfig.taVersion}`;
|
|
234
|
+
console.log(_chalk.default.white('Pull the latest image of the Traceability Agent:'));
|
|
235
|
+
console.log(_chalk.default.cyan(`docker pull ${taImageVersion}`));
|
|
236
|
+
console.log(_chalk.default.white(_utils.isWindows ? startTaWinMsg : startTaLinuxMsg));
|
|
237
|
+
console.log(_chalk.default.cyan(_utils.isWindows ? runTaWinMsg : runTaLinuxMsg));
|
|
238
|
+
console.log('\t', _chalk.default.cyan(`-v /data ${taImageVersion}`), '\n');
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
const completeInstall = async installConfig => {
|
|
242
|
+
// Add final settings to kafkaAgentsValues
|
|
243
|
+
const kafkaAgentValues = installConfig.gatewayConfig;
|
|
244
|
+
kafkaAgentValues.centralConfig = installConfig.centralConfig;
|
|
245
|
+
kafkaAgentValues.traceabilityConfig = installConfig.traceabilityConfig;
|
|
246
|
+
console.log('Generating the configuration file(s)...');
|
|
247
|
+
if (installConfig.switches.isDaEnabled) {
|
|
248
|
+
(0, _utils.writeTemplates)(ConfigFiles.DAEnvVars, kafkaAgentValues, helpers.kafkaDAEnvVarTemplate);
|
|
249
|
+
}
|
|
250
|
+
if (installConfig.switches.isTaEnabled) {
|
|
251
|
+
(0, _utils.writeTemplates)(ConfigFiles.TAEnvVars, kafkaAgentValues, helpers.kafkaTAEnvVarTemplate);
|
|
252
|
+
}
|
|
253
|
+
console.log('Configuration file(s) have been successfully created.\n');
|
|
254
|
+
generateSuccessHelpMsg(installConfig);
|
|
255
|
+
};
|
|
256
|
+
exports.completeInstall = completeInstall;
|
|
257
|
+
const KafkaInstallMethods = exports.KafkaInstallMethods = {
|
|
258
|
+
GetBundleType: askBundleType,
|
|
259
|
+
GetDeploymentType: askConfigType,
|
|
260
|
+
AskGatewayQuestions: gatewayConnectivity,
|
|
261
|
+
FinalizeGatewayInstall: completeInstall,
|
|
262
|
+
ConfigFiles: Object.values(ConfigFiles),
|
|
263
|
+
AgentNameMap: {
|
|
264
|
+
[_types.AgentTypes.da]: _types.AgentNames.KAFKA_DA,
|
|
265
|
+
[_types.AgentTypes.ta]: _types.AgentNames.KAFKA_TA
|
|
266
|
+
},
|
|
267
|
+
GatewayDisplay: _types.GatewayTypes.KAFKA
|
|
268
|
+
};
|
|
269
|
+
const testables = exports.testables = {
|
|
270
|
+
prompts,
|
|
271
|
+
ConfigFiles
|
|
272
|
+
};
|
|
@@ -47,14 +47,16 @@ const getTraceabilityConfig = async installConfig => {
|
|
|
47
47
|
// Do not ask Traceability questions in offline mode
|
|
48
48
|
if (!traceabilityConfig.usageReportingOffline) {
|
|
49
49
|
console.log('\nCONNECTION TO TRACEABILITY MODULE:');
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
if (installConfig.gatewayType !== _types.GatewayTypes.KAFKA) {
|
|
51
|
+
const {
|
|
52
|
+
enabled,
|
|
53
|
+
samplingPercentage,
|
|
54
|
+
shouldReportAllErrors
|
|
55
|
+
} = await helpers.askToEnableTransactionLogging();
|
|
56
|
+
traceabilityConfig.enabled = enabled;
|
|
57
|
+
traceabilityConfig.samplingPercentage = samplingPercentage;
|
|
58
|
+
traceabilityConfig.samplingReportAllErrors = shouldReportAllErrors;
|
|
59
|
+
}
|
|
58
60
|
const traceabilityProtocol = await helpers.askIngestionProtocol();
|
|
59
61
|
traceabilityConfig.protocol = traceabilityProtocol;
|
|
60
62
|
traceabilityConfig.host = helpers.getIngestionHost(installConfig.centralConfig.region, _CoreConfigController.CoreConfigController.getEnv(), installConfig.centralConfig.deployment, traceabilityProtocol);
|
|
@@ -64,7 +64,7 @@ const getBaseUrl = async (baseUrl, basePath, region, orgRegion) => {
|
|
|
64
64
|
const configuredRegion = String(region || configRegion || orgRegion || _types.Regions.US).toUpperCase();
|
|
65
65
|
log(`Using region "${configuredRegion}" from ${region ? '--region' : configRegion ? 'config' : orgRegion ? 'org' : 'default'}`);
|
|
66
66
|
const prodBaseurl = _types.ProdBaseUrls[configuredRegion];
|
|
67
|
-
if (!prodBaseurl) throw Error('Unknown region provided, check your region config, should be one of:
|
|
67
|
+
if (!prodBaseurl) throw Error('Unknown region provided, check your region config, should be one of: ' + Object.keys(_types.ProdBaseUrls).join(", "));
|
|
68
68
|
return basePath ? prodBaseurl + basePath : prodBaseurl;
|
|
69
69
|
}
|
|
70
70
|
};
|
package/dist/common/types.js
CHANGED
|
@@ -221,6 +221,8 @@ let AgentNames = exports.AgentNames = /*#__PURE__*/function (AgentNames) {
|
|
|
221
221
|
AgentNames["AZURE_TA"] = "azure-traceability-agent";
|
|
222
222
|
AgentNames["EDGE_DA"] = "v7-discovery-agent";
|
|
223
223
|
AgentNames["EDGE_TA"] = "v7-traceability-agent";
|
|
224
|
+
AgentNames["KAFKA_DA"] = "kafka-discovery-agent";
|
|
225
|
+
AgentNames["KAFKA_TA"] = "kafka-traceability-agent";
|
|
224
226
|
return AgentNames;
|
|
225
227
|
}({});
|
|
226
228
|
let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
|
|
@@ -232,6 +234,7 @@ let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
|
|
|
232
234
|
GatewayTypes["GITLAB"] = "GitLab";
|
|
233
235
|
GatewayTypes["ISTIO"] = "Istio";
|
|
234
236
|
GatewayTypes["EDGE_GATEWAY_ONLY"] = "Amplify API Gateway only";
|
|
237
|
+
GatewayTypes["KAFKA"] = "Kafka";
|
|
235
238
|
return GatewayTypes;
|
|
236
239
|
}({});
|
|
237
240
|
let SaaSGatewayTypes = exports.SaaSGatewayTypes = /*#__PURE__*/function (SaaSGatewayTypes) {
|
|
@@ -247,6 +250,7 @@ let DataPlaneNames = exports.DataPlaneNames = /*#__PURE__*/function (DataPlaneNa
|
|
|
247
250
|
DataPlaneNames["GITLAB"] = "GitLab";
|
|
248
251
|
DataPlaneNames["AZURE"] = "Azure";
|
|
249
252
|
DataPlaneNames["EDGE"] = "Edge";
|
|
253
|
+
DataPlaneNames["KAFKA"] = "Kafka";
|
|
250
254
|
DataPlaneNames["KONG"] = "Kong";
|
|
251
255
|
DataPlaneNames["MULESOFT"] = "Mulesoft";
|
|
252
256
|
DataPlaneNames["WSO2"] = "WSO2";
|
|
@@ -261,7 +265,8 @@ const GatewayTypeToDataPlane = exports.GatewayTypeToDataPlane = {
|
|
|
261
265
|
[GatewayTypes.GITLAB]: DataPlaneNames.GITLAB,
|
|
262
266
|
[GatewayTypes.AZURE_GATEWAY]: DataPlaneNames.AZURE,
|
|
263
267
|
[GatewayTypes.ISTIO]: 'Istio',
|
|
264
|
-
[GatewayTypes.APIGEEX_GATEWAY]: DataPlaneNames.APIGEE
|
|
268
|
+
[GatewayTypes.APIGEEX_GATEWAY]: DataPlaneNames.APIGEE,
|
|
269
|
+
[GatewayTypes.KAFKA]: DataPlaneNames.KAFKA
|
|
265
270
|
};
|
|
266
271
|
let AgentResourceKind = exports.AgentResourceKind = /*#__PURE__*/function (AgentResourceKind) {
|
|
267
272
|
AgentResourceKind["da"] = "DiscoveryAgent";
|
package/package.json
CHANGED
package/da.yaml
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
---
|
|
3
|
-
group: management
|
|
4
|
-
apiVersion: v1alpha1
|
|
5
|
-
kind: DiscoveryAgent
|
|
6
|
-
name: aws-discovery-agent
|
|
7
|
-
title: AWS Discovery Agent
|
|
8
|
-
metadata:
|
|
9
|
-
id: 8ac989a48947da6401894b06933a0008
|
|
10
|
-
audit:
|
|
11
|
-
createTimestamp: 2023-07-12T16:54:29.434+0000
|
|
12
|
-
createUserId: 821ba748-459f-45b0-ab87-82d11052975a
|
|
13
|
-
modifyTimestamp: 2023-07-12T16:54:30.276+0000
|
|
14
|
-
scope:
|
|
15
|
-
id: 8ac989a48947da6401894b068b940000
|
|
16
|
-
kind: Environment
|
|
17
|
-
name: aws-cli
|
|
18
|
-
title: aws-cli
|
|
19
|
-
selfLink: /management/v1alpha1/environments/aws-cli
|
|
20
|
-
acl: []
|
|
21
|
-
accessRights:
|
|
22
|
-
canChangeOwner: true
|
|
23
|
-
canDelete: true
|
|
24
|
-
canWrite: true
|
|
25
|
-
canRead: true
|
|
26
|
-
resourceVersion: '3'
|
|
27
|
-
references:
|
|
28
|
-
- id: 8ac989a48947da6401894b068d870002
|
|
29
|
-
kind: Dataplane
|
|
30
|
-
name: aws-dataplane
|
|
31
|
-
scopeKind: Environment
|
|
32
|
-
scopeName: aws-cli
|
|
33
|
-
selfLink: /management/v1alpha1/environments/aws-cli/dataplanes/aws-dataplane
|
|
34
|
-
type: soft
|
|
35
|
-
group: management
|
|
36
|
-
selfLink: >-
|
|
37
|
-
/management/v1alpha1/environments/aws-cli/discoveryagents/aws-discovery-agent
|
|
38
|
-
attributes: {}
|
|
39
|
-
finalizers: []
|
|
40
|
-
tags: []
|
|
41
|
-
spec:
|
|
42
|
-
config:
|
|
43
|
-
owningTeam: Default Team
|
|
44
|
-
dataplaneType: AWS
|
|
45
|
-
dataplane:
|
|
46
|
-
name: aws-dataplane
|
|
47
|
-
queueDiscovery: true
|