telefonicaid / iotagent-node-lib

Module to enable IoT Agent developers to build custom agents for their devices that can easily connect to NGSI Context Brokers
https://iotagent-node-lib.rtfd.io/
GNU Affero General Public License v3.0
59 stars 84 forks source link

[Fix] Parse authSource variable into mongo url string #1527

Closed cblanco-libelium closed 8 months ago

cblanco-libelium commented 8 months ago

Edit: issue #1526

- Overriding when user:pass is present in extraArgs
- Fix tests

I see that authSource had an independant ENV variable and treatment along the code, but the truth it's that authSource should concat in the string as an extraArgs. 
In my opinion the best way to allow backwards compatibility is to still parsing if comes in extraArgs, but overriding if the specific env variable is present. 
Also authSource should only used if user:pass are present so i included in the if statemente
fgalan commented 8 months ago

Thank you for your contribution!

Please add an entry to the CHANGES_NEXT_RELEASE file (which is used to build the Changelog of next version) to describe the fix in the PR. Something like this:

- Fix: mongodb.authSource / IOTA_MONGO_AUTH_SOURCE was not correctly supported (#1526)