@axway/axway-central-cli 2.3.0-rc.0 → 2.3.0-rc.4

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.testables = exports.prompts = exports.installPreprocess = exports.gatewayConnectivity = exports.dockerPublicKey = exports.dockerPrivateKey = exports.defaultLogFiles = exports.completeInstall = exports.askIsGatewayOnlyMode = exports.askConfigType = exports.askBundleTypeGWOnly = exports.askBundleType = exports.EdgeInstallMethods = exports.EdgeGWOnlyInstallMethods = exports.ConfigFiles = void 0;
6
+ exports.testables = exports.prompts = exports.installPreprocess = exports.gatewayConnectivity = exports.dockerPublicKey = exports.dockerPrivateKey = exports.completeInstall = exports.askIsGatewayOnlyMode = exports.askConfigType = exports.askBundleTypeGWOnly = exports.askBundleType = exports.EdgeInstallMethods = exports.EdgeGWOnlyInstallMethods = exports.ConfigFiles = void 0;
7
7
 
8
8
  var _cliKit = require("cli-kit");
9
9
 
@@ -36,7 +36,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
36
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
37
 
38
38
  const defaultLogFiles = '/group-*_instance-*.log';
39
- exports.defaultLogFiles = defaultLogFiles;
39
+ const defaultOTLogFiles = '/group-*_instance-*_traffic*.log';
40
40
  const dockerPrivateKey = '/keys/private_key.pem';
41
41
  exports.dockerPrivateKey = dockerPrivateKey;
42
42
  const dockerPublicKey = '/keys/public_key.pem'; // @ts-ignore
@@ -65,7 +65,9 @@ const prompts = {
65
65
  askApiGatewayPort: 'Enter the API Gateway port',
66
66
  askApiManagerHost: 'Enter the API Manager hostname',
67
67
  askApiManagerPort: 'Enter the API Manager port',
68
+ askLoggingSource: 'What is the source of logging for the traceability agent',
68
69
  askEventsPath: 'Enter the path to the API Gateway event log directory',
70
+ askOpenTrafficPath: 'Enter the path to the API Gateway open traffic log directory',
69
71
  enterGatewayAgentNs: 'Enter the namespace to use for the Amplify Gateway Agents',
70
72
  enterGatewayManagerMode: 'Do you want to use API Manager with the API Gateway'
71
73
  };
@@ -149,10 +151,19 @@ const askConfigType = async () => {
149
151
 
150
152
  exports.askConfigType = askConfigType;
151
153
 
152
- const askEventsPath = async () => {
154
+ const askLoggingSource = async () => {
155
+ console.log(_cliKit.chalk.white(`\nThe API Gateway can provide the API traffic either within event logs or open traffic logs.`));
156
+ return (await (0, _basicPrompts.askList)({
157
+ msg: prompts.askLoggingSource,
158
+ default: _types.LoggingSource.Event,
159
+ choices: [_types.LoggingSource.Event, _types.LoggingSource.OpenTraffic]
160
+ })) === _types.LoggingSource.OpenTraffic;
161
+ };
162
+
163
+ const askEventsPath = async isOpenTraffic => {
153
164
  return await (0, _basicPrompts.askInput)({
154
- msg: prompts.askEventsPath,
155
- defaultValue: '/apigateway/events',
165
+ msg: isOpenTraffic ? prompts.askOpenTrafficPath : prompts.askEventsPath,
166
+ defaultValue: isOpenTraffic ? '/apigateway/logs/opentraffic' : '/apigateway/events',
156
167
  type: 'string'
157
168
  });
158
169
  };
@@ -216,24 +227,28 @@ const gatewayConnectivity = async installConfig => {
216
227
  }
217
228
 
218
229
  if (installConfig.switches.isTaEnabled) {
219
- console.log('\nCONNECTION TO API GATEWAY:');
220
- console.log(_cliKit.chalk.gray(`The traceability agent needs to connect to Axway API Gateway.\n` + `Use the credentials of an Operator user.`));
230
+ v7AgentValues.isOpenTraffic = await askLoggingSource();
221
231
 
222
- if (installConfig.switches.isHelmInstall) {
223
- console.log(_cliKit.chalk.white(`Please use the name of the API Gateway Service as hostname.`));
224
- }
232
+ if (!v7AgentValues.isOpenTraffic) {
233
+ console.log('\nCONNECTION TO API GATEWAY:');
234
+ console.log(_cliKit.chalk.gray(`The traceability agent needs to connect to Axway API Gateway.\n` + `Use the credentials of an Operator user.`));
225
235
 
226
- v7AgentValues.apiGatewayHost = await askApiGatewayHost();
227
- v7AgentValues.apiGatewayPort = await askApiGatewayPort();
228
- const apigwCreds = await (0, _basicPrompts.askUsernameAndPassword)('the API Gateway', 'admin');
229
- v7AgentValues.apiGatewayAuthUser = apigwCreds.username;
230
- v7AgentValues.apiGatewayAuthPass = apigwCreds.password;
236
+ if (installConfig.switches.isHelmInstall) {
237
+ console.log(_cliKit.chalk.white(`Please use the name of the API Gateway Service as hostname.`));
238
+ }
239
+
240
+ v7AgentValues.apiGatewayHost = await askApiGatewayHost();
241
+ v7AgentValues.apiGatewayPort = await askApiGatewayPort();
242
+ const apigwCreds = await (0, _basicPrompts.askUsernameAndPassword)('the API Gateway', 'admin');
243
+ v7AgentValues.apiGatewayAuthUser = apigwCreds.username;
244
+ v7AgentValues.apiGatewayAuthPass = apigwCreds.password;
245
+ }
231
246
 
232
247
  if (installConfig.switches.isBinaryInstall || installConfig.switches.isDockerInstall) {
233
- const eventLogPaths = await askEventsPath();
248
+ const eventLogPaths = await askEventsPath(v7AgentValues.isOpenTraffic);
234
249
  const trimmedDir = eventLogPaths.trim();
235
250
  v7AgentValues.eventLogPath = eventLogPaths ? trimmedDir[trimmedDir.length - 1] === '/' ? `${trimmedDir.slice(0, -1)}` : `${trimmedDir}` : '';
236
- v7AgentValues.eventLogPathTemplate = installConfig.switches.isBinaryInstall ? `${v7AgentValues.eventLogPath}${defaultLogFiles}` : '';
251
+ v7AgentValues.eventLogPathTemplate = installConfig.switches.isBinaryInstall ? `${v7AgentValues.eventLogPath}${v7AgentValues.isOpenTraffic ? defaultOTLogFiles : defaultLogFiles}` : '';
237
252
  }
238
253
  }
239
254
 
@@ -458,6 +473,7 @@ exports.EdgeGWOnlyInstallMethods = EdgeGWOnlyInstallMethods;
458
473
  const testables = {
459
474
  prompts,
460
475
  ConfigFiles,
461
- defaultLogFiles
476
+ defaultLogFiles,
477
+ defaultOTLogFiles
462
478
  };
463
479
  exports.testables = testables;
@@ -51,7 +51,7 @@ const transactionLoggingMessages = {
51
51
  transactionLoggingInfoMsg: 'Transaction logging is optional and not required for usage and metrics logging.\nTurning on transaction logging can have an impact on performance.',
52
52
  enterSamplingPercentage: 'What sampling rate would you like to use? (1-100)',
53
53
  samplingPercentageInfoMsg: 'A sampling rate of 1 will log 1% of transactions, a sampling rate of 100 will log all transactions.\nWe recommend a sampling rate of 1% which can be increased if needed.',
54
- askReportAllErrors: 'Would you like to reports all errors?',
54
+ askReportAllErrors: 'Would you like to report all errors?',
55
55
  reportAllErrorsMsg: 'The agents can take out the error transactions from the sampling rate.'
56
56
  };
57
57
  exports.transactionLoggingMessages = transactionLoggingMessages;
@@ -42,6 +42,8 @@ class V7AgentValues {
42
42
 
43
43
  _defineProperty(this, "isGatewayOnly", void 0);
44
44
 
45
+ _defineProperty(this, "isOpenTraffic", void 0);
46
+
45
47
  _defineProperty(this, "namespace", void 0);
46
48
 
47
49
  _defineProperty(this, "centralConfig", void 0);
@@ -61,6 +63,7 @@ class V7AgentValues {
61
63
  this.eventLogPath = '';
62
64
  this.eventLogPathTemplate = '';
63
65
  this.isGatewayOnly = false;
66
+ this.isOpenTraffic = false;
64
67
  this.namespace = {
65
68
  name: '',
66
69
  isNew: false
@@ -86,6 +89,7 @@ APIMANAGER_HOST={{apiManagerHost}}
86
89
  APIMANAGER_PORT={{apiManagerPort}}
87
90
 
88
91
  {{/unless}}
92
+ {{#unless isOpenTraffic}}
89
93
  # API Gateway configs
90
94
  APIGATEWAY_AUTH_PASSWORD={{apiGatewayAuthPass}}
91
95
  APIGATEWAY_AUTH_USERNAME={{apiGatewayAuthUser}}
@@ -94,11 +98,19 @@ APIGATEWAY_PORT={{apiGatewayPort}}
94
98
  {{#if isGatewayOnly}}
95
99
  APIGATEWAY_ONLY={{isGatewayOnly}}
96
100
  {{/if}}
101
+ {{/unless}}
97
102
  {{#if eventLogPathTemplate}}
103
+ {{#if isOpenTraffic}}
104
+ # API Gateway open traffic logs
105
+ EVENT_LOG_INPUT=false
106
+ OPENTRAFFIC_LOG_INPUT=true
107
+ OPENTRAFFIC_LOG_PATHS={{eventLogPathTemplate}}
108
+ {{else}}
98
109
 
99
110
  # API Gateway event logs
100
111
  EVENT_LOG_PATHS={{eventLogPathTemplate}}
101
112
  {{/if}}
113
+ {{/if}}
102
114
 
103
115
  # Amplify Central configs
104
116
  {{#if traceabilityConfig.usageReportingOffline}}
@@ -55,7 +55,7 @@ class ApiCentralClient {
55
55
  });
56
56
  const payload = {
57
57
  generateKeypair: false,
58
- pemEncodedPublicKey: publicKey.replace(/(\r\n)/gm, ''),
58
+ pemEncodedPublicKey: publicKey.replace(/(\r\n)/gm, '\n'),
59
59
  serviceAccountName: accountName,
60
60
  serviceAccountType: 'DOSA'
61
61
  };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.docsUrl = exports.defaultClientId = exports.commonCmdArgsDescription = exports.cliVersionHeader = exports.YesNoChoices = exports.YesNo = exports.WAIT_TIMEOUT = exports.TrueFalseChoices = exports.TrueFalse = exports.TraceabilityConfig = exports.Regions = exports.PublicRepoUrl = exports.PublicDockerRepoBaseUrl = exports.Protocol = exports.ProdBaseUrls = exports.Platforms = exports.OutputTypes = exports.MAX_FILE_SIZE = exports.MAX_CACHE_FILE_SIZE = exports.KindTypes = exports.Kind = exports.IstioInstallValues = exports.IstioAgentValues = exports.IngestionProtocolToHosts = exports.IngestionProtocol = exports.IngestionHostsHTTP = exports.IngestionHosts = exports.IngestionHTTPHosts = exports.GatewayTypes = exports.GatewayTypeToDataPlane = exports.GatewayMode = exports.EnvironmentConfigInfo = exports.DosaAccount = exports.DataPlaneNames = exports.DOSAConfigInfo = exports.ConfigTypes = exports.CloudFormationConfig = exports.Certificate = exports.CentralAgentConfig = exports.CACHE_FILE_TTL_MILLISECONDS = exports.BundleType = exports.BasePaths = exports.AuthUrls = exports.AgentTypes = exports.AgentResourceKind = exports.AgentNames = exports.AgentInstallSwitches = exports.AgentInstallConfig = exports.AgentConfigTypes = exports.APICDeployments = exports.ABORT_TIMEOUT = void 0;
6
+ exports.docsUrl = exports.defaultClientId = exports.commonCmdArgsDescription = exports.cliVersionHeader = exports.YesNoChoices = exports.YesNo = exports.WAIT_TIMEOUT = exports.TrueFalseChoices = exports.TrueFalse = exports.TraceabilityConfig = exports.Regions = exports.PublicRepoUrl = exports.PublicDockerRepoBaseUrl = exports.Protocol = exports.ProdBaseUrls = exports.Platforms = exports.OutputTypes = exports.MAX_FILE_SIZE = exports.MAX_CACHE_FILE_SIZE = exports.LoggingSource = exports.KindTypes = exports.Kind = exports.IstioInstallValues = exports.IstioAgentValues = exports.IngestionProtocolToHosts = exports.IngestionProtocol = exports.IngestionHostsHTTP = exports.IngestionHosts = exports.IngestionHTTPHosts = exports.GatewayTypes = exports.GatewayTypeToDataPlane = exports.GatewayMode = exports.EnvironmentConfigInfo = exports.DosaAccount = exports.DataPlaneNames = exports.DOSAConfigInfo = exports.ConfigTypes = exports.CloudFormationConfig = exports.Certificate = exports.CentralAgentConfig = exports.CACHE_FILE_TTL_MILLISECONDS = exports.BundleType = exports.BasePaths = exports.AuthUrls = exports.AgentTypes = exports.AgentResourceKind = exports.AgentNames = exports.AgentInstallSwitches = exports.AgentInstallConfig = exports.AgentConfigTypes = exports.APICDeployments = exports.ABORT_TIMEOUT = void 0;
7
7
 
8
8
  var _dataService = require("./dataService");
9
9
 
@@ -223,6 +223,14 @@ exports.GatewayMode = GatewayMode;
223
223
  GatewayMode["GatewayOnlyMode"] = "Gateway only";
224
224
  })(GatewayMode || (exports.GatewayMode = GatewayMode = {}));
225
225
 
226
+ let LoggingSource;
227
+ exports.LoggingSource = LoggingSource;
228
+
229
+ (function (LoggingSource) {
230
+ LoggingSource["Event"] = "event";
231
+ LoggingSource["OpenTraffic"] = "open traffic";
232
+ })(LoggingSource || (exports.LoggingSource = LoggingSource = {}));
233
+
226
234
  let BundleType;
227
235
  exports.BundleType = BundleType;
228
236
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "2.3.0-rc.0",
3
+ "version": "2.3.0-rc.4",
4
4
  "description": "Manage APIs, services and publish to the Unified Catalog",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {