Skip to content
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

Enhance env var utils to accept min and max values #162

Open
1 task
orenbm opened this issue Sep 13, 2020 · 0 comments
Open
1 task

Enhance env var utils to accept min and max values #162

orenbm opened this issue Sep 13, 2020 · 0 comments

Comments

@orenbm
Copy link
Member

orenbm commented Sep 13, 2020

We recently added utility functions to extract values from environment variables. We should consider adding input validations on the given values so that the application doesn't work unexpectedly. For example, what happens if the user set CONJUR_CLIENT_CERT_RETRY_COUNT_LIMIT to -2? Do we want to limit this env var to have a minimum of 0? do we want another minimum?

We should consider to implement this in a way that the util will get a new struct EnvironmentVariable that can have fields for name, defaultValue, minValue, maxValue (and maybe other fields?).

Other questions that need to be addressed while implementing this are:

  1. what is the minimum value of CONJUR_TOKEN_TIMEOUT?
  2. what is the minimum value of CONJUR_CLIENT_CERT_RETRY_COUNT_LIMIT?
  3. Do the above have a maximum value?
  4. what do we do in case the given value is less than the minimum? Do we fail the app or use the default value?
  5. does the answer to the previous question changes how we handle cases where the user gave an invalid value for CONJUR_TOKEN_TIMEOUT?

We should also have backwards-compatibility in mind.

DoD:

  • Utils are updated to have also a min (and max?) value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant