I am in the process of re-implementing the cloudantStorage code that was originally written for IBM Cloud to use the new Cloudant SDK. It's mainly working, but I'm having problems with flow encryption.
To do this, I am implementing the Storage API. The first time I run Node-RED with Cloudant Storage enabled it creates the database as expected and creates and saves the flow credential. The problem I get is that when I stop and re-run Node-RED it fails to load the previously saved credentials with a syntax error. However, I have put a console log into the new getCredentials function and it's not even being called. Is it possible that there's a problem in the core which is causing this?
Clearly the standard local filesystem storage works fine, it just seems to appear when there's a pluggable storage module added.
I am looking in @node-red/runtime/lib/storage/index.js and it appears to me that the call for getCredentials is commented out from StorageModuleInterface. Is this correct @knolleary ?
After further investigation, it appears that if credentialSecret is set to anything (false or your own choice of secret) then it works (and doesn't try to store a credentials document in the database). It's only if you let NR choose the default that you get the error.
@knolleary any idea whether is likely to be an error in my code or a bug somewhere in the core?
You are looking at the api layer between the internal storage system and the main runtime. There is not a one-to-one mapping between the internal api and the Storage Plugin API.