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

Setup generic functionality #8

Merged
merged 5 commits into from
Nov 3, 2023

Conversation

csatib02
Copy link
Member

@csatib02 csatib02 commented Oct 25, 2023

Overview

This PR is mostly a refactor of the original vault-env without the vault provider implementation. It has a generic main functionality, which works by adding "-p {name of the desired provider}" to the beginning of the command line arguments, then it gets removed from the args, so the rest of the code mostly can remain the same as it was in vault-env.

I used a map to determine which provider is being used, so it is easy to extended.

Also I moved the logger part of the code from main, to a separate folder, so it can be reused by the providers.

Start of issue: #1

Signed-off-by: Bence Csati <csatib02@gmail.com>
@csatib02 csatib02 self-assigned this Oct 25, 2023
@csatib02 csatib02 linked an issue Oct 25, 2023 that may be closed by this pull request
1 task
@csatib02 csatib02 removed a link to an issue Oct 25, 2023
1 task
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, the PR looks clean 🌟 , well done @csatib02! I have left a couple of notes to consider, but nothing major. I think a bit more documentation about the configuration and usage would be quite useful, but this can be addressed in the upcoming PRs.

main.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
main.go Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
logger/slog_logger.go Outdated Show resolved Hide resolved
logger/slog_logger.go Outdated Show resolved Hide resolved
logger/slog_logger.go Outdated Show resolved Hide resolved
logger/slog_logger.go Outdated Show resolved Hide resolved
providers/provider.go Outdated Show resolved Hide resolved
providers/vault/vault_provider.go Outdated Show resolved Hide resolved
providers/vault/vault_provider.go Outdated Show resolved Hide resolved
providers/vault/vault_provider.go Outdated Show resolved Hide resolved
providers/vault/vault_provider.go Outdated Show resolved Hide resolved
Signed-off-by: Bence Csati <csatib02@gmail.com>
Signed-off-by: Bence Csati <csatib02@gmail.com>
Signed-off-by: Bence Csati <csatib02@gmail.com>
Signed-off-by: Bence Csati <csatib02@gmail.com>
@csatib02 csatib02 merged commit e542edf into bank-vaults:main Nov 3, 2023
13 checks passed
@csatib02 csatib02 deleted the generic-functionalities branch December 15, 2023 13:04
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.

None yet

3 participants