@infomaker/service-authorization-lib
Version:
IMID Service Authorization Library
24 lines (19 loc) • 408 B
JavaScript
class Request {
constructor({ serviceToken }) {
this.id = 'mock-request-id'
this.headers = {
'x-imid-token': 'should be put in req credentials'
}
if (serviceToken) {
this.headers.authorization = `Bearer ${serviceToken}`
}
this.internals = {
nextCalled: false,
err: null,
}
}
get(key) {
return this.headers[key]
}
}
module.exports = Request