diff --git a/lib/constants.js b/lib/constants.js index 83f7107..d955013 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -32,7 +32,8 @@ var constants = { X_REAL_IP_HEADER: 'x-real-ip', CORRELATOR_HEADER: 'fiware-correlator', - GET_ROLES_PATH: '/user' + GET_ROLES_PATH: '/user', + NA: 'N/A' }; diff --git a/lib/middleware/proxy.js b/lib/middleware/proxy.js index 86878da..a2f0dd2 100644 --- a/lib/middleware/proxy.js +++ b/lib/middleware/proxy.js @@ -201,6 +201,7 @@ function accountInfo(req, res, next) { ' | Token=' + req.headers['x-auth-token'] + ' | Origin=' + req.connection.remoteAddress + ' | UserId=' + req.userId + + ' | UserName=' + req.userName + ' | ServiceId=' + req.serviceId + ' | Service=' + req.service + ' | SubServiceId=' + req.subserviceId + diff --git a/lib/services/keystoneAuth.js b/lib/services/keystoneAuth.js index a695d67..4ffacee 100644 --- a/lib/services/keystoneAuth.js +++ b/lib/services/keystoneAuth.js @@ -191,6 +191,7 @@ function retrieveUser(req, callback) { req.serviceId = cachedValue.serviceId; req.domainName = cachedValue.domainName; req.userId = cachedValue.userId; + req.userName = cachedValue.userName; logger.debug('User value processed with value: %j', cachedValue); @@ -245,7 +246,8 @@ function retrieveUser(req, callback) { cachedValue = { domainName: body.token.project.domain.name, serviceId: body.token.project.domain.id, - userId: body.token['OS-TRUST:trust'].trustor_user.id + userId: body.token['OS-TRUST:trust'].trustor_user.id, + userName: constants.NA }; innerCb(null, cachedValue); @@ -256,7 +258,8 @@ function retrieveUser(req, callback) { cachedValue = { domainName: body.token.user.domain.name, serviceId: body.token.user.domain.id, - userId: body.token.user.id + userId: body.token.user.id, + userName: body.token.user.name }; req.userData = cachedValue;