Credentials for "function" node


I've implemented a new functionality for "function" node for configuring a single pair of credentials and make them available for use in function's code. It's based on already available credentials framework for node development, really a simple patch.
What's your opinion, will this be a valuable addition and should I open a PR for it?

What do you mean by that ?
Password type credentials are not readable by the editor. If you bypass this, you leave the editor vulnerable.

@dpslavov a screenshot might help demonstrate what you are proposing.

In general, we have various other ways to make credentials available to a node. For example, you can add an env var at the Group, Subflow or Flow level that is stored as a credential:

The node can then just use env.get('my secret') to retrieve the value.


You are confusing code with editor. What I mean is that node object has new property credentials which you can use in your code like this:

const username = node.credentials.username;
const password = node.credentials.password;

In this way you don't have to have plaintext passwords in your flow.

@knolleary Here are some screenshots:


To be honest I didn't knew that environment variables can be stored as secrets, if I knew that probably I wouldn't implement this patch...

Although I don't think this is a bad idea, what if you need more than 1 credential ?
Note that there is a dedicated node available for influx.

Node's credentials implementation isn't well suited for multiple records. Of course it isn't impossible to to implement such thing but I preferred clean implementation and easy of use over functionality.
Yes, I'm aware that several InfluxDB contrib nodes do exists.