@axway/axway-central-cli 2.21.0 → 2.23.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
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.
|
|
@@ -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
|
|
@@ -38,8 +38,8 @@ const agentMessages = exports.agentMessages = {
|
|
|
38
38
|
const transactionLoggingMessages = exports.transactionLoggingMessages = {
|
|
39
39
|
askToEnableLogging: 'Would you like to enable transaction logging?',
|
|
40
40
|
transactionLoggingInfoMsg: 'Transaction logging is optional and not required for usage and metrics logging.\nTurning on transaction logging can have an impact on performance.',
|
|
41
|
-
enterSamplingPercentage: 'What sampling rate would you like to use? (1-
|
|
42
|
-
samplingPercentageInfoMsg: 'A sampling rate of 1 will log 1% of transactions, a sampling rate of
|
|
41
|
+
enterSamplingPercentage: 'What sampling rate would you like to use? (1-10)',
|
|
42
|
+
samplingPercentageInfoMsg: 'A sampling rate of 1 will log 1% of transactions, a sampling rate of 10 will log 10% of all transactions.\nWe recommend a sampling rate of 1% which can be increased if needed.',
|
|
43
43
|
askReportAllErrors: 'Would you like to report all errors?',
|
|
44
44
|
reportAllErrorsMsg: 'The agents can take out the error transactions from the sampling rate.'
|
|
45
45
|
};
|
|
@@ -373,11 +373,11 @@ const askToEnableTransactionLogging = async () => {
|
|
|
373
373
|
console.log(_chalk.default.gray(transactionLoggingMessages.samplingPercentageInfoMsg));
|
|
374
374
|
const samplingPercentage = await (0, _basicPrompts.askInput)({
|
|
375
375
|
msg: transactionLoggingMessages.enterSamplingPercentage,
|
|
376
|
-
defaultValue:
|
|
376
|
+
defaultValue: 1,
|
|
377
377
|
validate: (0, _basicPrompts.runValidations)((0, _basicPrompts.validateRegex)(_regex.percentageRegex, _regex.invalidPercentage))
|
|
378
378
|
});
|
|
379
379
|
let shouldReportAllErrors = _types.YesNo.Yes;
|
|
380
|
-
if (samplingPercentage <
|
|
380
|
+
if (samplingPercentage < 10) {
|
|
381
381
|
console.log(_chalk.default.gray(transactionLoggingMessages.reportAllErrorsMsg));
|
|
382
382
|
shouldReportAllErrors = await (0, _basicPrompts.askList)({
|
|
383
383
|
msg: transactionLoggingMessages.askReportAllErrors,
|
|
@@ -8,10 +8,10 @@ const resourceRegex = exports.resourceRegex = '^(?:[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,}$';
|
|
10
10
|
const dosaRegex = exports.dosaRegex = '^[\\w\\s-()[\\]]{1,100}$';
|
|
11
|
-
const percentageRegex = exports.percentageRegex = '^[1-9]
|
|
11
|
+
const percentageRegex = exports.percentageRegex = '^[1-9]$|10$';
|
|
12
12
|
const frequencyRegex = exports.frequencyRegex = '^(\\d*[d])?(\\d*[h])?(\\d*[m])?$|^$';
|
|
13
13
|
const maskingRegex = exports.maskingRegex = '^[a-zA-Z0-9-*#^~.{}]{0,5}$';
|
|
14
|
-
const invalidPercentage = exports.invalidPercentage = 'Percentage must be an integer between 1-
|
|
14
|
+
const invalidPercentage = exports.invalidPercentage = 'Percentage must be an integer between 1-10';
|
|
15
15
|
const invalidDosaName = exports.invalidDosaName = 'Account name can contain A-z 0-9 _ - ( ) [ ] and can include 1-100 characters.';
|
|
16
16
|
const invalidNamespace = exports.invalidNamespace = `Namespace must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character, and be fewer than 100 characters long.`;
|
|
17
17
|
const invalidDomainName = exports.invalidDomainName = 'The host must be valid according to RFC 1123 specification';
|
|
@@ -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,12 @@ 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: '^[
|
|
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
60
|
};
|
|
@@ -69,7 +69,7 @@ const validateValueRange = (lowerLimit, upperLimit) => input => {
|
|
|
69
69
|
if (isNaN(inputNum)) {
|
|
70
70
|
return 'Please provide a number.';
|
|
71
71
|
}
|
|
72
|
-
let msg =
|
|
72
|
+
let msg = '';
|
|
73
73
|
if (typeof lowerLimit !== undefined && typeof upperLimit !== undefined) {
|
|
74
74
|
msg = `Please provide a number from ${lowerLimit} to ${upperLimit}`;
|
|
75
75
|
} else if (typeof lowerLimit !== undefined) {
|
package/dist/common/types.js
CHANGED
|
@@ -443,7 +443,7 @@ class TraceabilityConfig {
|
|
|
443
443
|
_defineProperty(this, "usageReportingOffline", void 0);
|
|
444
444
|
this.host = IngestionHosts.US;
|
|
445
445
|
this.protocol = IngestionProtocol.Lumberjack;
|
|
446
|
-
this.samplingPercentage =
|
|
446
|
+
this.samplingPercentage = 10;
|
|
447
447
|
this.enabled = true;
|
|
448
448
|
this.samplingReportAllErrors = true;
|
|
449
449
|
this.usageReportingOffline = false;
|