(conf *api.Credentials_Vault, prefix string, r credentials.Role, l log.Logger)
| 114 | } |
| 115 | |
| 116 | func newVaultCredentialsManager(conf *api.Credentials_Vault, prefix string, r credentials.Role, l log.Logger) (*vault.Manager, error) { |
| 117 | if err := validateConfig(conf); err != nil { |
| 118 | return nil, fmt.Errorf("uncompleted configuration for Vault secret manager: %w", err) |
| 119 | } |
| 120 | |
| 121 | opts := &vault.NewManagerOpts{ |
| 122 | AuthToken: conf.Token, Address: conf.Address, |
| 123 | MountPath: conf.MountPath, Logger: l, |
| 124 | SecretPrefix: prefix, |
| 125 | Role: r, |
| 126 | } |
| 127 | |
| 128 | m, err := vault.NewManager(opts) |
| 129 | if err != nil { |
| 130 | return nil, fmt.Errorf("configuring vault: %w", err) |
| 131 | } |
| 132 | |
| 133 | return m, nil |
| 134 | } |
| 135 | |
| 136 | func newGCPCredentialsManager(conf *api.Credentials_GCPSecretManager, prefix string, r credentials.Role, l log.Logger) (*gcp.Manager, error) { |
| 137 | if err := validateConfig(conf); err != nil { |
no test coverage detected