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

refactor: move provider, and common to pkg package #85

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

| **Supported Providers** | **Status** |
|--------------------------------------------------------------|----------------|
| File proivder | ✅ Implemented |
| Local provider | ✅ Implemented |
| [HashiCorp Vault](https://www.vaultproject.io) | ✅ Implemented |
| [AWS Secrets Manager](https://aws.amazon.com/secrets-manager)| Upcoming |

Expand Down
6 changes: 3 additions & 3 deletions env_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"strings"
"sync"

"github.com/bank-vaults/secret-init/provider"
"github.com/bank-vaults/secret-init/provider/file"
"github.com/bank-vaults/secret-init/provider/vault"
"github.com/bank-vaults/secret-init/pkg/provider"
"github.com/bank-vaults/secret-init/pkg/provider/file"
"github.com/bank-vaults/secret-init/pkg/provider/vault"
)

var supportedProviders = []string{
Expand Down
2 changes: 1 addition & 1 deletion env_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/bank-vaults/secret-init/provider"
"github.com/bank-vaults/secret-init/pkg/provider"
)

func TestEnvStore_GetProviderPaths(t *testing.T) {
Expand Down
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
slogmulti "github.com/samber/slog-multi"
slogsyslog "github.com/samber/slog-syslog"

"github.com/bank-vaults/secret-init/common"
"github.com/bank-vaults/secret-init/pkg/common"
)

func main() {
Expand Down Expand Up @@ -66,8 +66,6 @@ func main() {
os.Exit(1)
}

// Delay if needed
// NOTE(ramizpolic): any specific reason why this is here?
if config.Delay > 0 {
slog.Info(fmt.Sprintf("sleeping for %s...", config.Delay))
time.Sleep(config.Delay)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion provider/file/file.go → pkg/provider/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"os"
"strings"

"github.com/bank-vaults/secret-init/provider"
"github.com/bank-vaults/secret-init/pkg/provider"
)

const ProviderName = "file"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/bank-vaults/secret-init/provider"
"github.com/bank-vaults/secret-init/pkg/provider"
)

func TestNewProvider(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 6 additions & 7 deletions provider/vault/config.go → pkg/provider/vault/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,12 @@ func LoadConfig() (*Config, error) {
}

return &Config{
IsLogin: isLogin,
Token: vaultToken,
TokenFile: tokenFile,
Role: role,
AuthPath: authPath,
AuthMethod: authMethod,
// injector configuration
IsLogin: isLogin,
Token: vaultToken,
TokenFile: tokenFile,
Role: role,
AuthPath: authPath,
AuthMethod: authMethod,
TransitKeyID: os.Getenv(TransitKeyIDEnv),
TransitPath: os.Getenv(TransitPathEnv),
TransitBatchSize: cast.ToInt(os.Getenv(TransitBatchSizeEnv)),
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions provider/vault/vault.go → pkg/provider/vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"github.com/bank-vaults/internal/injector"
"github.com/bank-vaults/vault-sdk/vault"

"github.com/bank-vaults/secret-init/common"
"github.com/bank-vaults/secret-init/provider"
"github.com/bank-vaults/secret-init/pkg/common"
"github.com/bank-vaults/secret-init/pkg/provider"
)

const ProviderName = "vault"
Expand Down
File renamed without changes.
Loading