@sap-cloud-sdk/connectivity
Advanced tools
Comparing version
@@ -30,4 +30,6 @@ import { Cache } from '../cache'; | ||
* @internal | ||
* Retrieve the subdomain from the decoded XSUAA JWT. If the JWT is not in XSUAA format, returns `undefined`. | ||
* @param jwt - JWT to retrieve the subdomain from. | ||
* Retrieve the subdomain from the decoded XSUAA JWT or ISS object. | ||
* If it is an IAS JWT, or the passed object doesn't contain an ISS propety, | ||
* returns `undefined`. | ||
* @param jwt - JWT or ISS object to retrieve the subdomain from. | ||
* @returns The subdomain, if available. | ||
@@ -34,0 +36,0 @@ */ |
@@ -61,5 +61,18 @@ "use strict"; | ||
/** | ||
* Check if the given JWT is not an IAS token. | ||
* Currently, there are only two domains for IAS tokens: | ||
* `accounts.ondemand.com` and `accounts400.onemand.com`. | ||
* @param decodedJwt - The decoded JWT to check. | ||
* @returns Whether the given JWT is not an IAS token. | ||
*/ | ||
function isNotIasToken(decodedJwt) { | ||
return (!decodedJwt.iss?.includes('accounts.ondemand.com') && | ||
!decodedJwt.iss?.includes('accounts400.ondemand.com')); | ||
} | ||
/** | ||
* @internal | ||
* Retrieve the subdomain from the decoded XSUAA JWT. If the JWT is not in XSUAA format, returns `undefined`. | ||
* @param jwt - JWT to retrieve the subdomain from. | ||
* Retrieve the subdomain from the decoded XSUAA JWT or ISS object. | ||
* If it is an IAS JWT, or the passed object doesn't contain an ISS propety, | ||
* returns `undefined`. | ||
* @param jwt - JWT or ISS object to retrieve the subdomain from. | ||
* @returns The subdomain, if available. | ||
@@ -70,3 +83,3 @@ */ | ||
return (decodedJwt?.ext_attr?.zdn || | ||
(isXsuaaToken(decodedJwt) ? (0, subdomain_replacer_1.getIssuerSubdomain)(decodedJwt) : undefined)); | ||
(isNotIasToken(decodedJwt) ? (0, subdomain_replacer_1.getIssuerSubdomain)(decodedJwt) : undefined)); | ||
} | ||
@@ -73,0 +86,0 @@ /** |
{ | ||
"name": "@sap-cloud-sdk/connectivity", | ||
"version": "3.26.1-20250217014122.0", | ||
"version": "3.26.1", | ||
"description": "SAP Cloud SDK for JavaScript connectivity", | ||
@@ -39,6 +39,6 @@ "homepage": "https://sap.github.io/cloud-sdk/docs/js/overview", | ||
"dependencies": { | ||
"@sap-cloud-sdk/resilience": "^3.26.1-20250217014122.0", | ||
"@sap-cloud-sdk/util": "^3.26.1-20250217014122.0", | ||
"@sap-cloud-sdk/resilience": "^3.26.1", | ||
"@sap-cloud-sdk/util": "^3.26.1", | ||
"@sap/xsenv": "^5.4.0", | ||
"@sap/xssec": "^4.3.0", | ||
"@sap/xssec": "^4.4.0", | ||
"async-retry": "^1.3.3", | ||
@@ -45,0 +45,0 @@ "axios": "^1.7.9", |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
357491
0.2%5835
0.26%0
-100%18
5.88%Updated
Updated