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

fix: Loading of structured configuration from env variables #768

Merged
merged 3 commits into from
Jul 19, 2023

Conversation

dadrus
Copy link
Owner

@dadrus dadrus commented Jul 19, 2023

Related issue(s)

closes #769

Checklist

  • I agree to follow this project's Code of Conduct.
  • I have read, and I am following this repository's Contributing Guidelines.
  • I have read the Security Policy.
  • I have referenced an issue describing the bug/feature request.
  • I have added tests that prove the correctness of my implementation.

Description

Heimdall supports loading of the entire configuration from environment variables in addition to a config file. Merging is also supported as described in Configuration Introduction. However, if the relevant configuration part resides in an array, e.g.

rules:
  mechanisms:
    authenticators:
      - id: jwt
        type: jwt
        config:
           jwks_endpoint: http://whatever
           # further config properties   

configuring the structured parts, or overriding these, like here the properties under the config key, is not possible.

This PR fixes that and makes the expected configuration possible.

@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #768 (88ab42e) into main (2ad82a6) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #768   +/-   ##
=======================================
  Coverage   89.59%   89.59%           
=======================================
  Files         215      215           
  Lines        9223     9223           
=======================================
  Hits         8263     8263           
  Misses        767      767           
  Partials      193      193           
Files Changed Coverage Δ
internal/config/parser/merge.go 90.90% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dadrus dadrus changed the title fix: Loading of structured configuration from env variables fixed fix: Loading of structured configuration from env variables Jul 19, 2023
@dadrus dadrus merged commit a76c722 into main Jul 19, 2023
@dadrus dadrus deleted the fix/env_config_loading branch July 19, 2023 21:28
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

Successfully merging this pull request may close these issues.

Heimdall fails to start when configuration happens via environment variables
1 participant