@axway/axway-central-cli 4.2.0-rc.0 → 4.2.0-rc.2
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.
|
@@ -26,8 +26,9 @@ class DataplaneConfig {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
class APIGEEXDataplaneConfig extends DataplaneConfig {
|
|
29
|
+
// super constructor to set the type to 'Apigee' since this is a specific type of dataplane for SaaS agents (enum) available
|
|
29
30
|
constructor(controlPlaneRegion, projectID, developerEmail, mode, metricsFilter, environment) {
|
|
30
|
-
super("Apigee
|
|
31
|
+
super("Apigee");
|
|
31
32
|
_defineProperty(this, "controlPlaneRegion", void 0);
|
|
32
33
|
_defineProperty(this, "projectId", void 0);
|
|
33
34
|
_defineProperty(this, "developerEmail", void 0);
|
|
@@ -96,7 +97,7 @@ const ConfigFiles = {};
|
|
|
96
97
|
const SaasPrompts = {
|
|
97
98
|
AUTHENTICATION_TYPE: 'Authenticate with an Impersonation of a Service Account or by providing a Credential File',
|
|
98
99
|
PROJECT_ID: 'Enter the APIGEE X Project ID the agent will use',
|
|
99
|
-
|
|
100
|
+
SETUP_CONTROL_PLANE_REGION: 'The APIGEE X Gateway service allows you to configure a regionalized control plane for a more specific service endpoint location. Do you want to configure that?',
|
|
100
101
|
DEVELOPER_EMAIL_ADDRESS: 'Enter the APIGEE X Developer Email Address the agent will use',
|
|
101
102
|
CLIENT_EMAIL_ADDRESS: 'Enter the Client Email Address the agent will use for the APIGEE X Service Account',
|
|
102
103
|
UPLOAD_CREDENTIAL_FILE: 'Upload a JSON Credential file to be used for APIGEE X Authentication',
|
|
@@ -121,15 +122,21 @@ const askConfigType = async () => {
|
|
|
121
122
|
};
|
|
122
123
|
const askForAPIGEEXCredentials = async hostedAgentValues => {
|
|
123
124
|
log("gathering access details for apigee x");
|
|
124
|
-
hostedAgentValues.controlPlaneRegion = await (0, _basicPrompts.askInput)({
|
|
125
|
-
msg: SaasPrompts.CONTROL_PLANE_REGION,
|
|
126
|
-
defaultValue: hostedAgentValues.controlPlaneRegion !== '' ? hostedAgentValues.controlPlaneRegion : undefined
|
|
127
|
-
});
|
|
128
125
|
hostedAgentValues.projectId = await (0, _basicPrompts.askInput)({
|
|
129
126
|
msg: SaasPrompts.PROJECT_ID,
|
|
130
127
|
defaultValue: hostedAgentValues.projectId !== '' ? hostedAgentValues.projectId : undefined,
|
|
131
128
|
validate: (0, _basicPrompts.validateRegex)(helpers.APIGEEXRegexPatterns.APIGEEX_REGEXP_PROJECT_ID, helpers.invalidValueExampleErrMsg('Project ID', 'rd-amplify-apigee-x'))
|
|
132
129
|
});
|
|
130
|
+
let controlPlaneRegionSupport = await (0, _basicPrompts.askList)({
|
|
131
|
+
msg: SaasPrompts.SETUP_CONTROL_PLANE_REGION,
|
|
132
|
+
default: _types.YesNo.No,
|
|
133
|
+
choices: _types.YesNoChoices
|
|
134
|
+
});
|
|
135
|
+
if (controlPlaneRegionSupport === _types.YesNo.Yes) {
|
|
136
|
+
hostedAgentValues.controlPlaneRegion = await helpers.askApigeexControlPlaneRegion();
|
|
137
|
+
} else {
|
|
138
|
+
hostedAgentValues.controlPlaneRegion = '';
|
|
139
|
+
}
|
|
133
140
|
|
|
134
141
|
// get developer email address
|
|
135
142
|
hostedAgentValues.developerEmailAddress = await (0, _basicPrompts.askInput)({
|
|
@@ -264,10 +271,14 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
|
|
|
264
271
|
}
|
|
265
272
|
|
|
266
273
|
// create the data plane resource
|
|
267
|
-
let dataplaneRes = await helpers.createNewDataPlaneResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.
|
|
274
|
+
let dataplaneRes = await helpers.createNewDataPlaneResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.DataPlaneNames.APIGEE,
|
|
275
|
+
// hardcoded for APIGEE to match dataplane definitions
|
|
276
|
+
apigeeXAgentValues.dataplaneConfig);
|
|
268
277
|
// create data plane secret resource
|
|
269
278
|
try {
|
|
270
|
-
await helpers.createNewDataPlaneSecretResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.
|
|
279
|
+
await helpers.createNewDataPlaneSecretResource(apiServerClient, defsManager, installConfig.centralConfig.environment, _types.DataPlaneNames.APIGEE,
|
|
280
|
+
// hardcoded for APIGEE to match dataplane definitions
|
|
281
|
+
dataplaneRes.name, await createEncryptedAccessData(apigeeXAgentValues, dataplaneRes));
|
|
271
282
|
} catch (error) {
|
|
272
283
|
console.log(_chalk.default.redBright("rolling back installation. Please check the credential data before re-running install"));
|
|
273
284
|
if (installConfig.centralConfig.ampcEnvInfo.isNew) {
|
package/dist/common/types.js
CHANGED
|
@@ -278,6 +278,7 @@ let SaaSGatewayTypes = exports.SaaSGatewayTypes = /*#__PURE__*/function (SaaSGat
|
|
|
278
278
|
}({});
|
|
279
279
|
let DataPlaneNames = exports.DataPlaneNames = /*#__PURE__*/function (DataPlaneNames) {
|
|
280
280
|
DataPlaneNames["APIGEEX"] = "Apigee X";
|
|
281
|
+
DataPlaneNames["APIGEE"] = "Apigee";
|
|
281
282
|
DataPlaneNames["AWS"] = "AWS";
|
|
282
283
|
DataPlaneNames["GITHUB"] = "GitHub";
|
|
283
284
|
DataPlaneNames["GITLAB"] = "GitLab";
|