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

WIP: feat(config): add secrets section to the config #2816

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

avallete
Copy link
Member

@avallete avallete commented Oct 29, 2024

What kind of change does this PR introduce?

  • add dynamic_env section that will be used by branching deployment
  • add the first "vault" provider

What is the current behavior?

Please link any relevant issues here.

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

Add any other context or screenshots.

@coveralls
Copy link

coveralls commented Oct 29, 2024

Pull Request Test Coverage Report for Build 11890485427

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 59.654%

Totals Coverage Status
Change from base Build 11868418312: 0.0%
Covered Lines: 6386
Relevant Lines: 10705

💛 - Coveralls

@avallete avallete changed the title feat(config): add diff with remotes for auth feat(config): add dynamic env providers Oct 29, 2024
@avallete avallete force-pushed the feat/add-dynamic-env-provider-for-vault branch from 3aa1da2 to b8da16b Compare October 29, 2024 12:43
@avallete avallete marked this pull request as ready for review October 30, 2024 19:56
pkg/config/dynamic_env.go Outdated Show resolved Hide resolved
pkg/config/dynamic_env.go Outdated Show resolved Hide resolved
pkg/config/dynamic_env.go Outdated Show resolved Hide resolved
pkg/config/dynamic_env.go Outdated Show resolved Hide resolved
@avallete avallete force-pushed the feat/add-dynamic-env-provider-for-vault branch from 45772ad to 4e57837 Compare November 17, 2024 12:08
@avallete avallete changed the title feat(config): add dynamic env providers feat(config): add secrets section to the config Nov 18, 2024
@avallete avallete changed the title feat(config): add secrets section to the config WIP: feat(config): add secrets section to the config Nov 18, 2024
@@ -430,6 +441,11 @@ func (c *config) Load(path string, fsys fs.FS) error {
} else if err := c.loadFromEnv(); err != nil {
return err
}
// Load default secrets build env variables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should call this before loadDefaultEnv so that local .env file takes precedence.

t.Setenv("AUTH_SEND_SMS_SECRETS", "v1,whsec_aWxpa2VzdXBhYmFzZXZlcnltdWNoYW5kaWhvcGV5b3Vkb3Rvbw==")
t.Setenv("SENDGRID_API_KEY", "sendgrid")
t.Setenv("AUTH_CALLBACK_URL", "http://localhost:3000/auth/callback")
assert.NoError(t, config.Load("", fsys))
// Check error
assert.Equal(t, "hello", config.Auth.External["azure"].ClientId)
assert.Equal(t, "this is cool", config.Auth.External["azure"].Secret)
assert.Equal(t, "<encrypted-value>", config.Auth.External["azure"].Secret)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous test should still pass to allow .env.local override.

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.

3 participants