def (#12)
All checks were successful
Go Action / goaction (push) Successful in 29s

Reviewed-on: #12
This commit was merged in pull request #12.
This commit is contained in:
2025-12-26 14:55:42 +03:00
parent 22dacb741f
commit f9a0411192
129 changed files with 4660 additions and 1456 deletions

View File

@@ -68,19 +68,6 @@ func (p *Provider) Key(in []string) (string, string) {
return p.prefix + Separator + path, val
}
func (p *Provider) read(path, key string) (*api.Secret, error) {
secret, err := p.client.Logical().Read(path)
if err != nil {
return nil, fmt.Errorf("read[%s:%s]:%w", path, key, err)
}
if secret == nil && key != ValueName {
return p.read(path+Separator+key, ValueName)
}
return secret, nil
}
func (p *Provider) Value(_ context.Context, key ...string) (config.Value, error) {
path, field := p.Key(key)
@@ -98,7 +85,7 @@ func (p *Provider) Value(_ context.Context, key ...string) (config.Value, error)
fmt.Errorf("%w: warn: %s, path:%s, field:%s, provider:%s", config.ErrValueNotFound, secret.Warnings, path, field, p.Name())
}
data, ok := secret.Data["data"].(map[string]interface{})
data, ok := secret.Data["data"].(map[string]any)
if !ok {
return nil, fmt.Errorf("%w: path:%s, field:%s, provider:%s", config.ErrValueNotFound, path, field, p.Name())
}
@@ -118,3 +105,16 @@ func (p *Provider) Value(_ context.Context, key ...string) (config.Value, error)
return value.JBytes(md), nil
}
func (p *Provider) read(path, key string) (*api.Secret, error) {
secret, err := p.client.Logical().Read(path)
if err != nil {
return nil, fmt.Errorf("read[%s:%s]:%w", path, key, err)
}
if secret == nil && key != ValueName {
return p.read(path+Separator+key, ValueName)
}
return secret, nil
}