MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / newVaultCredentialsManager

Function newVaultCredentialsManager

pkg/credentials/manager/manager.go:116–134  ·  view source on GitHub ↗
(conf *api.Credentials_Vault, prefix string, r credentials.Role, l log.Logger)

Source from the content-addressed store, hash-verified

114}
115
116func 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
136func newGCPCredentialsManager(conf *api.Credentials_GCPSecretManager, prefix string, r credentials.Role, l log.Logger) (*gcp.Manager, error) {
137 if err := validateConfig(conf); err != nil {

Callers 1

NewFromConfigFunction · 0.85

Calls 2

NewManagerFunction · 0.92
validateConfigFunction · 0.85

Tested by

no test coverage detected