@axway/axway-central-cli 2.23.0-rc.3 → 2.23.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,6 +229,50 @@ 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
|
+
|
|
232
276
|
## GET
|
|
233
277
|
|
|
234
278
|
Prints a table of the most important information about the specified resources.
|
|
@@ -37,7 +37,7 @@ class Sampling {
|
|
|
37
37
|
constructor() {
|
|
38
38
|
_defineProperty(this, "percentage", void 0);
|
|
39
39
|
_defineProperty(this, "allErrors", void 0);
|
|
40
|
-
this.percentage =
|
|
40
|
+
this.percentage = 1;
|
|
41
41
|
this.allErrors = true;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -248,12 +248,12 @@ const askForRedaction = async hostedAgentValues => {
|
|
|
248
248
|
const askForSampling = async hostedAgentValues => {
|
|
249
249
|
// ask sampling percentage
|
|
250
250
|
console.log(_chalk.default.gray("\nSampling settings"));
|
|
251
|
-
console.log(_chalk.default.gray("Sampling percentage can be a value from 0 to
|
|
251
|
+
console.log(_chalk.default.gray("Sampling percentage can be a value from 0 to 10"));
|
|
252
252
|
hostedAgentValues.sampling.percentage = await (0, _basicPrompts.askInput)({
|
|
253
253
|
type: "number",
|
|
254
254
|
msg: SaasPrompts.SAMP_PERCENTAGE,
|
|
255
|
-
defaultValue:
|
|
256
|
-
validate: (0, _basicPrompts.validateValueRange)(0,
|
|
255
|
+
defaultValue: 1,
|
|
256
|
+
validate: (0, _basicPrompts.validateValueRange)(0, 10)
|
|
257
257
|
});
|
|
258
258
|
|
|
259
259
|
// ask sampling all errorsSN
|
|
@@ -37,12 +37,10 @@ class GitHubDataplaneConfig extends DataplaneConfig {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
class GitHubFilterConfig {
|
|
40
|
-
constructor(paths,
|
|
40
|
+
constructor(paths, pattern) {
|
|
41
41
|
_defineProperty(this, "paths", void 0);
|
|
42
|
-
_defineProperty(this, "branch", void 0);
|
|
43
42
|
_defineProperty(this, "pattern", void 0);
|
|
44
43
|
this.paths = paths;
|
|
45
|
-
this.branch = branch;
|
|
46
44
|
this.pattern = pattern;
|
|
47
45
|
}
|
|
48
46
|
}
|
|
@@ -55,7 +53,6 @@ class SaasAgentValues {
|
|
|
55
53
|
_defineProperty(this, "centralConfig", void 0);
|
|
56
54
|
_defineProperty(this, "repositoryOwner", void 0);
|
|
57
55
|
_defineProperty(this, "repositoryName", void 0);
|
|
58
|
-
_defineProperty(this, "repositoryBranch", void 0);
|
|
59
56
|
_defineProperty(this, "filePaths", void 0);
|
|
60
57
|
_defineProperty(this, "filePatterns", void 0);
|
|
61
58
|
this.frequencyDA = '';
|
|
@@ -65,7 +62,6 @@ class SaasAgentValues {
|
|
|
65
62
|
this.centralConfig = new _types.CentralAgentConfig();
|
|
66
63
|
this.repositoryOwner = '';
|
|
67
64
|
this.repositoryName = '';
|
|
68
|
-
this.repositoryBranch = '';
|
|
69
65
|
this.filePaths = [];
|
|
70
66
|
this.filePatterns = [];
|
|
71
67
|
}
|
|
@@ -92,7 +88,6 @@ const SaasPrompts = {
|
|
|
92
88
|
ACCESS_TOKEN: 'Enter the GitHub Access Token the agent will use',
|
|
93
89
|
REPOSITORY_OWNER: 'Enter the GitHub Repository Owner the agent will use',
|
|
94
90
|
REPOSITORY_NAME: 'Enter the Repository Name the agent will use',
|
|
95
|
-
REPOSITORY_BRANCH: 'Enter the Repository Branch the agent will use',
|
|
96
91
|
FILE_PATHS: 'Enter a File Path within the repository that the agent will use',
|
|
97
92
|
FILE_PATTERNS: 'Enter a File Pattern that the agent will use (Optional)',
|
|
98
93
|
DA_FREQUENCY: 'How often should the discovery run, leave blank for integrating in CI/CD process',
|
|
@@ -171,13 +166,7 @@ const gatewayConnectivity = async installConfig => {
|
|
|
171
166
|
hostedAgentValues.repositoryName = await (0, _basicPrompts.askInput)({
|
|
172
167
|
msg: SaasPrompts.REPOSITORY_NAME,
|
|
173
168
|
defaultValue: hostedAgentValues.repositoryName !== '' ? hostedAgentValues.repositoryName : undefined,
|
|
174
|
-
validate: (0, _basicPrompts.validateRegex)(helpers.GitHubRegexPatterns.
|
|
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
|
|
169
|
+
validate: (0, _basicPrompts.validateRegex)(helpers.GitHubRegexPatterns.gitHubRepositoryOwnerRegex, helpers.invalidValueExampleErrMsg('Repository Name', 'axway-github-repo-name'))
|
|
181
170
|
});
|
|
182
171
|
|
|
183
172
|
// get File Paths
|
|
@@ -252,7 +241,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
|
|
|
252
241
|
production: installConfig.centralConfig.production
|
|
253
242
|
}) : installConfig.centralConfig.ampcEnvInfo.name;
|
|
254
243
|
if (installConfig.gatewayType === _types.GatewayTypes.GITHUB) {
|
|
255
|
-
gitHubAgentValues.dataplaneConfig = new GitHubDataplaneConfig(gitHubAgentValues.repositoryName, gitHubAgentValues.repositoryOwner, new GitHubFilterConfig(gitHubAgentValues.filePaths, gitHubAgentValues.
|
|
244
|
+
gitHubAgentValues.dataplaneConfig = new GitHubDataplaneConfig(gitHubAgentValues.repositoryName, gitHubAgentValues.repositoryOwner, new GitHubFilterConfig(gitHubAgentValues.filePaths, gitHubAgentValues.filePatterns));
|
|
256
245
|
}
|
|
257
246
|
|
|
258
247
|
// create the data plane resource
|
|
@@ -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
|
};
|