UNPKG

lambda-live-debugger

Version:

Debug Lambda functions locally like it is running in the cloud

11 lines (10 loc) 408 B
export class HttpBearerAuthSigner { async sign(httpRequest, identity, signingProperties) { const clonedRequest = httpRequest.clone(); if (!identity.token) { throw new Error("request could not be signed with `token` since the `token` is not defined"); } clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`; return clonedRequest; } }