Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.serverless.cli.log("cli options", this.options);
// do nothing if inject-passthru not passed on command line
if (!this.injectPassThruOption) {
return;
}
this.serverless.cli.log(
"Replacing lambda handlers with bespoken passthru functions"
);
const bespokenProxyUrl = URLMangler.manglePipeToPath(
Global.config().sourceID()
);
const bespokenProxySecret = Global.config().secretKey();
// inject environment variables with necessary bespoken connection parameters into lambda environment
this.mutateLambdaEnvironmentVariables({
bespoken_proxy_url: bespokenProxyUrl,
bespoken_proxy_secret: bespokenProxySecret
});
this.serverless.cli.log(
`Pass through handlers will proxy requests to: ${bespokenProxyUrl}`
);
const handlers = this.handlers;
// save directory where serverless expects to look for source files
this.originalServicePath = this.originalServicePath
? this.originalServicePath
Global.config().sourceID(),
Global.config().secretKey()
)
);
} else {
this.serverless.cli.log(
"Bespoken proxy started in publically accessible mode"
);
this.serverless.cli.log(process.cwd());
this.serverless.cli.log(
"The public URL for accessing your local service"
);
this.serverless.cli.log("");
this.serverless.cli.log(
URLMangler.manglePipeToPath(Global.config().sourceID())
);
}
this.serverless.cli.log("");
this.serverless.cli.log(
"The URL for viewing transaction history of requests/responses sent through the proxy service"
);
this.serverless.cli.log("");
this.serverless.cli.log(
URLMangler.mangleNoPath(
Global.config().sourceID(),
Global.config().secretKey()
)
);
});
};