@sap-ux/odata-service-inquirer 2.4.4 → 2.4.6
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/dist/prompts/connectionValidator.d.ts +18 -2
- package/dist/prompts/connectionValidator.js +76 -7
- package/dist/prompts/datasources/sap-system/service-selection/service-helper.js +6 -5
- package/dist/prompts/datasources/sap-system/shared-prompts/shared-prompts.js +9 -0
- package/dist/prompts/datasources/sap-system/system-selection/questions.js +6 -0
- package/dist/prompts/datasources/service-url/questions.js +16 -9
- package/dist/translations/odata-service-inquirer.i18n.json +10 -9
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AxiosRequestConfig, CatalogService, ODataService, ServiceInfo, ServiceProvider } from '@sap-ux/axios-extension';
|
|
1
|
+
import type { AxiosRequestConfig, CatalogService, ODataService, ProviderConfiguration, ServiceInfo, ServiceProvider } from '@sap-ux/axios-extension';
|
|
2
2
|
import { ODataVersion } from '@sap-ux/axios-extension';
|
|
3
3
|
import { type Destination } from '@sap-ux/btp-utils';
|
|
4
4
|
import { ERROR_TYPE } from '@sap-ux/inquirer-common';
|
|
@@ -38,12 +38,19 @@ export declare class ConnectionValidator {
|
|
|
38
38
|
private _connectedUserName;
|
|
39
39
|
private _connectedSystemName;
|
|
40
40
|
private _refreshToken;
|
|
41
|
+
private _ignoreCertError;
|
|
42
|
+
/**
|
|
43
|
+
* Get the ignoreCertError value.
|
|
44
|
+
*
|
|
45
|
+
* @returns the ignoreCertError value, true indicates that cert errors may have been ignored
|
|
46
|
+
*/
|
|
47
|
+
get ignoreCertError(): boolean | undefined;
|
|
41
48
|
/**
|
|
42
49
|
* Getter for the axios configuration.
|
|
43
50
|
*
|
|
44
51
|
* @returns the axios configuration
|
|
45
52
|
*/
|
|
46
|
-
get axiosConfig(): AxiosRequestConfig;
|
|
53
|
+
get axiosConfig(): AxiosRequestConfig & ProviderConfiguration;
|
|
47
54
|
/**
|
|
48
55
|
* Get the odata service instance.
|
|
49
56
|
*
|
|
@@ -181,6 +188,15 @@ export declare class ConnectionValidator {
|
|
|
181
188
|
* @param resetValidity if true, the validity information will be reset also
|
|
182
189
|
*/
|
|
183
190
|
resetConnectionState(resetValidity?: boolean): void;
|
|
191
|
+
/**
|
|
192
|
+
* When the env has set `NODE_TLS_REJECT_UNAUTHORIZED=0` we make an intial request to check for cert errors.
|
|
193
|
+
* We log these errors to the console so the user is informed of the risks.
|
|
194
|
+
*
|
|
195
|
+
* @param axiosConfig the axios request configuration for Abap on prem connection
|
|
196
|
+
* @param odataVersion the odata version to restrict the catalog requests if only a specific version is required
|
|
197
|
+
* @returns true if the cert error should be ignored based on the environment setting `NODE_TLS_REJECT_UNAUTHORIZED=0`
|
|
198
|
+
*/
|
|
199
|
+
private shouldIgnoreCertError;
|
|
184
200
|
/**
|
|
185
201
|
* Create the connection for a system url, the specified axios config or the specified service info.
|
|
186
202
|
*
|
|
@@ -12,8 +12,14 @@ const i18n_1 = require("../i18n");
|
|
|
12
12
|
const types_1 = require("../types");
|
|
13
13
|
const logger_helper_1 = __importDefault(require("./logger-helper"));
|
|
14
14
|
const prompt_helpers_1 = require("./prompt-helpers");
|
|
15
|
-
// Cert errors that may be ignored by prompt
|
|
16
|
-
const ignorableCertErrors = [
|
|
15
|
+
// Cert errors that may be ignored by the ignore cert errors prompt and NODE_TLS_REJECT_UNAUTHORIZED=0 setting
|
|
16
|
+
const ignorableCertErrors = [
|
|
17
|
+
inquirer_common_1.ERROR_TYPE.CERT_SELF_SIGNED,
|
|
18
|
+
inquirer_common_1.ERROR_TYPE.CERT_SELF_SIGNED_CERT_IN_CHAIN,
|
|
19
|
+
inquirer_common_1.ERROR_TYPE.CERT_EXPIRED,
|
|
20
|
+
inquirer_common_1.ERROR_TYPE.CERT_UKNOWN_OR_INVALID,
|
|
21
|
+
inquirer_common_1.ERROR_TYPE.INVALID_SSL_CERTIFICATE
|
|
22
|
+
];
|
|
17
23
|
/**
|
|
18
24
|
* Class that can be used to determine the connectivity using a service url, system url, or service info (UAA Key details) or reentrance ticket.
|
|
19
25
|
* This will determine if if the service/catalog is reachable, authentication is required and generates ting messages to guide the user.
|
|
@@ -41,6 +47,16 @@ class ConnectionValidator {
|
|
|
41
47
|
_connectedUserName;
|
|
42
48
|
_connectedSystemName;
|
|
43
49
|
_refreshToken;
|
|
50
|
+
// For the current validated URL connection attempts will ignore cert errors
|
|
51
|
+
_ignoreCertError;
|
|
52
|
+
/**
|
|
53
|
+
* Get the ignoreCertError value.
|
|
54
|
+
*
|
|
55
|
+
* @returns the ignoreCertError value, true indicates that cert errors may have been ignored
|
|
56
|
+
*/
|
|
57
|
+
get ignoreCertError() {
|
|
58
|
+
return this._ignoreCertError;
|
|
59
|
+
}
|
|
44
60
|
/**
|
|
45
61
|
* Getter for the axios configuration.
|
|
46
62
|
*
|
|
@@ -204,6 +220,7 @@ class ConnectionValidator {
|
|
|
204
220
|
this.validity.reachable = true;
|
|
205
221
|
this.validity.urlFormat = true;
|
|
206
222
|
this.validity.authRequired = true;
|
|
223
|
+
// Do we need to explictly set the ignore cert error flag with an existing connection or are we calling checkUrl() again?
|
|
207
224
|
if (backendSystem?.authenticationType === 'reentranceTicket') {
|
|
208
225
|
this.systemAuthType = 'reentranceTicket';
|
|
209
226
|
}
|
|
@@ -265,10 +282,6 @@ class ConnectionValidator {
|
|
|
265
282
|
throw e;
|
|
266
283
|
}
|
|
267
284
|
}
|
|
268
|
-
finally {
|
|
269
|
-
// Reset global cert validation
|
|
270
|
-
ConnectionValidator.setGlobalRejectUnauthorized(true);
|
|
271
|
-
}
|
|
272
285
|
}
|
|
273
286
|
/**
|
|
274
287
|
* Create the axios configuration object for the service or system connection.
|
|
@@ -304,6 +317,11 @@ class ConnectionValidator {
|
|
|
304
317
|
* @param servicePath the service path without the origin
|
|
305
318
|
*/
|
|
306
319
|
async createOdataServiceConnection(axiosConfig, servicePath) {
|
|
320
|
+
if (await this.shouldIgnoreCertError(axiosConfig)) {
|
|
321
|
+
this._ignoreCertError = true;
|
|
322
|
+
axiosConfig.ignoreCertErrors = true;
|
|
323
|
+
ConnectionValidator.setGlobalRejectUnauthorized(false);
|
|
324
|
+
}
|
|
307
325
|
this._axiosConfig = axiosConfig;
|
|
308
326
|
this._serviceProvider = (0, axios_extension_1.create)(this._axiosConfig);
|
|
309
327
|
this._odataService = this._serviceProvider.service(servicePath);
|
|
@@ -324,10 +342,41 @@ class ConnectionValidator {
|
|
|
324
342
|
this._connectedUserName = undefined;
|
|
325
343
|
this._refreshToken = undefined;
|
|
326
344
|
this._connectedSystemName = undefined;
|
|
345
|
+
this._ignoreCertError = undefined;
|
|
327
346
|
if (resetValidity) {
|
|
328
347
|
this.resetValidity();
|
|
329
348
|
}
|
|
330
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* When the env has set `NODE_TLS_REJECT_UNAUTHORIZED=0` we make an intial request to check for cert errors.
|
|
352
|
+
* We log these errors to the console so the user is informed of the risks.
|
|
353
|
+
*
|
|
354
|
+
* @param axiosConfig the axios request configuration for Abap on prem connection
|
|
355
|
+
* @param odataVersion the odata version to restrict the catalog requests if only a specific version is required
|
|
356
|
+
* @returns true if the cert error should be ignored based on the environment setting `NODE_TLS_REJECT_UNAUTHORIZED=0`
|
|
357
|
+
*/
|
|
358
|
+
async shouldIgnoreCertError(axiosConfig, odataVersion) {
|
|
359
|
+
logger_helper_1.default.logger.debug(`ConnectionValidator.shouldIgnoreCertError() - url: ${axiosConfig.baseURL}`);
|
|
360
|
+
let shouldIgnoreCertError = false;
|
|
361
|
+
const nodeAllowBadCerts = process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0';
|
|
362
|
+
if (nodeAllowBadCerts) {
|
|
363
|
+
try {
|
|
364
|
+
const odataVerCatalog = !odataVersion || odataVersion === axios_extension_1.ODataVersion.v2 ? axios_extension_1.ODataVersion.v2 : axios_extension_1.ODataVersion.v4;
|
|
365
|
+
const abapProvider = (0, axios_extension_1.createForAbap)(axiosConfig);
|
|
366
|
+
logger_helper_1.default.attachAxiosLogger(abapProvider.interceptors);
|
|
367
|
+
await abapProvider.catalog(odataVerCatalog).listServices();
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
const errorType = inquirer_common_1.ErrorHandler.getErrorType(error?.response?.status ?? error?.code);
|
|
371
|
+
if (error?.isAxiosError && ignorableCertErrors.includes(errorType)) {
|
|
372
|
+
logger_helper_1.default.logger.warn((0, i18n_1.t)('warnings.certificateErrors', { url: axiosConfig?.baseURL, error: errorType }));
|
|
373
|
+
logger_helper_1.default.logger.warn((0, i18n_1.t)('warnings.allowingUnauthorizedCertsNode'));
|
|
374
|
+
shouldIgnoreCertError = true;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return shouldIgnoreCertError;
|
|
379
|
+
}
|
|
331
380
|
/**
|
|
332
381
|
* Create the connection for a system url, the specified axios config or the specified service info.
|
|
333
382
|
*
|
|
@@ -353,6 +402,13 @@ class ConnectionValidator {
|
|
|
353
402
|
this._serviceProvider = (0, axios_extension_1.createForDestination)({}, destination);
|
|
354
403
|
}
|
|
355
404
|
else if (axiosConfig) {
|
|
405
|
+
// Abap-on-prem on VSCode specific handling of cert errors from system connections.
|
|
406
|
+
// Make an additional request to log any cert errors that we are going to ignore so the user is informed of the risks.
|
|
407
|
+
if (await this.shouldIgnoreCertError(axiosConfig, odataVersion)) {
|
|
408
|
+
this._ignoreCertError = true;
|
|
409
|
+
axiosConfig.ignoreCertErrors = true;
|
|
410
|
+
ConnectionValidator.setGlobalRejectUnauthorized(false);
|
|
411
|
+
}
|
|
356
412
|
this._axiosConfig = axiosConfig;
|
|
357
413
|
this._serviceProvider = (0, axios_extension_1.createForAbap)(axiosConfig);
|
|
358
414
|
}
|
|
@@ -397,6 +453,19 @@ class ConnectionValidator {
|
|
|
397
453
|
// as the user may not be authorized for the v2 catalog specifically.
|
|
398
454
|
const shouldFallbackToV4 = statusCode && !v4Requested && (errorType === inquirer_common_1.ERROR_TYPE.NOT_FOUND || errorType === inquirer_common_1.ERROR_TYPE.AUTH);
|
|
399
455
|
if (this._catalogV4 && shouldFallbackToV4) {
|
|
456
|
+
// The v2 catalog was not available therefore cert errors will not have been seen (hidden by 404), only abap on prem uses axiosConfig directly
|
|
457
|
+
if (this._axiosConfig && (await this.shouldIgnoreCertError(this._axiosConfig, axios_extension_1.ODataVersion.v4))) {
|
|
458
|
+
this._ignoreCertError = true;
|
|
459
|
+
ConnectionValidator.setGlobalRejectUnauthorized(false);
|
|
460
|
+
this._axiosConfig = {
|
|
461
|
+
...this._axiosConfig,
|
|
462
|
+
ignoreCertErrors: true
|
|
463
|
+
};
|
|
464
|
+
// Re-create the service provider with the updated config
|
|
465
|
+
this._serviceProvider = (0, axios_extension_1.createForAbap)(this._axiosConfig);
|
|
466
|
+
this._catalogV4 = this._serviceProvider.catalog(axios_extension_1.ODataVersion.v4);
|
|
467
|
+
logger_helper_1.default.attachAxiosLogger(this._serviceProvider.interceptors);
|
|
468
|
+
}
|
|
400
469
|
try {
|
|
401
470
|
await this._catalogV4.listServices();
|
|
402
471
|
}
|
|
@@ -770,7 +839,7 @@ class ConnectionValidator {
|
|
|
770
839
|
}
|
|
771
840
|
this.systemAuthType = 'basic';
|
|
772
841
|
const status = await this.checkUrl(urlObject, username, password, {
|
|
773
|
-
ignoreCertError,
|
|
842
|
+
ignoreCertError: ignoreCertError,
|
|
774
843
|
isSystem,
|
|
775
844
|
odataVersion
|
|
776
845
|
});
|
|
@@ -245,6 +245,7 @@ async function validateService(service, connectionValidator, requiredOdataVersio
|
|
|
245
245
|
utils_1.PromptState.odataService.servicePath = service.servicePath;
|
|
246
246
|
utils_1.PromptState.odataService.origin = origin;
|
|
247
247
|
utils_1.PromptState.odataService.sapClient = connectionValidator.validatedClient;
|
|
248
|
+
utils_1.PromptState.odataService.ignoreCertError = connectionValidator.ignoreCertError;
|
|
248
249
|
return {
|
|
249
250
|
validationResult: true,
|
|
250
251
|
hasAnnotations: !!utils_1.PromptState.odataService.annotations && utils_1.PromptState.odataService.annotations.length > 0,
|
|
@@ -282,7 +283,7 @@ async function getSelectedServiceMessage(serviceChoices, selectedService, connec
|
|
|
282
283
|
if (serviceChoices?.length === 0) {
|
|
283
284
|
if (requiredOdataVersion) {
|
|
284
285
|
return {
|
|
285
|
-
message: (0, i18n_1.t)('
|
|
286
|
+
message: (0, i18n_1.t)('warnings.noServicesAvailableForOdataVersion', {
|
|
286
287
|
odataVersion: requiredOdataVersion
|
|
287
288
|
}),
|
|
288
289
|
severity: yeoman_ui_types_1.Severity.warning
|
|
@@ -290,7 +291,7 @@ async function getSelectedServiceMessage(serviceChoices, selectedService, connec
|
|
|
290
291
|
}
|
|
291
292
|
else {
|
|
292
293
|
return {
|
|
293
|
-
message: (0, i18n_1.t)('
|
|
294
|
+
message: (0, i18n_1.t)('warnings.noServicesAvailable'),
|
|
294
295
|
severity: yeoman_ui_types_1.Severity.warning
|
|
295
296
|
};
|
|
296
297
|
}
|
|
@@ -301,7 +302,7 @@ async function getSelectedServiceMessage(serviceChoices, selectedService, connec
|
|
|
301
302
|
// Warn if odata service is version is '2' and no annotations are present
|
|
302
303
|
if (!hasAnnotations) {
|
|
303
304
|
return {
|
|
304
|
-
message: (0, i18n_1.t)('
|
|
305
|
+
message: (0, i18n_1.t)('warnings.noAnnotations'),
|
|
305
306
|
severity: yeoman_ui_types_1.Severity.warning
|
|
306
307
|
};
|
|
307
308
|
}
|
|
@@ -312,14 +313,14 @@ async function getSelectedServiceMessage(serviceChoices, selectedService, connec
|
|
|
312
313
|
const result = (0, service_helpers_1.showCollabDraftWarning)(showCollabDraftWarnOptions.edmx);
|
|
313
314
|
if (result) {
|
|
314
315
|
return {
|
|
315
|
-
message: (0, i18n_1.t)('
|
|
316
|
+
message: (0, i18n_1.t)('warnings.collaborativeDraftMessage'),
|
|
316
317
|
severity: yeoman_ui_types_1.Severity.warning
|
|
317
318
|
};
|
|
318
319
|
}
|
|
319
320
|
}
|
|
320
321
|
if (serviceType && serviceType !== axios_extension_1.ServiceType.UI) {
|
|
321
322
|
return {
|
|
322
|
-
message: (0, i18n_1.t)('
|
|
323
|
+
message: (0, i18n_1.t)('warnings.nonUIServiceTypeWarningMessage', { serviceType: 'A2X' }),
|
|
323
324
|
severity: yeoman_ui_types_1.Severity.warning
|
|
324
325
|
};
|
|
325
326
|
}
|
|
@@ -9,6 +9,7 @@ const utils_1 = require("../../../../utils");
|
|
|
9
9
|
const types_2 = require("../new-system/types");
|
|
10
10
|
const prompt_helpers_1 = require("../prompt-helpers");
|
|
11
11
|
const validators_1 = require("../validators");
|
|
12
|
+
const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
|
|
12
13
|
/**
|
|
13
14
|
* Convert the system connection scheme (Service Key, Rentrance Ticket, etc) to the store specific authentication type.
|
|
14
15
|
* Note the absence of CF Discovery, in this case the service key file (UAA) is also used for the Abap connectivity.
|
|
@@ -74,6 +75,14 @@ function getSystemUrlQuestion(connectValidator, promptNamespace, requiredOdataVe
|
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
return valResult;
|
|
78
|
+
},
|
|
79
|
+
additionalMessages: () => {
|
|
80
|
+
if (connectValidator.ignoreCertError) {
|
|
81
|
+
return {
|
|
82
|
+
message: (0, i18n_1.t)('warnings.certErrorIgnoredByNodeSetting'),
|
|
83
|
+
severity: yeoman_ui_types_1.Severity.warning
|
|
84
|
+
};
|
|
85
|
+
}
|
|
77
86
|
}
|
|
78
87
|
};
|
|
79
88
|
return newSystemUrlQuestion;
|
|
@@ -132,6 +132,12 @@ async function getSystemConnectionQuestions(connectionValidator, promptOptions,
|
|
|
132
132
|
severity: yeoman_ui_types_1.Severity.information
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
+
if (connectionValidator.ignoreCertError) {
|
|
136
|
+
return {
|
|
137
|
+
message: (0, i18n_1.t)('warnings.certErrorIgnoredByNodeSetting'),
|
|
138
|
+
severity: yeoman_ui_types_1.Severity.warning
|
|
139
|
+
};
|
|
140
|
+
}
|
|
135
141
|
}
|
|
136
142
|
}
|
|
137
143
|
];
|
|
@@ -49,7 +49,7 @@ function getServiceUrlPrompt(connectValidator, requiredVersion, showCollabDraftW
|
|
|
49
49
|
const valResult = await (0, validators_1.validateService)(url, {
|
|
50
50
|
odataService: connectValidator.odataService,
|
|
51
51
|
axiosConfig: connectValidator.axiosConfig
|
|
52
|
-
}, requiredVersion);
|
|
52
|
+
}, requiredVersion, connectValidator.ignoreCertError);
|
|
53
53
|
showAnnotationWarning = !!valResult.showAnnotationWarning;
|
|
54
54
|
convertedMetadata = valResult.convertedMetadata;
|
|
55
55
|
return valResult.validationResult;
|
|
@@ -58,7 +58,7 @@ function getServiceUrlPrompt(connectValidator, requiredVersion, showCollabDraftW
|
|
|
58
58
|
}
|
|
59
59
|
return urlValidationState;
|
|
60
60
|
},
|
|
61
|
-
additionalMessages: () => getAdditionalMessages(showAnnotationWarning, showCollabDraftWarn, convertedMetadata)
|
|
61
|
+
additionalMessages: () => getAdditionalMessages(showAnnotationWarning, showCollabDraftWarn, convertedMetadata, connectValidator.ignoreCertError)
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
@@ -68,18 +68,25 @@ function getServiceUrlPrompt(connectValidator, requiredVersion, showCollabDraftW
|
|
|
68
68
|
* @param showCollabDraftWarn true to show collaborative draft warning, this will be shown only if `showAnnotationWarning` is false
|
|
69
69
|
* and determines that collaborative draft is not enabled
|
|
70
70
|
* @param convertedMetadata provided to avoid reparsing the metadata
|
|
71
|
+
* @param showNodeCertWarning
|
|
71
72
|
* @returns
|
|
72
73
|
*/
|
|
73
|
-
function getAdditionalMessages(showAnnotationWarning, showCollabDraftWarn, convertedMetadata) {
|
|
74
|
+
function getAdditionalMessages(showAnnotationWarning, showCollabDraftWarn, convertedMetadata, showNodeCertWarning) {
|
|
75
|
+
if (showNodeCertWarning) {
|
|
76
|
+
return {
|
|
77
|
+
message: (0, i18n_1.t)('warnings.certErrorIgnoredByNodeSetting'),
|
|
78
|
+
severity: yeoman_ui_types_1.Severity.warning
|
|
79
|
+
};
|
|
80
|
+
}
|
|
74
81
|
if (showAnnotationWarning) {
|
|
75
82
|
return {
|
|
76
|
-
message: (0, i18n_1.t)('
|
|
83
|
+
message: (0, i18n_1.t)('warnings.noAnnotations'),
|
|
77
84
|
severity: yeoman_ui_types_1.Severity.warning
|
|
78
85
|
};
|
|
79
86
|
}
|
|
80
87
|
if (convertedMetadata && showCollabDraftWarn && (0, service_helpers_1.showCollabDraftWarning)(convertedMetadata)) {
|
|
81
88
|
return {
|
|
82
|
-
message: (0, i18n_1.t)('
|
|
89
|
+
message: (0, i18n_1.t)('warnings.collaborativeDraftMessage'),
|
|
83
90
|
severity: yeoman_ui_types_1.Severity.warning
|
|
84
91
|
};
|
|
85
92
|
}
|
|
@@ -97,7 +104,7 @@ function getIgnoreCertErrorsPrompt(connectValidator, requiredVersion, showCollab
|
|
|
97
104
|
let convertedMetadata;
|
|
98
105
|
return {
|
|
99
106
|
when: ({ serviceUrl }) => {
|
|
100
|
-
if (serviceUrl && connectValidator.validity.canSkipCertError) {
|
|
107
|
+
if (serviceUrl && connectValidator.validity.canSkipCertError && !connectValidator.ignoreCertError) {
|
|
101
108
|
return true;
|
|
102
109
|
}
|
|
103
110
|
return false;
|
|
@@ -112,7 +119,7 @@ function getIgnoreCertErrorsPrompt(connectValidator, requiredVersion, showCollab
|
|
|
112
119
|
return false;
|
|
113
120
|
}
|
|
114
121
|
if (ignoreCertError) {
|
|
115
|
-
logger_helper_1.default.logger.warn((0, i18n_1.t)('
|
|
122
|
+
logger_helper_1.default.logger.warn((0, i18n_1.t)('warnings.warningCertificateValidationDisabled'));
|
|
116
123
|
}
|
|
117
124
|
const validUrl = await connectValidator.validateUrl(serviceUrl, {
|
|
118
125
|
ignoreCertError,
|
|
@@ -154,7 +161,7 @@ function getCliIgnoreCertValidatePrompt(connectValidator, requiredVersion) {
|
|
|
154
161
|
throw new Error((0, i18n_1.t)('errors.exitingGeneration', { exitReason: (0, i18n_1.t)('errors.certValidationRequired') }));
|
|
155
162
|
}
|
|
156
163
|
// If the user choose to ignore cert errors, we need to re-validate
|
|
157
|
-
logger_helper_1.default.logger.warn((0, i18n_1.t)('
|
|
164
|
+
logger_helper_1.default.logger.warn((0, i18n_1.t)('warnings.warningCertificateValidationDisabled'));
|
|
158
165
|
// Re-check if auth required as the cert error would have prevented this check earlier
|
|
159
166
|
const validUrl = await connectValidator.validateUrl(serviceUrl, {
|
|
160
167
|
ignoreCertError,
|
|
@@ -233,7 +240,7 @@ function getPasswordPrompt(connectValidator, requiredVersion, showCollabDraftWar
|
|
|
233
240
|
const valResult = await (0, validators_1.validateService)(serviceUrl, {
|
|
234
241
|
odataService: connectValidator.odataService,
|
|
235
242
|
axiosConfig: connectValidator.axiosConfig
|
|
236
|
-
}, requiredVersion, ignoreCertError);
|
|
243
|
+
}, requiredVersion, ignoreCertError || connectValidator.ignoreCertError);
|
|
237
244
|
showAnnotationWarning = !!valResult.showAnnotationWarning;
|
|
238
245
|
convertedMetadata = valResult.convertedMetadata;
|
|
239
246
|
return valResult.validationResult;
|
|
@@ -57,16 +57,8 @@
|
|
|
57
57
|
"metadataInvalid": "The service metadata is invalid.",
|
|
58
58
|
"metadataFilePathNotValid": "Metadata file does not exist or is not accessible. Please specify a valid file path.",
|
|
59
59
|
"capProjectNotFound": "The folder you have selected does not seem to contain a valid CAP project. Please check and try again.",
|
|
60
|
-
"warningCertificateValidationDisabled": "User has disabled certificate validation",
|
|
61
60
|
"annotationsNotFound": "Annotations not found for specified service"
|
|
62
61
|
},
|
|
63
|
-
"warnings": {
|
|
64
|
-
"nonUIServiceTypeWarningMessage": "Please note that {{serviceType}} services, or not classified services, are not intended to be used for the generation of SAP Fiori UI applications",
|
|
65
|
-
"noServicesAvailable": "No services available for the selected system, see logs for further details.",
|
|
66
|
-
"noServicesAvailableForOdataVersion": "There are no V{{odataVersion}} OData services available from the selected system and the template you have chosen supports V{{odataVersion}} OData services only",
|
|
67
|
-
"noAnnotations": "No backend annotations associated with this service were retrieved and may result in an invalid application being created",
|
|
68
|
-
"collaborativeDraftMessage": "The selected service is draft enabled but does not support collaborative draft."
|
|
69
|
-
},
|
|
70
62
|
"systemUrl": {
|
|
71
63
|
"message": "System URL",
|
|
72
64
|
"description": "Enter the URL of the SAP System",
|
|
@@ -229,7 +221,16 @@
|
|
|
229
221
|
"v2CatalogServiceNoAnnotations": "Error creating v2 catalog service object, annotations will not be available: {{-error}}"
|
|
230
222
|
},
|
|
231
223
|
"warnings": {
|
|
232
|
-
"largeMetadataDocument": "The metadata for this OData service is significantly large. It may take some time before this operation completes."
|
|
224
|
+
"largeMetadataDocument": "The metadata for this OData service is significantly large. It may take some time before this operation completes.",
|
|
225
|
+
"warningCertificateValidationDisabled": "User has disabled certificate validation",
|
|
226
|
+
"nonUIServiceTypeWarningMessage": "Please note that {{serviceType}} services, or not classified services, are not intended to be used for the generation of SAP Fiori UI applications",
|
|
227
|
+
"noServicesAvailable": "No services available for the selected system, see logs for further details.",
|
|
228
|
+
"noServicesAvailableForOdataVersion": "There are no V{{odataVersion}} OData services available from the selected system and the template you have chosen supports V{{odataVersion}} OData services only",
|
|
229
|
+
"noAnnotations": "No backend annotations associated with this service were retrieved and may result in an invalid application being created",
|
|
230
|
+
"collaborativeDraftMessage": "The selected service is draft enabled but does not support collaborative draft.",
|
|
231
|
+
"certificateErrors": "A certificate error occurred when connecting to the host: {{-url}}. Certificate error: {{error}}.",
|
|
232
|
+
"allowingUnauthorizedCertsNode": "Setting the `NODE_TLS_REJECT_UNAUTHORIZED` environment variable to `0` makes TLS connections and HTTPS requests insecure by disabling certificate verification. It is important to understand the security risks when using this setting.",
|
|
233
|
+
"certErrorIgnoredByNodeSetting": "An SSL certificate error is being ignored by the 'NODE_TLS_REJECT_UNAUTHORIZED=0' Node.js setting. This makes TLS connections and HTTPS requests insecure by disabling certificate verification. For details of the certification error, see the logs."
|
|
233
234
|
},
|
|
234
235
|
"texts": {
|
|
235
236
|
"suggestedSystemNameClient": ", client {{client}}",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/odata-service-inquirer",
|
|
3
3
|
"description": "Prompts module that can prompt users for inputs required for odata service writing",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.6",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@sap/cf-tools": "3.2.2",
|
|
23
23
|
"@sap-ux/annotation-converter": "0.10.2",
|
|
24
|
-
"@sap-ux/edmx-parser": "0.9.
|
|
24
|
+
"@sap-ux/edmx-parser": "0.9.1",
|
|
25
25
|
"axios": "1.8.2",
|
|
26
26
|
"axios-logger": "2.8.0",
|
|
27
27
|
"fast-xml-parser": "4.4.1",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@sap-ux/fiori-generator-shared": "0.12.1",
|
|
34
34
|
"@sap-ux/guided-answers-helper": "0.3.0",
|
|
35
35
|
"@sap-ux/telemetry": "0.6.1",
|
|
36
|
-
"@sap-ux/inquirer-common": "0.7.
|
|
36
|
+
"@sap-ux/inquirer-common": "0.7.2",
|
|
37
37
|
"@sap-ux/logger": "0.7.0",
|
|
38
38
|
"@sap-ux/project-access": "1.30.1",
|
|
39
39
|
"@sap-ux/project-input-validator": "0.6.1",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"@types/lodash": "4.14.202",
|
|
48
48
|
"jest-extended": "3.2.4",
|
|
49
49
|
"@sap-ux/fiori-generator-shared": "0.12.1",
|
|
50
|
-
"@sap-ux/fiori-elements-writer": "2.4.
|
|
51
|
-
"@sap-ux/fiori-freestyle-writer": "2.4.
|
|
50
|
+
"@sap-ux/fiori-elements-writer": "2.4.6",
|
|
51
|
+
"@sap-ux/fiori-freestyle-writer": "2.4.3",
|
|
52
52
|
"@sap-ux/feature-toggle": "0.3.0",
|
|
53
|
-
"@sap-ux/odata-service-writer": "0.27.
|
|
53
|
+
"@sap-ux/odata-service-writer": "0.27.3",
|
|
54
54
|
"@sap-ux/cap-config-writer": "0.10.1"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|