elixir-toniq / vapor

Runtime configuration system for Elixir
MIT License
596 stars 37 forks source link

added support for Map provider #118

Closed mscno closed 9 months ago

mscno commented 3 years ago

I am currently using Vapor in conjunction with GCP Secret Management and ENVKEY secret management. The secret management pipeline for these tools return JSON dumps of the secret payload on request. Currently the only way to input these JSON maps into vapor is to write it to a .json file, and then use the File provider to read it back.

This PR adds support for providing the map directly as a separate provider.

Example use:

my_map = %{"FOO" => "BAR"}

providers = [
        %Vapor.Provider.Map{
          map: map,
          bindings: [
            foo: "FOO",
          ]
        }
      ]

Vapor.load!(providers)