Skip to content

[BUG] OneSDK configuration using environmental variables do not work #343

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

Open
janhalama opened this issue Apr 20, 2023 · 0 comments
Open

Comments

@janhalama
Copy link
Contributor

OneSDK configuration using environmental variables do not work in case that options parameter of SuperfaceClient is defined.

This is relevant for environment variables that have defined default value in OneSDK package. This is list of affected env variables:

  • SUPERFACE_API_URL
  • SUPERFACE_PATH
  • SUPERFACE_METRIC_DEBOUNCE_TIME_MIN
  • SUPERFACE_METRIC_DEBOUNCE_TIME_MAX
  • SUPERFACE_DISABLE_METRIC_REPORTING
  • SUPERFACE_SANDBOX_TIMEOUT
  • SUPERFACE_CACHE_TIMEOUT

The bug is not affecting SUPERFACE_SDK_TOKEN env variable.

Expected Behavior

Configuration of OneSDK should be possible using combination of code and environment variables. Code configuration should take priority over environmental variables.

Current Behavior

At this moment once single options parameter is configured in code, environment variables can not be used for OneSDK configuration.

Possible Solution

Merge default params after merging code and env config params.

Steps to Reproduce

MRE repository: https://github.com/janhalama/one-sdk-config-bug-example

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

No branches or pull requests

1 participant