New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sap/approuter

Package Overview
Dependencies
Maintainers
1
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/approuter - npm Package Compare versions

Comparing version 13.0.2 to 13.1.0

14

CHANGELOG.md

@@ -8,2 +8,16 @@ # Change Log

## 13.1.0 - 2023-01-24
### Fixed
- IAS credentials from HTML5 Repo handling
- Use warning log level in handleBackendError
- Debug logs for backend response
### Added
- IAS token sharing support
### Updated dependencies
- deps: @sap/xssec@^3.2.17
- deps: @sap/xsenv@^3.4.0
## 13.0.2 - 2023-01-15

@@ -10,0 +24,0 @@

4

lib/middleware/login-provider.js

@@ -49,2 +49,6 @@ 'use strict';

if (req.destinationCredentials.ias) {
if (req.destinationCredentials.ias.sharedIASToken){
updateSession(req, loginToken, null);
return cb(null);
}
tokenUtils.exchangeToken(loginToken, headerUtil.getCorrelationId(req), req.destinationCredentials.ias, (err, iasExchangedToken) => {

@@ -51,0 +55,0 @@ if (err) {

4

lib/middleware/request-handler.js

@@ -147,3 +147,3 @@ 'use strict';

const outgoingResponse = requests.outgoingResponse;
const tracer = incomingRequest.loggingContext.getTracer(__filename);
const tracer = incomingRequest.logger;
const logger = incomingRequest.loggingContext.getLogger('/request/outgoing');

@@ -285,4 +285,4 @@ const logLevel = logger.getLevel();

' ' + incommingResponse.statusMessage + ' check backend application logs';
applicationLogUtils.logRequestInfo(incomingRequest, errorMessage);
applicationLogUtils.logRequestWarning(incomingRequest, errorMessage);
}
}

@@ -10,3 +10,3 @@ 'use strict';

module.exports = function traceRequestMiddleware(req, res, next) {
const tracer = req.loggingContext.getTracer(__filename);
const tracer = req.logger;
const tenantInfo = passportUtils.getTenantInfo(req);

@@ -13,0 +13,0 @@ req.logger.setTenantId(tenantInfo.tenantid);

@@ -18,2 +18,11 @@ /* eslint-disable camelcase */

module.exports.logRequestWarning = function(options, message, inTracer) {
if (options && options.logger && process.env.SAAS_APPROUTER) {
options.logger.warn(message);
} else {
inTracer && inTracer.warning(message);
!inTracer && tracer.warning(message);
}
};
module.exports.logRequestInfo = function(options, message, inTracer) {

@@ -20,0 +29,0 @@ if (options && options.logger && process.env.SAAS_APPROUTER) {

@@ -136,3 +136,3 @@ 'use strict';

const bsCredentials = sapCloudServiceKeys[sapCloudServiceKey].credentials[prop];
const bsName = bsCredentials['sap.cloud.service'] && bsCredentials['sap.cloud.service'].replace(/\./g, '');
const bsName = bsCredentials && bsCredentials['sap.cloud.service'] && bsCredentials['sap.cloud.service'].replace(/\./g, '');
// eslint-disable-next-line max-depth

@@ -166,7 +166,9 @@ if (bsName === dependentServiceName) {

applicationsMetadata.forEach((app) => {
const configuration = app.configuration && Object.assign({}, app.configuration);
const credentials = configuration && configuration[CONFIG_CREDENTIALS];
const destinations = configuration && configuration['destinations'];
const configuration = app.configuration && Object.assign({}, app.configuration);
const credentials = configuration && configuration[CONFIG_CREDENTIALS];
const destinations = configuration && configuration['destinations'];
const html5RuntimeEnabled = configuration && configuration['HTML5Runtime_enabled'];
app.configuration = !!configuration;
if (app.configuration && credentials && (credentials.xsuaa || credentials.ias) && app.sapCloudService) {
if (app.configuration && ((credentials && (credentials.xsuaa || credentials.identity)) || html5RuntimeEnabled)
&& app.sapCloudService) {
let sapCloudServiceKey = app.sapCloudService + '!' + app.appHostId;

@@ -186,3 +188,3 @@ if (!html5ApplicationsCache[sapCloudServiceKey]) {

html5ApplicationsCache[sapCloudServiceKey].credentials['uaa'] = credentials[prop][0]['credentials'];
} else if (prop === 'ias') {
} else if (prop === 'identity') {
html5ApplicationsCache[sapCloudServiceKey].credentials['ias'] = credentials[prop][0]['credentials'];

@@ -193,2 +195,5 @@ } else {

}
if (!html5ApplicationsCache[sapCloudServiceKey].credentials['uaa'] && !html5ApplicationsCache[sapCloudServiceKey].credentials['ias']){
html5ApplicationsCache[sapCloudServiceKey].credentials['ias'] = { 'sharedIASToken': true};
}
} else {

@@ -253,2 +258,2 @@ html5ApplicationsCache[sapCloudServiceKey].applications.push(app);

return boundServices;
}
}

@@ -36,11 +36,2 @@ 'use strict';

iasOptions.tenant = tenant;
if (req.destinationCredentials && req.destinationCredentials.ias){
iasOptions.clientid = req.destinationCredentials.ias.clientid;
iasOptions.clientsecret = req.destinationCredentials.ias.clientsecret;
iasOptions.key = req.destinationCredentials.ias.key ? req.destinationCredentials.ias.key : null;
iasOptions.certificate = req.destinationCredentials.ias.certificate ? req.destinationCredentials.ias.certificate : null;
iasOptions.domain = req.destinationCredentials.ias.domain || (req.destinationCredentials.ias.domains && req.destinationCredentials.ias.domains[0]);
iasOptions.domains = req.destinationCredentials.domains;
iasOptions.url = req.destinationCredentials.ias.url;
}
cb(null, iasOptions);

@@ -47,0 +38,0 @@ }

@@ -36,3 +36,3 @@ 'use strict';

this.client.on('error', (err) => {
tracer.error(`initClient - Redis connection error, err.code ${ err.code }, err: ${ JSON.stringify(err) }`);
tracer.error(`initClient - Redis connection error, err.code ${ err.code }, err: ${ err.message }`);
if (err && err.code === 'ECONNREFUSED') {

@@ -46,3 +46,3 @@ tracer.error('initClient - onError - The server refused the connection');

} catch (err) {
tracer.error(`RedisClientDriver error: ${ JSON.stringify(err) }`);
tracer.error(`RedisClientDriver error: ${ err.message }`);
this.client = null;

@@ -49,0 +49,0 @@ }

@@ -8,3 +8,3 @@ 'use strict';

exports.traceIncomingRequest = function (tracer, req) {
if (tracer.isEnabled('debug')) {
if (tracer && tracer.isLoggingLevel && tracer.isLoggingLevel('debug')) {
tracer.debug('Incoming request to AppRouter. Path:', req.url, 'Method:', req.method, 'Headers:', exports.stringifyHeaders(req.headers));

@@ -15,3 +15,3 @@ }

exports.traceBackendRequest = function (tracer, url, requestOptions) {
if (tracer.isLoggingLevel('debug')) {
if (tracer && tracer.isLoggingLevel && tracer.isLoggingLevel('debug')) {
tracer.debug('Request to backend. Rewritten URL:', url, 'Method:', requestOptions.method, 'Headers:', exports.stringifyHeaders(requestOptions.headers));

@@ -22,3 +22,3 @@ }

exports.traceBackendResponse = function (tracer, backendRes) {
if (tracer.isEnabled('debug')) {
if (tracer && tracer.isLoggingLevel && tracer.isLoggingLevel('debug')) {
tracer.debug('Response from backend. Status:', backendRes.statusCode, 'Headers:', exports.stringifyHeaders(backendRes.headers));

@@ -29,3 +29,3 @@ }

exports.traceOutgoingResponse = function (tracer, res) {
if (tracer.isEnabled('debug')) {
if (tracer && tracer.isLoggingLevel && tracer.isLoggingLevel('debug')) {
tracer.debug('Response from AppRouter. Status:', res.statusCode, 'Headers:', exports.stringifyHeaders(res._headers));

@@ -32,0 +32,0 @@ }

{
"name": "@sap/approuter",
"description": "Node.js based application router",
"version": "13.0.2",
"version": "13.1.0",
"repository": {},

@@ -11,4 +11,4 @@ "main": "approuter.js",

"@sap/logging": "^6.1.1",
"@sap/xsenv": "3.4.0",
"@sap/xssec": "^3.2.15",
"@sap/xsenv": "^3.4.0",
"@sap/xssec": "^3.2.17",
"agentkeepalive": "2.0.5",

@@ -15,0 +15,0 @@ "axios": "0.27.2",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc