vapor icon indicating copy to clipboard operation
vapor copied to clipboard

added support for Map provider

Open mscno opened this issue 3 years ago • 0 comments

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)

mscno avatar May 19 '21 19:05 mscno