node-convict icon indicating copy to clipboard operation
node-convict copied to clipboard

Plugins

Open mendrik opened this issue 5 years ago • 4 comments

would be great if one could add custom plugins where to fetch the variables from. there is a built-in 'env' property, but it would be great if one could fetch something from somewhere else, like AWS secrets manager.

I would leave it up to the user to implement their own providers, but right now there is only the hardcoded env functionality.

mendrik avatar Mar 01 '19 13:03 mendrik

Agree as well - not necessarily broad plugin support, but some sort of "provider" infrastructure. I came here looking for ways to directly integrate S3 configuration management and AWS secrets manager, but it appears all we get is the "out of the box" functionality.

The hardcoded precedence order could be replaced with a default set of providers in a stack.

ebickle avatar Jun 11 '19 19:06 ebickle

Good ideas. You are welcome to propose PR.

madarche avatar Jun 11 '19 19:06 madarche

I had a PR for this (#273), but what I just realized is that you can leverage the convict.load() method for this by passing in a function that returns an object. I already have an SSM provider that works with my fork (https://github.com/HBKEngineering/convict-provider-awsSsm), but I'm working on modifying it to support native convict.

You can add custom keys to your config (ie "providerPath: '/blah'" ) to do this, convict won't mind.

brettneese avatar Aug 15 '19 23:08 brettneese

Similar/Duplicate : #313

A-312 avatar Dec 07 '19 11:12 A-312