@sap-cloud-sdk/connectivity 4.0.3-20250423143948.0 → 4.0.3-20250426013845.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
@@ -36,11 +36,11 @@ If you would like to contribute to the SAP Cloud SDK, please make yourself famil
36
36
 
37
37
  - [Official support channel](https://github.com/SAP/cloud-sdk-js/issues/new/choose)
38
38
  - [Github](https://github.com/SAP/cloud-sdk-js)
39
- - [SAP Cloud SDK Documentation portal](https://sap.github.io/cloud-sdk)
40
- - [SAP Cloud SDK Documentation portal - Overview](https://sap.github.io/cloud-sdk/docs/js/overview)
41
- - [SAP Cloud SDK Documentation portal - Getting started guide](https://sap.github.io/cloud-sdk/docs/js/getting-started)
42
- - [SAP Cloud SDK Documentation portal - API documentation](https://sap.github.io/cloud-sdk/api/latest)
43
- - [SAP Cloud SDK Documentation portal - Release notes](https://sap.github.io/cloud-sdk/docs/js/release-notes)
39
+ - [SAP Cloud SDK Documentation](https://sap.github.io/cloud-sdk)
40
+ - [Overview](https://sap.github.io/cloud-sdk/docs/js/overview)
41
+ - [Getting started guide](https://sap.github.io/cloud-sdk/docs/js/getting-started)
42
+ - [API documentation](https://sap.github.io/cloud-sdk/api/latest)
43
+ - [Release notes](https://sap.github.io/cloud-sdk/docs/js/release-notes)
44
44
  - [Sample repository](https://github.com/SAP-samples/cloud-sdk-js)
45
45
 
46
46
  ## License
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@
3
3
  * @packageDocumentation
4
4
  * @module @sap-cloud-sdk/connectivity
5
5
  */
6
- export { toDestinationNameUrl, sanitizeDestination, DestinationCacheInterface, CacheEntry, CachingOptions, getDestination, useOrFetchDestination, getDestinationFromDestinationService, alwaysProvider, alwaysSubscriber, subscriberFirst, parseProxyEnv, Protocol, IsolationStrategy, decodeJwt, retrieveJwt, jwtBearerToken, serviceToken, Destination, HttpDestination, isHttpDestination, HttpDestinationOrFetchOptions, assertHttpDestination, DestinationFetchOptions, ServiceBindingTransformFunction, DestinationAccessorOptions, DestinationSelectionStrategies, JwtPayload, BasicProxyConfiguration, ProxyConfiguration, ProxyConfigurationHeaders, Service, VerifyJwtOptions, buildHeadersForDestination, getClientCredentialsToken, getUserToken, registerDestination, setDestinationCache, DestinationAuthToken, DestinationCertificate, ClientCredentialsResponse, AllDestinations, DestinationConfiguration, DestinationJson, DestinationsByType, DestinationFromServiceBindingOptions, getServiceBinding, getDestinationFromServiceBinding, ServiceBindingTransformOptions, transformServiceBindingToDestination, getAllDestinationsFromDestinationService, getTenantId, transformServiceBindingToClientCredentialsDestination } from './scp-cf';
6
+ export { toDestinationNameUrl, sanitizeDestination, getDestination, useOrFetchDestination, getDestinationFromDestinationService, alwaysProvider, alwaysSubscriber, subscriberFirst, parseProxyEnv, decodeJwt, retrieveJwt, jwtBearerToken, serviceToken, isHttpDestination, assertHttpDestination, DestinationSelectionStrategies, buildHeadersForDestination, getClientCredentialsToken, getUserToken, registerDestination, setDestinationCache, getServiceBinding, getDestinationFromServiceBinding, transformServiceBindingToDestination, getAllDestinationsFromDestinationService, getTenantId, transformServiceBindingToClientCredentialsDestination } from './scp-cf';
7
+ export type { DestinationCacheInterface, CacheEntry, CachingOptions, Protocol, IsolationStrategy, Destination, HttpDestination, HttpDestinationOrFetchOptions, DestinationFetchOptions, ServiceBindingTransformFunction, DestinationAccessorOptions, JwtPayload, BasicProxyConfiguration, ProxyConfiguration, ProxyConfigurationHeaders, Service, VerifyJwtOptions, DestinationAuthToken, DestinationCertificate, ClientCredentialsResponse, AllDestinations, DestinationConfiguration, DestinationJson, DestinationsByType, DestinationFromServiceBindingOptions, ServiceBindingTransformOptions } from './scp-cf';
7
8
  export type { DestinationRetrievalOptions, DestinationSelectionStrategy, DestinationOrFetchOptions, DestinationOptions, ServiceCredentials, XsuaaServiceCredentials, DestinationProxyType, AuthenticationType, DestinationWithName, RegisterDestinationOptions, DestinationWithoutToken, AllDestinationOptions } from './scp-cf';
8
- export { getAgentConfig, HttpAgentConfig, HttpsAgentConfig } from './http-agent';
9
+ export { getAgentConfig } from './http-agent';
10
+ export type { HttpAgentConfig, HttpsAgentConfig } from './http-agent';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAgentConfig = exports.transformServiceBindingToClientCredentialsDestination = exports.getTenantId = exports.getAllDestinationsFromDestinationService = exports.transformServiceBindingToDestination = exports.getDestinationFromServiceBinding = exports.getServiceBinding = exports.setDestinationCache = exports.registerDestination = exports.getUserToken = exports.getClientCredentialsToken = exports.buildHeadersForDestination = exports.DestinationSelectionStrategies = exports.assertHttpDestination = exports.isHttpDestination = exports.serviceToken = exports.jwtBearerToken = exports.retrieveJwt = exports.decodeJwt = exports.parseProxyEnv = exports.subscriberFirst = exports.alwaysSubscriber = exports.alwaysProvider = exports.getDestinationFromDestinationService = exports.useOrFetchDestination = exports.getDestination = exports.sanitizeDestination = exports.toDestinationNameUrl = void 0;
2
4
  /**
3
5
  * [[include:connectivity/README.md]]
4
6
  * @packageDocumentation
5
7
  * @module @sap-cloud-sdk/connectivity
6
8
  */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.getAgentConfig = exports.transformServiceBindingToClientCredentialsDestination = exports.getTenantId = exports.getAllDestinationsFromDestinationService = exports.transformServiceBindingToDestination = exports.getDestinationFromServiceBinding = exports.getServiceBinding = exports.setDestinationCache = exports.registerDestination = exports.getUserToken = exports.getClientCredentialsToken = exports.buildHeadersForDestination = exports.DestinationSelectionStrategies = exports.assertHttpDestination = exports.isHttpDestination = exports.serviceToken = exports.jwtBearerToken = exports.retrieveJwt = exports.decodeJwt = exports.parseProxyEnv = exports.subscriberFirst = exports.alwaysSubscriber = exports.alwaysProvider = exports.getDestinationFromDestinationService = exports.useOrFetchDestination = exports.getDestination = exports.sanitizeDestination = exports.toDestinationNameUrl = void 0;
9
9
  var scp_cf_1 = require("./scp-cf");
10
10
  Object.defineProperty(exports, "toDestinationNameUrl", { enumerable: true, get: function () { return scp_cf_1.toDestinationNameUrl; } });
11
11
  Object.defineProperty(exports, "sanitizeDestination", { enumerable: true, get: function () { return scp_cf_1.sanitizeDestination; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mCAsDkB;AArDhB,8GAAA,oBAAoB,OAAA;AACpB,6GAAA,mBAAmB,OAAA;AAInB,wGAAA,cAAc,OAAA;AACd,+GAAA,qBAAqB,OAAA;AACrB,8HAAA,oCAAoC,OAAA;AACpC,wGAAA,cAAc,OAAA;AACd,0GAAA,gBAAgB,OAAA;AAChB,yGAAA,eAAe,OAAA;AACf,uGAAA,aAAa,OAAA;AAGb,mGAAA,SAAS,OAAA;AACT,qGAAA,WAAW,OAAA;AACX,wGAAA,cAAc,OAAA;AACd,sGAAA,YAAY,OAAA;AAGZ,2GAAA,iBAAiB,OAAA;AAEjB,+GAAA,qBAAqB,OAAA;AAIrB,wHAAA,8BAA8B,OAAA;AAO9B,oHAAA,0BAA0B,OAAA;AAC1B,mHAAA,yBAAyB,OAAA;AACzB,sGAAA,YAAY,OAAA;AACZ,6GAAA,mBAAmB,OAAA;AACnB,6GAAA,mBAAmB,OAAA;AASnB,2GAAA,iBAAiB,OAAA;AACjB,0HAAA,gCAAgC,OAAA;AAEhC,8HAAA,oCAAoC,OAAA;AACpC,kIAAA,wCAAwC,OAAA;AACxC,qGAAA,WAAW,OAAA;AACX,+IAAA,qDAAqD,OAAA;AAkBvD,2CAIsB;AAHpB,4GAAA,cAAc,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mCA4BkB;AA3BhB,8GAAA,oBAAoB,OAAA;AACpB,6GAAA,mBAAmB,OAAA;AACnB,wGAAA,cAAc,OAAA;AACd,+GAAA,qBAAqB,OAAA;AACrB,8HAAA,oCAAoC,OAAA;AACpC,wGAAA,cAAc,OAAA;AACd,0GAAA,gBAAgB,OAAA;AAChB,yGAAA,eAAe,OAAA;AACf,uGAAA,aAAa,OAAA;AACb,mGAAA,SAAS,OAAA;AACT,qGAAA,WAAW,OAAA;AACX,wGAAA,cAAc,OAAA;AACd,sGAAA,YAAY,OAAA;AACZ,2GAAA,iBAAiB,OAAA;AACjB,+GAAA,qBAAqB,OAAA;AACrB,wHAAA,8BAA8B,OAAA;AAC9B,oHAAA,0BAA0B,OAAA;AAC1B,mHAAA,yBAAyB,OAAA;AACzB,sGAAA,YAAY,OAAA;AACZ,6GAAA,mBAAmB,OAAA;AACnB,6GAAA,mBAAmB,OAAA;AACnB,2GAAA,iBAAiB,OAAA;AACjB,0HAAA,gCAAgC,OAAA;AAChC,8HAAA,oCAAoC,OAAA;AACpC,kIAAA,wCAAwC,OAAA;AACxC,qGAAA,WAAW,OAAA;AACX,+IAAA,qDAAqD,OAAA;AA8CvD,2CAA8C;AAArC,4GAAA,cAAc,OAAA"}
@@ -26,12 +26,16 @@ function isSubscriberToken(token) {
26
26
  * @internal
27
27
  */
28
28
  async function getSubscriberToken(options) {
29
- const userJwt = await retrieveUserToken(options);
29
+ const isXsuaaJwt = !!options.jwt && (0, jwt_1.isXsuaaToken)((0, jwt_1.decodeJwt)(options.jwt));
30
+ const userJwt = await retrieveUserToken(options, isXsuaaJwt);
30
31
  const serviceJwt = await retrieveServiceToken(options, userJwt?.decoded);
31
32
  return { userJwt, serviceJwt };
32
33
  }
33
- async function retrieveUserToken(options) {
34
+ async function retrieveUserToken(options, isXsuaaJwt) {
34
35
  if (options.jwt) {
36
+ if (!options.iss && isXsuaaJwt) {
37
+ await (0, jwt_1.verifyJwt)(options.jwt, options);
38
+ }
35
39
  return (0, jwt_1.getJwtPair)(options.jwt);
36
40
  }
37
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-subscriber-token.js","sourceRoot":"","sources":["../../../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CAAC;IAED,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;AAC/E,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU,CACjB,KAAkC;IAElC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,KAAkC;IAC1D,OAAO,CAAC,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC;AACjD,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAAC,KAAgC;IAC9D,OAAO,KAAK,CAAC,UAAU,CAAC;AAC1B,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,aAAa,CAAC,KAAgC;IAC5D,OAAO,KAAK,CAAC,OAAO,CAAC;AACvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-cloud-sdk/connectivity",
3
- "version": "4.0.3-20250423143948.0",
3
+ "version": "4.0.3-20250426013845.0",
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,12 +36,12 @@
36
36
  "readme": "ts-node ../../scripts/replace-common-readme.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@sap-cloud-sdk/resilience": "^4.0.3-20250423143948.0",
40
- "@sap-cloud-sdk/util": "^4.0.3-20250423143948.0",
39
+ "@sap-cloud-sdk/resilience": "^4.0.3-20250426013845.0",
40
+ "@sap-cloud-sdk/util": "^4.0.3-20250426013845.0",
41
41
  "@sap/xsenv": "^5.5.0",
42
42
  "@sap/xssec": "^4.6.0",
43
43
  "async-retry": "^1.3.3",
44
- "axios": "^1.8.4",
44
+ "axios": "^1.9.0",
45
45
  "jsonwebtoken": "^9.0.2"
46
46
  },
47
47
  "devDependencies": {