@sap/approuter
Advanced tools
Comparing version 16.7.0 to 16.7.1
@@ -8,2 +8,8 @@ # Change Log | ||
## 16.7.1 - 2024-08-23 | ||
### Fixed | ||
- Send custom business service headers in managed approuter | ||
- Support the call to business service with credentials stored in the HTML5 repository | ||
## 16.7.0 - 2024-08-15 | ||
@@ -10,0 +16,0 @@ |
@@ -38,2 +38,3 @@ /* eslint-disable camelcase,max-depth */ | ||
module.exports.fetchDestinationBSCredentials = fetchDestinationBSCredentials; | ||
module.exports.tenantDestinationBSCredentialsCache = tenantDestinationBSCredentialsCache; | ||
@@ -322,3 +323,3 @@ function getCredentials(serviceName, ignoreDots, req) { | ||
let destServiceName = ignoreDots ? bsServiceName.replace(/\./g, '') : bsServiceName; | ||
if (destServiceName === serviceName) { | ||
if (destServiceName === serviceName || sapCloudServiceKey === serviceName) { | ||
return destinationBSCredentials[sapCloudServiceKey].credentials; | ||
@@ -616,2 +617,5 @@ } | ||
} | ||
if (prop.toLowerCase().startsWith('url.headers.')) { | ||
destinationBSCredentials[sapCloudServiceKey].credentials[prop] = destination[prop]; | ||
} | ||
} | ||
@@ -618,0 +622,0 @@ return destinationBSCredentials; |
@@ -173,3 +173,13 @@ 'use strict'; | ||
function getConfiguration(serviceName, req){ | ||
return req && req.html5RepoCredentials && req.html5RepoCredentials[(serviceName).replace(/\./g, '')] || null; | ||
if (!req || !req.html5RepoCredentials){ | ||
return null; | ||
} | ||
let configuration = req.html5RepoCredentials[(serviceName).replace(/\./g, '')] || null; | ||
// if not found search in nested services | ||
if (!configuration){ | ||
const appKey = req.dynamicRouting && req.dynamicRouting.appKey; | ||
const mainServiceName = appKey && appKey.appPrefix; | ||
configuration = req.html5RepoCredentials[mainServiceName] && req.html5RepoCredentials[mainServiceName][(serviceName).replace(/\./g, '-')]; | ||
} | ||
return configuration; | ||
} | ||
@@ -176,0 +186,0 @@ |
{ | ||
"name": "@sap/approuter", | ||
"description": "Node.js based application router", | ||
"version": "16.7.0", | ||
"version": "16.7.1", | ||
"repository": {}, | ||
@@ -6,0 +6,0 @@ "main": "approuter.js", |
740992
12025