@axway/axway-central-cli 3.9.1 → 3.9.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.
|
@@ -62,5 +62,5 @@ const GitLabRegexPatterns = exports.GitLabRegexPatterns = {
|
|
|
62
62
|
};
|
|
63
63
|
const KafkaRegexPatterns = exports.KafkaRegexPatterns = {
|
|
64
64
|
bootstrapServerRegex: '^(SASL_SSL:\/\/|SASL_PLAINTEXT:\/\/|PLAINTEXT:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z0-9]{1,5}(:[0-9]{1,5})$',
|
|
65
|
-
|
|
65
|
+
urlRegex: '^(http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$'
|
|
66
66
|
};
|
|
@@ -24,6 +24,10 @@ class KafkaAgentValues {
|
|
|
24
24
|
_defineProperty(this, "clusterSaslMechanism", void 0);
|
|
25
25
|
_defineProperty(this, "clusterSaslUser", void 0);
|
|
26
26
|
_defineProperty(this, "clusterSaslPassword", void 0);
|
|
27
|
+
_defineProperty(this, "saslOauthTokenUrl", void 0);
|
|
28
|
+
_defineProperty(this, "saslOauthClientId", void 0);
|
|
29
|
+
_defineProperty(this, "saslOauthClientSecret", void 0);
|
|
30
|
+
_defineProperty(this, "saslOauthClientScopes", void 0);
|
|
27
31
|
_defineProperty(this, "schemaRegistryEnabled", void 0);
|
|
28
32
|
_defineProperty(this, "schemaRegistryUrl", void 0);
|
|
29
33
|
_defineProperty(this, "schemaRegistryAuthEnabled", void 0);
|
|
@@ -42,6 +46,10 @@ class KafkaAgentValues {
|
|
|
42
46
|
this.clusterSaslMechanism = '';
|
|
43
47
|
this.clusterSaslUser = '';
|
|
44
48
|
this.clusterSaslPassword = '';
|
|
49
|
+
this.saslOauthTokenUrl = '';
|
|
50
|
+
this.saslOauthClientId = '';
|
|
51
|
+
this.saslOauthClientSecret = '';
|
|
52
|
+
this.saslOauthClientScopes = '';
|
|
45
53
|
this.schemaRegistryEnabled = false;
|
|
46
54
|
this.schemaRegistryUrl = '';
|
|
47
55
|
this.schemaRegistryAuthEnabled = true;
|
|
@@ -70,9 +78,19 @@ KAFKA_CLUSTER_AUTH_APIKEY_SECRET={{clusterAPISecret}}
|
|
|
70
78
|
KAFKA_CLUSTER_SERVERS={{clusterServer}}
|
|
71
79
|
{{#compare . clusterSaslMechanism "NONE" operator="!="}}
|
|
72
80
|
KAFKA_CLUSTER_AUTH_SASL_MECHANISM={{clusterSaslMechanism}}
|
|
81
|
+
{{#compare . clusterSaslMechanism "OAUTHBEARER" operator="=="}}
|
|
82
|
+
KAFKA_CLUSTER_AUTH_SASL_OAUTH_TOKENURL={{saslOauthTokenUrl}}
|
|
83
|
+
KAFKA_CLUSTER_AUTH_SASL_OAUTH_CLIENTID={{saslOauthClientId}}
|
|
84
|
+
KAFKA_CLUSTER_AUTH_SASL_OAUTH_CLIENTSECRET={{saslOauthClientSecret}}
|
|
85
|
+
{{#compare . saslOauthClientScopes "" operator="!=" }}
|
|
86
|
+
KAFKA_CLUSTER_AUTH_SASL_OAUTH_SCOPES={{saslOauthClientScopes}}
|
|
87
|
+
{{/compare}}
|
|
88
|
+
{{/compare}}
|
|
89
|
+
{{#compare . clusterSaslMechanism "OAUTHBEARER" operator="!="}}
|
|
73
90
|
KAFKA_CLUSTER_AUTH_SASL_USERNAME={{clusterSaslUser}}
|
|
74
91
|
KAFKA_CLUSTER_AUTH_SASL_PASSWORD={{clusterSaslPassword}}
|
|
75
92
|
{{/compare}}
|
|
93
|
+
{{/compare}}
|
|
76
94
|
{{/if}}
|
|
77
95
|
|
|
78
96
|
{{#if cloudEnabled}}
|
|
@@ -85,8 +103,18 @@ KAFKA_SCHEMAREGISTRY_ENABLED=true
|
|
|
85
103
|
KAFKA_SCHEMAREGISTRY_URL={{schemaRegistryUrl}}
|
|
86
104
|
{{#if schemaRegistryAuthEnabled}}
|
|
87
105
|
KAFKA_SCHEMAREGISTRY_AUTH_SASL_MECHANISM={{clusterSaslMechanism}}
|
|
106
|
+
{{#compare . clusterSaslMechanism "OAUTHBEARER" operator="=="}}
|
|
107
|
+
KAFKA_SCHEMAREGISTRY_AUTH_SASL_OAUTH_TOKENURL={{saslOauthTokenUrl}}
|
|
108
|
+
KAFKA_SCHEMAREGISTRY_AUTH_SASL_OAUTH_CLIENTID={{saslOauthClientId}}
|
|
109
|
+
KAFKA_SCHEMAREGISTRY_AUTH_SASL_OAUTH_CLIENTSECRET={{saslOauthClientSecret}}
|
|
110
|
+
{{#compare . saslOauthClientScopes "" operator="!=" }}
|
|
111
|
+
KAFKA_SCHEMAREGISTRY_AUTH_SASL_OAUTH_SCOPES={{saslOauthClientScopes}}
|
|
112
|
+
{{/compare}}
|
|
113
|
+
{{/compare}}
|
|
114
|
+
{{#compare . clusterSaslMechanism "OAUTHBEARER" operator="!="}}
|
|
88
115
|
KAFKA_SCHEMAREGISTRY_AUTH_SASL_USERNAME={{clusterSaslUser}}
|
|
89
116
|
KAFKA_SCHEMAREGISTRY_AUTH_SASL_PASSWORD={{clusterSaslPassword}}
|
|
117
|
+
{{/compare}}
|
|
90
118
|
{{/if}}
|
|
91
119
|
{{/if}}
|
|
92
120
|
{{/if}}
|
|
@@ -129,9 +157,19 @@ KAFKA_CLUSTER_AUTH_APIKEY_SECRET={{clusterAPISecret}}
|
|
|
129
157
|
KAFKA_CLUSTER_SERVERS={{clusterServer}}
|
|
130
158
|
{{#compare . clusterSaslMechanism "NONE" operator="!="}}
|
|
131
159
|
KAFKA_CLUSTER_AUTH_SASL_MECHANISM={{clusterSaslMechanism}}
|
|
160
|
+
{{#compare . clusterSaslMechanism "OAUTHBEARER" operator="=="}}
|
|
161
|
+
KAFKA_CLUSTER_AUTH_SASL_OAUTH_TOKENURL={{saslOauthTokenUrl}}
|
|
162
|
+
KAFKA_CLUSTER_AUTH_SASL_OAUTH_CLIENTID={{saslOauthClientId}}
|
|
163
|
+
KAFKA_CLUSTER_AUTH_SASL_OAUTH_CLIENTSECRET={{saslOauthClientSecret}}
|
|
164
|
+
{{#compare . saslOauthClientScopes "" operator="!=" }}
|
|
165
|
+
KAFKA_CLUSTER_AUTH_SASL_OAUTH_SCOPES={{saslOauthClientScopes}}
|
|
166
|
+
{{/compare}}
|
|
167
|
+
{{/compare}}
|
|
168
|
+
{{#compare . clusterSaslMechanism "OAUTHBEARER" operator="!="}}
|
|
132
169
|
KAFKA_CLUSTER_AUTH_SASL_USERNAME={{clusterSaslUser}}
|
|
133
170
|
KAFKA_CLUSTER_AUTH_SASL_PASSWORD={{clusterSaslPassword}}
|
|
134
171
|
{{/compare}}
|
|
172
|
+
{{/compare}}
|
|
135
173
|
{{/if}}
|
|
136
174
|
|
|
137
175
|
# Amplify Central configs
|
|
@@ -37,6 +37,7 @@ let SaslMechanismTypes = exports.SaslMechanismTypes = /*#__PURE__*/function (Sas
|
|
|
37
37
|
SaslMechanismTypes["SCRAM_SHA_256"] = "SCRAM-SHA-256";
|
|
38
38
|
SaslMechanismTypes["SCRAM_SHA_512"] = "SCRAM-SHA-512";
|
|
39
39
|
SaslMechanismTypes["PLAIN"] = "PLAIN";
|
|
40
|
+
SaslMechanismTypes["OAUTHBEARER"] = "OAUTHBEARER";
|
|
40
41
|
SaslMechanismTypes["NONE"] = "NONE";
|
|
41
42
|
return SaslMechanismTypes;
|
|
42
43
|
}({}); // KafkaPrompts - prompts for user inputs
|
|
@@ -52,9 +53,13 @@ const prompts = {
|
|
|
52
53
|
saslMechanismMsg: "Select the SASL Mechanism you wish to use for authentication",
|
|
53
54
|
enterSaslUsername: "Enter the SASL Username",
|
|
54
55
|
enterSaslPassword: "Enter the SASL Password",
|
|
56
|
+
enterSaslOAuthTokenUrl: "Enter the SASL/OAUTHBEARER Token Url",
|
|
57
|
+
enterSaslOAuthClientId: "Enter the SASL/OAUTHBEARER Client Id",
|
|
58
|
+
enterSaslOAuthClientSecret: "Enter the SASL/OAUTHBEARER Client Secret",
|
|
59
|
+
enterSaslOAuthClientScopes: "Enter the SASL/OAUTHBEARER Client Scopes(comma separated list)",
|
|
55
60
|
schemaRegistryEnabledMsg: 'Do you want to use Schema Registry with Kafka cluster?',
|
|
56
61
|
enterSchemaRegistryUrl: 'Enter the Schema Registry Url',
|
|
57
|
-
schemaRegistryAuthEnabled: 'Do you want to authenticate Schema Registry with SASL
|
|
62
|
+
schemaRegistryAuthEnabled: 'Do you want to authenticate Schema Registry with SASL mechanism?',
|
|
58
63
|
enterSchemaRegistryAPIKey: 'Enter the Schema Registry API Key Id',
|
|
59
64
|
enterSchemaRegistryAPISecret: 'Enter the Schema Registry API Key Secret'
|
|
60
65
|
};
|
|
@@ -126,10 +131,30 @@ const askSaslMechanism = async () => {
|
|
|
126
131
|
}, {
|
|
127
132
|
name: SaslMechanismTypes.SCRAM_SHA_512,
|
|
128
133
|
value: SaslMechanismTypes.SCRAM_SHA_512
|
|
134
|
+
}, {
|
|
135
|
+
name: SaslMechanismTypes.OAUTHBEARER,
|
|
136
|
+
value: SaslMechanismTypes.OAUTHBEARER
|
|
129
137
|
}]
|
|
130
138
|
});
|
|
131
139
|
};
|
|
132
140
|
exports.askSaslMechanism = askSaslMechanism;
|
|
141
|
+
const askSaslOAuthBearerTokenUrl = async () => await (0, _basicPrompts.askInput)({
|
|
142
|
+
msg: prompts.enterSaslOAuthTokenUrl,
|
|
143
|
+
allowEmptyInput: false,
|
|
144
|
+
validate: (0, _basicPrompts.validateRegex)(helpers.KafkaRegexPatterns.urlRegex, helpers.invalidValueExampleErrMsg('Token URL', 'https://www.testdomain.com/oauth/token'))
|
|
145
|
+
});
|
|
146
|
+
const askSaslOAuthBearerClientId = async () => await (0, _basicPrompts.askInput)({
|
|
147
|
+
msg: prompts.enterSaslOAuthClientId,
|
|
148
|
+
allowEmptyInput: false
|
|
149
|
+
});
|
|
150
|
+
const askSaslOAuthBearerClientSecret = async () => await (0, _basicPrompts.askInput)({
|
|
151
|
+
msg: prompts.enterSaslOAuthClientSecret,
|
|
152
|
+
allowEmptyInput: false
|
|
153
|
+
});
|
|
154
|
+
const askSaslOAuthBearerScopes = async () => await (0, _basicPrompts.askInput)({
|
|
155
|
+
msg: prompts.enterSaslOAuthClientScopes,
|
|
156
|
+
allowEmptyInput: true
|
|
157
|
+
});
|
|
133
158
|
const askSaslUsername = async () => await (0, _basicPrompts.askInput)({
|
|
134
159
|
msg: prompts.enterSaslUsername
|
|
135
160
|
});
|
|
@@ -155,7 +180,7 @@ const askIsSchemaRegistryAuthEnabled = async () => {
|
|
|
155
180
|
exports.askIsSchemaRegistryAuthEnabled = askIsSchemaRegistryAuthEnabled;
|
|
156
181
|
const askSchemaRegistryUrl = async () => await (0, _basicPrompts.askInput)({
|
|
157
182
|
msg: prompts.enterSchemaRegistryUrl,
|
|
158
|
-
validate: (0, _basicPrompts.validateRegex)(helpers.KafkaRegexPatterns.
|
|
183
|
+
validate: (0, _basicPrompts.validateRegex)(helpers.KafkaRegexPatterns.urlRegex, helpers.invalidValueExampleErrMsg('Schema Registry Url', 'https://www.testdomain.com'))
|
|
159
184
|
});
|
|
160
185
|
const askSchemaRegistryAPIKey = async () => await (0, _basicPrompts.askInput)({
|
|
161
186
|
msg: prompts.enterSchemaRegistryAPIKey
|
|
@@ -177,8 +202,15 @@ const gatewayConnectivity = async installConfig => {
|
|
|
177
202
|
kafkaAgentValues.clusterServer = await askClusterServer();
|
|
178
203
|
kafkaAgentValues.clusterSaslMechanism = await askSaslMechanism();
|
|
179
204
|
if (kafkaAgentValues.clusterSaslMechanism !== SaslMechanismTypes.NONE) {
|
|
180
|
-
kafkaAgentValues.
|
|
181
|
-
|
|
205
|
+
if (kafkaAgentValues.clusterSaslMechanism == SaslMechanismTypes.OAUTHBEARER) {
|
|
206
|
+
kafkaAgentValues.saslOauthTokenUrl = await askSaslOAuthBearerTokenUrl();
|
|
207
|
+
kafkaAgentValues.saslOauthClientId = await askSaslOAuthBearerClientId();
|
|
208
|
+
kafkaAgentValues.saslOauthClientSecret = await askSaslOAuthBearerClientSecret();
|
|
209
|
+
kafkaAgentValues.saslOauthClientScopes = await askSaslOAuthBearerScopes();
|
|
210
|
+
} else {
|
|
211
|
+
kafkaAgentValues.clusterSaslUser = await askSaslUsername();
|
|
212
|
+
kafkaAgentValues.clusterSaslPassword = await askSaslPassword();
|
|
213
|
+
}
|
|
182
214
|
}
|
|
183
215
|
}
|
|
184
216
|
if (installConfig.switches.isDaEnabled) {
|