@sap-cloud-sdk/connectivity
Advanced tools
Comparing version 3.18.1-20240816013940.0 to 3.18.1
@@ -16,6 +16,2 @@ "use strict"; | ||
/** | ||
* @internal | ||
*/ | ||
const defaultTenantId = 'provider-tenant'; | ||
/** | ||
* Registers a destination in a cache for later usage. | ||
@@ -49,3 +45,3 @@ * | ||
} | ||
return { zid: defaultTenantId }; | ||
return { zid: jwt_1.defaultTenantId }; | ||
} | ||
@@ -52,0 +48,0 @@ return jwt; |
@@ -8,2 +8,6 @@ /// <reference types="node" /> | ||
* @internal | ||
*/ | ||
export declare const defaultTenantId = "provider-tenant"; | ||
/** | ||
* @internal | ||
* Get the user ID from the JWT payload. | ||
@@ -15,2 +19,8 @@ * @param jwtPayload - Token payload to read the user ID from. | ||
/** | ||
* @internal | ||
* Get the default tenant ID. | ||
* @returns The default tenant ID. | ||
*/ | ||
export declare function getDefaultTenantId(): string; | ||
/** | ||
* Get the tenant ID of a decoded JWT, based on its `zid` or if not available `app_tid` property. | ||
@@ -17,0 +27,0 @@ * @param jwt - Token to read the tenant ID from. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTenantIdFromBinding = exports.decodeOrMakeJwt = exports.isUserToken = exports.getJwtPair = exports.isXsuaaToken = exports.wrapJwtInHeader = exports.verificationKeyCache = exports.verifyJwt = exports.retrieveJwt = exports.decodeJwtComplete = exports.decodeJwt = exports.audiences = exports.getSubdomain = exports.getTenantId = exports.userId = void 0; | ||
exports.getTenantIdFromBinding = exports.decodeOrMakeJwt = exports.isUserToken = exports.getJwtPair = exports.isXsuaaToken = exports.wrapJwtInHeader = exports.verificationKeyCache = exports.verifyJwt = exports.retrieveJwt = exports.decodeJwtComplete = exports.decodeJwt = exports.audiences = exports.getSubdomain = exports.getTenantId = exports.getDefaultTenantId = exports.userId = exports.defaultTenantId = void 0; | ||
const util_1 = require("@sap-cloud-sdk/util"); | ||
@@ -14,2 +14,6 @@ const xssec_1 = require("@sap/xssec"); | ||
}); | ||
/** | ||
* @internal | ||
*/ | ||
exports.defaultTenantId = 'provider-tenant'; | ||
function makeArray(val) { | ||
@@ -30,2 +34,12 @@ return val ? (Array.isArray(val) ? val : [val]) : []; | ||
/** | ||
* @internal | ||
* Get the default tenant ID. | ||
* @returns The default tenant ID. | ||
*/ | ||
function getDefaultTenantId() { | ||
logger.debug('Could not determine tenant from JWT nor XSUAA, identity or destination service binding. Client Credentials token is cached without tenant information.'); | ||
return exports.defaultTenantId; | ||
} | ||
exports.getDefaultTenantId = getDefaultTenantId; | ||
/** | ||
* Get the tenant ID of a decoded JWT, based on its `zid` or if not available `app_tid` property. | ||
@@ -32,0 +46,0 @@ * @param jwt - Token to read the tenant ID from. |
@@ -30,3 +30,3 @@ "use strict"; | ||
? (0, jwt_1.getTenantId)(options.jwt) || (0, jwt_1.getSubdomain)(options.jwt) | ||
: (0, jwt_1.getTenantIdFromBinding)(); | ||
: (0, jwt_1.getTenantIdFromBinding)() || (0, jwt_1.getDefaultTenantId)(); | ||
if (opts.useCache) { | ||
@@ -33,0 +33,0 @@ const cachedToken = client_credentials_token_cache_1.clientCredentialsTokenCache.getToken(tenantForCaching, serviceCredentials.clientid); |
{ | ||
"name": "@sap-cloud-sdk/connectivity", | ||
"version": "3.18.1-20240816013940.0", | ||
"version": "3.18.1", | ||
"description": "SAP Cloud SDK for JavaScript connectivity", | ||
@@ -40,4 +40,4 @@ "homepage": "https://sap.github.io/cloud-sdk/docs/js/overview", | ||
"dependencies": { | ||
"@sap-cloud-sdk/resilience": "^3.18.1-20240816013940.0", | ||
"@sap-cloud-sdk/util": "^3.18.1-20240816013940.0", | ||
"@sap-cloud-sdk/resilience": "^3.18.1", | ||
"@sap-cloud-sdk/util": "^3.18.1", | ||
"@sap/xsenv": "^5.2.0", | ||
@@ -44,0 +44,0 @@ "@sap/xssec": "^4.2.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
356322
5808
0