Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Add validation for environment variables in infisical.connect #4

Open
dangtony98 opened this issue Mar 13, 2023 · 2 comments
Open

Add validation for environment variables in infisical.connect #4

dangtony98 opened this issue Mar 13, 2023 · 2 comments

Comments

@dangtony98
Copy link
Contributor

Currently, infisical.connect just fetches back secrets from Infisical.

In the future, we want infisical.connect to also be able to accept validator arguments so that you can for instance:

  • Cast environment variables that are fetched back as strings to a different type.
  • Throw an error if a required environment variable is missing.
  • Fallback to default values.

Here's what I have in mind:

Users can define a custom configuration object containing each environment variable and its details that such as description, type, default, transform (i.e. function that transforms the input environment variable).

This would significantly minimize errors for folks using the Infisical Node SDK.

@gitSambhal
Copy link
Contributor

@dangtony98 Have a look at https://www.npmjs.com/package/envalid

@dangtony98
Copy link
Contributor Author

Thanks @gitSambhal I've seen a number of different implementations for this feature.

We're gonna hold off on it for now to make the SDK more usable first — I've some big changes coming up ahead :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants