@bluealba/microservices-toolkit
Advanced tools
Comparing version 1.7.1 to 1.7.2
{ | ||
"name": "@bluealba/microservices-toolkit", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "Library that contains common elements used in microservices", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,4 +28,10 @@ "use strict"; | ||
const levelLogger = logger | ||
? extensions.logLevel | ||
? logger[extensions.logLevel] || logger.error | ||
: logger.error | ||
: null; | ||
logError( | ||
[debugLogger, logger], | ||
[debugLogger, levelLogger], | ||
`Error while executing graphql endpoint path="${path}" message="${message}" hint="${fileLocationMessage}" locations="${JSON.stringify( | ||
@@ -35,3 +41,3 @@ locations | ||
); | ||
logError([debugLogger, logger], fauxError.stack); | ||
logError([debugLogger, levelLogger], fauxError.stack); | ||
@@ -38,0 +44,0 @@ return extensions |
@@ -18,3 +18,5 @@ "use strict"; | ||
req.headers["x-forwarded-user-name"], | ||
req.headers["x-forwarded-user-operations"] ? req.headers["x-forwarded-user-operations"].split(",") : [] | ||
req.headers["x-forwarded-user-operations"] ? req.headers["x-forwarded-user-operations"].split(",") : [], | ||
req.headers["x-forwarded-impersonate-by-username"], | ||
req.headers["x-forwarded-impersonate-by-displayname"] | ||
); | ||
@@ -48,3 +50,3 @@ return next(); | ||
const createUser = (username, displayName, operations) => { | ||
const createUser = (username, displayName, operations, impersonatedByUsername, impersonatedByDisplayName) => { | ||
return { | ||
@@ -60,2 +62,8 @@ username: username, | ||
}, | ||
...(impersonatedByUsername && { | ||
impersonatedBy: { | ||
username: impersonatedByUsername, | ||
displayName: impersonatedByDisplayName, | ||
}, | ||
}), | ||
}; | ||
@@ -62,0 +70,0 @@ }; |
22880
590