From 4d5bccd6e280442e07726d06ee886506e207b4b3 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 18 Nov 2021 10:43:41 +0100 Subject: [PATCH] propagate correlator to idm requests --- lib/services/keystoneAuth.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/services/keystoneAuth.js b/lib/services/keystoneAuth.js index 18140de3..c9b3f9c5 100644 --- a/lib/services/keystoneAuth.js +++ b/lib/services/keystoneAuth.js @@ -132,6 +132,9 @@ function retrieveRoles(req, callback) { 'X-Auth-Token': currentToken } }; + if (!options.headers[constants.CORRELATOR_HEADER] && req.corr) { + options.headers[constants.CORRELATOR_HEADER] = req.corr; + } logger.debug('Extracting roles for token: %j', options); @@ -212,7 +215,9 @@ function retrieveUser(req, callback) { 'X-Subject-Token': userToken } }; - + if (!options.headers[constants.CORRELATOR_HEADER] && req.corr) { + options.headers[constants.CORRELATOR_HEADER] = req.corr; + } logger.debug('Retrieving user from keystone: %j', options); request(options, function(error, response, body) { @@ -326,7 +331,9 @@ function retrieveSubserviceId(req, callback) { }, json: {} }; - + if (!options.headers[constants.CORRELATOR_HEADER] && req.corr) { + options.headers[constants.CORRELATOR_HEADER] = req.corr; + } logger.debug('Retrieving subservice ID from keystone: %j', options); request(options, function(error, response, body) {