@sap-cloud-sdk/connectivity 3.26.3 → 3.26.4
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.
|
@@ -8,7 +8,6 @@ const jwt_1 = require("../jwt");
|
|
|
8
8
|
const environment_accessor_1 = require("../environment-accessor");
|
|
9
9
|
const http_proxy_util_1 = require("./http-proxy-util");
|
|
10
10
|
const destination_service_types_1 = require("./destination-service-types");
|
|
11
|
-
const destination_cache_1 = require("./destination-cache");
|
|
12
11
|
const service_binding_to_destination_1 = require("./service-binding-to-destination");
|
|
13
12
|
const forward_auth_token_1 = require("./forward-auth-token");
|
|
14
13
|
const logger = (0, util_1.createLogger)({
|
|
@@ -29,17 +28,7 @@ async function getDestinationFromServiceBinding(options) {
|
|
|
29
28
|
? (0, jwt_1.decodeJwt)(options.jwt)
|
|
30
29
|
: undefined;
|
|
31
30
|
const retrievalOptions = { ...options, jwt: decodedJwt };
|
|
32
|
-
|
|
33
|
-
if (options.useCache) {
|
|
34
|
-
destination = await destination_cache_1.destinationCache.retrieveDestinationFromCache((0, jwt_1.decodeOrMakeJwt)(retrievalOptions.jwt), retrievalOptions.destinationName, 'tenant');
|
|
35
|
-
}
|
|
36
|
-
if (!destination) {
|
|
37
|
-
destination = await retrieveDestinationWithoutCache(retrievalOptions);
|
|
38
|
-
if (options.useCache) {
|
|
39
|
-
// As the grant type is clientCredential, isolation strategy is 'tenant'.
|
|
40
|
-
await destination_cache_1.destinationCache.cacheRetrievedDestination((0, jwt_1.decodeOrMakeJwt)(options.jwt), destination, 'tenant');
|
|
41
|
-
}
|
|
42
|
-
}
|
|
31
|
+
const destination = await retrieveDestination(retrievalOptions);
|
|
43
32
|
const destWithProxy = destination &&
|
|
44
33
|
(0, destination_service_types_1.isHttpDestination)(destination) &&
|
|
45
34
|
['internet', 'private-link'].includes((0, http_proxy_util_1.proxyStrategy)(destination))
|
|
@@ -50,7 +39,7 @@ async function getDestinationFromServiceBinding(options) {
|
|
|
50
39
|
}
|
|
51
40
|
return destWithProxy;
|
|
52
41
|
}
|
|
53
|
-
async function
|
|
42
|
+
async function retrieveDestination({ useCache, jwt, destinationName, serviceBindingTransformFn }) {
|
|
54
43
|
const service = (0, environment_accessor_1.getServiceBindingByInstanceName)(destinationName);
|
|
55
44
|
const destination = await (serviceBindingTransformFn || transform)(service, {
|
|
56
45
|
useCache,
|
|
@@ -68,12 +57,6 @@ async function retrieveDestinationWithoutCache({ useCache, jwt, destinationName,
|
|
|
68
57
|
* @deprecated Since v3.4.0. Use {@link getDestinationFromServiceBinding} instead.
|
|
69
58
|
*/
|
|
70
59
|
async function destinationForServiceBinding(serviceInstanceName, options = {}) {
|
|
71
|
-
if (options.useCache) {
|
|
72
|
-
const destinationFromCache = await destination_cache_1.destinationCache.retrieveDestinationFromCache((0, jwt_1.decodeOrMakeJwt)(options.jwt), serviceInstanceName, 'tenant');
|
|
73
|
-
if (destinationFromCache) {
|
|
74
|
-
return destinationFromCache;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
60
|
const optionsForTransformation = {
|
|
78
61
|
useCache: options.useCache,
|
|
79
62
|
jwt: options.jwt
|
|
@@ -86,10 +69,6 @@ async function destinationForServiceBinding(serviceInstanceName, options = {}) {
|
|
|
86
69
|
['internet', 'private-link'].includes((0, http_proxy_util_1.proxyStrategy)(destination))
|
|
87
70
|
? (0, http_proxy_util_1.addProxyConfigurationInternet)(destination)
|
|
88
71
|
: destination;
|
|
89
|
-
if (options.useCache) {
|
|
90
|
-
// As the grant type is clientCredential, isolation strategy is 'tenant'.
|
|
91
|
-
await destination_cache_1.destinationCache.cacheRetrievedDestination((0, jwt_1.decodeOrMakeJwt)(options.jwt), destWithProxy, 'tenant');
|
|
92
|
-
}
|
|
93
72
|
return destWithProxy;
|
|
94
73
|
}
|
|
95
74
|
async function transform(service, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destination-from-vcap.js","sourceRoot":"","sources":["../../../src/scp-cf/destination/destination-from-vcap.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"destination-from-vcap.js","sourceRoot":"","sources":["../../../src/scp-cf/destination/destination-from-vcap.ts"],"names":[],"mappings":";;AAyCA,4EA4BC;AA4BD,oEAqBC;AAiDD,gFAeC;AAtLD,8CAAmD;AACnD,gCAAmC;AACnC,kEAA0E;AAC1E,uDAG2B;AAC3B,2EAAgE;AAChE,qFAAoF;AACpF,6DAAqE;AAOrE,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC;IAC1B,OAAO,EAAE,cAAc;IACvB,cAAc,EAAE,2BAA2B;CAC5C,CAAC,CAAC;AAeH;;;;;;GAMG;AACI,KAAK,UAAU,gCAAgC,CACpD,OAIqC;IAErC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG;QAC5B,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QACtB,CAAC,CAAC,OAAO,CAAC,GAAG;YACX,CAAC,CAAC,IAAA,eAAS,EAAC,OAAO,CAAC,GAAG,CAAC;YACxB,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,gBAAgB,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;IACzD,MAAM,WAAW,GAAG,MAAM,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAEhE,MAAM,aAAa,GACjB,WAAW;QACX,IAAA,6CAAiB,EAAC,WAAW,CAAC;QAC9B,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,IAAA,+BAAa,EAAC,WAAW,CAAC,CAAC;QAC/D,CAAC,CAAC,IAAA,+CAA6B,EAAC,WAAW,CAAC;QAC5C,CAAC,CAAC,WAAW,CAAC;IAElB,IAAI,aAAa,EAAE,CAAC;QAClB,IAAA,kDAA6B,EAAC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,K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CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,4BAA4B,CAAC,OAAgB;IACpD,OAAO,KAAK,CAAC,gBAAgB,OAAO,CAAC,IAAI,iBAAiB,OAAO,CAAC,KAAK;8GACqC,CAAC,CAAC;AAChH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,kCAAkC,CACtD,OAAsE;IAEtE,MAAM,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;IACzE,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,MAAM,gCAAgC,CAAC,OAAO,CAAC,CAAC;QAEpE,MAAM,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;QACxE,OAAO,WAAW,CAAC;IACrB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CACV,oJAAoJ,KAAK,CAAC,OAAO,EAAE,CACpK,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-cloud-sdk/connectivity",
|
|
3
|
-
"version": "3.26.
|
|
3
|
+
"version": "3.26.4",
|
|
4
4
|
"description": "SAP Cloud SDK for JavaScript connectivity",
|
|
5
5
|
"homepage": "https://sap.github.io/cloud-sdk/docs/js/overview",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"readme": "ts-node ../../scripts/replace-common-readme.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@sap-cloud-sdk/resilience": "^3.26.
|
|
40
|
-
"@sap-cloud-sdk/util": "^3.26.
|
|
39
|
+
"@sap-cloud-sdk/resilience": "^3.26.4",
|
|
40
|
+
"@sap-cloud-sdk/util": "^3.26.4",
|
|
41
41
|
"@sap/xsenv": "^5.4.0",
|
|
42
42
|
"@sap/xssec": "^4.4.0",
|
|
43
43
|
"async-retry": "^1.3.3",
|