-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Freckle.App.Env.kept #65
Conversation
Modifies a `Parser` such that all variables act as if they were defined using `keep`. The past-tense naming was chosen to match the similar function `prefixed`. By default, read variables are removed from the environment. This is often problematic (e.g. in tests that repeatedly load an app and re-read the environment), and the security benefits are minor. Doing this variable by variable is error-prone and often outside of the control of where it matters (e.g. parser defined in this library, ultimately used in some app). This function will make it easy for the app to decide at parse time if it wants all variables kept all the time.
I chose to use kept at parse-time instead of keep at variable-definition time, so that end-users could still use the variable Parsers without keep when necessary.
NOTE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, take or leave the doc comment.
If you would prefer not to keep these variables, parse them yourself (e.g. | ||
with `envParseDatabaseConf`) and use `makePostgresPoolWith`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be more useful in the haddock?
Personally I look there before changelogs for usage info like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. To me, this behavior is only notable because it changed (hence CHANGELOG). The behavior as it was/is isn't particularly surprising to me, not worth calling out in docs at least. 🤷
Modifies a
Parser
such that all variables act as if they were definedusing
keep
. The past-tense naming was chosen to match the similarfunction
prefixed
.By default, read variables are removed from the environment. This is
often problematic (e.g. in tests that repeatedly load an app and re-read
the environment), and the security benefits are minor. Doing this
variable by variable is error-prone and often outside of the control of
where it matters (e.g. parser defined in this library, ultimately used
in some app). This function will make it easy for the app to decide at
parse time if it wants all variables kept all the time.