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

feat: Add Vault provider #35

Merged
merged 25 commits into from
Jan 25, 2024
Merged

Conversation

csatib02
Copy link
Member

@csatib02 csatib02 commented Dec 15, 2023

Overview

  • Configuration support for the file provider.

  • Added support for the Vault provider.

  • Currently, multi-provider functionality (e.g. simultaneous use of one instance of both the file and Vault providers) is not supported.
    Note: A workaround have been applied temporarily, with plans to address this limitation in a future pull request.

  • The Vault provider implementation has been mostly refactored from Vault-env, with the key difference being that all providers now receive a configuration.

  • Secret-init still requires the PROVIDER environment variable to be set, as previously explained.

Continuation of issue: #1
Closes: #18

Changes

  • Reworked environment prefixes, as in: Vault provider implementation #32
  • Introduced common package for application configuration.
  • Implemented args.go and env_store.go to enhance the clarity and testability of the application.
  • Refactored various sections of main.go for better modularization.
  • The file provider now uses a configuration.
  • Implemented the Vault provider.
  • Included tests for both the Vault and file providers.

@csatib02 csatib02 self-assigned this Dec 15, 2023
@github-actions github-actions bot added the size/M Denotes a PR that changes 100-499 lines label Dec 15, 2023
@github-actions github-actions bot added size/L Denotes a PR that changes 500-999 lines and removed size/M Denotes a PR that changes 100-499 lines labels Dec 15, 2023
@github-actions github-actions bot added size/XL Denotes a PR that changes 1000+ lines and removed size/L Denotes a PR that changes 500-999 lines labels Dec 17, 2023
@csatib02 csatib02 marked this pull request as ready for review December 21, 2023 13:14
main.go Outdated Show resolved Hide resolved
env.go Outdated Show resolved Hide resolved
env.go Outdated Show resolved Hide resolved
env.go Outdated Show resolved Hide resolved
provider/file/config.go Outdated Show resolved Hide resolved
provider/file/config.go Outdated Show resolved Hide resolved
Signed-off-by: Bence Csati <[email protected]>
…aswell as providers, add tests for new package

Signed-off-by: Bence Csati <[email protected]>
provider/vault/config_test.go Outdated Show resolved Hide resolved
provider/vault/vault.go Show resolved Hide resolved
provider/vault/vault.go Show resolved Hide resolved
pkg/args/args_test.go Outdated Show resolved Hide resolved
pkg/config/config.go Outdated Show resolved Hide resolved
provider/vault/vault.go Outdated Show resolved Hide resolved
provider/vault/config.go Outdated Show resolved Hide resolved
provider/vault/vault.go Outdated Show resolved Hide resolved
provider/vault/vault.go Outdated Show resolved Hide resolved
provider/vault/vault.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
Copy link
Member

@ramizpolic ramizpolic left a comment

Choose a reason for hiding this comment

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

small notes here, sorry for the drill 😢 the logic looks clean, well done on adding tests!

args.go Outdated Show resolved Hide resolved
env_store.go Outdated Show resolved Hide resolved
env_store_test.go Show resolved Hide resolved
env_store_test.go Show resolved Hide resolved
provider/vault/config.go Outdated Show resolved Hide resolved
provider/vault/vault.go Outdated Show resolved Hide resolved
provider/vault/vault.go Outdated Show resolved Hide resolved
provider/vault/vault_test.go Outdated Show resolved Hide resolved
Signed-off-by: Bence Csati <[email protected]>
Copy link
Member

@ramizpolic ramizpolic left a comment

Choose a reason for hiding this comment

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

LGTM, great work @csatib02! Some great changes and improvements, especially adding the tests to track everything. This makes it really simple to check and build on top later on.

@csatib02 csatib02 merged commit dcd3918 into bank-vaults:main Jan 25, 2024
16 checks passed
@csatib02 csatib02 deleted the feat/vault-provider branch January 26, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Denotes a PR that changes 1000+ lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backwards compatibility support
4 participants