How to use the bespoken-tools/lib/client/url-mangler.URLMangler.manglePipeToPath function in bespoken-tools

To help you get started, we’ve selected a few bespoken-tools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bespoken-cookbook / serverless-plugin-bespoken / src / ServerlessPluginBespoken.ts View on Github external
deployPassThru = async () => {
    await this.loadBespokenPluginConfig();

    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;
github bespoken-cookbook / serverless-plugin-bespoken / src / ServerlessPluginBespoken.ts View on Github external
(this as any).dirty = true;
          }.bind(moduleManager),
          500
        )
      );

      if (this.enableSecurity) {
        this.serverless.cli.log("Bespoken proxy started in secure 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(),
            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())