I making a subflow that will incorporate jwt verify, I have a signing secret that normally would be added to the environment variables of the jwt verify node.
I have my own environment variable for my subflow with the signing secret but there does not seem an option to pass the secret in with the message object.
I can not set the environment variable in the flow. any ideas?
You can only read environment variables, you can not set them dynamically. You can add them in your settings.js but this defeats the object of the subflow.
That workaround is fine for your own use, but if you were to fork the repo and publish a Pull Request back to the source repo, I'd not recommend setting node.secret as any following msg without a .secret would end up using the previous secret.
The preferred pattern for providing a property via a msg is to either use a typedInput OR use a local variable and only if the field is left blank - something like this...
Again workaround is fine for internal use, incidentally I encapsulate a lot of routines into subroutines and make it a habit of cleaning up the message object before returning.
I use environmental variables and then delete them in a change node, so not to contaminate the msg going forward.