Skip to content

Password and secret end up flows.json #70

Description

@gorenje

Hi There!

First off, great work and nice job making OAuth2 so simple!

But ... when I select password authentication, the password and secret end up as cleartext in the flows.json file, making the flows.json non-distributable nor checkin-able.

I did something similar but made the secret field an environment variable by using typedInput:

in the .html:

<!-- snippet -->
  <div class="form-row">
    <label for="node-input-apiToken">
      <i class="fa fa-tag"></i>
      API Token
    </label>
    <input type="text" id="node-input-apiToken">
    <input type="hidden" id="node-input-apiTokenType">
  </div>
<!-- snippet -->

<!-- snippet -->
 oneditprepare: function() {
      $("#node-input-apiToken").typedInput({
        types:["env", "msg", "flow","global", "cred"],
        typeField: "#node-input-apiTokenType"
      });
      ...
  }
<!-- snippet -->

in the .js:

node.on('input', function(....) {
      RED.util.evaluateNodeProperty(cfg.apiToken, cfg.apiTokenType, node, msg, (err, result) => {
        if ( err ) {
          node.error( "Failed to get API token" );
          node.status({fill:"red",shape:"dot",text:"Failed to get API token"});
        } else {
          var apiToken = result;
          // have token, will travel
   ....

I don't know how that could work with a config node but I guess that would be best solution.

just a suggestion :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions