mirror of
https://github.com/Luzifer/vault-totp.git
synced 2024-12-23 06:11:19 +00:00
Support name field in Vault keys
This commit is contained in:
parent
860a5daf02
commit
edafa68d44
1 changed files with 6 additions and 1 deletions
7
main.go
7
main.go
|
@ -170,7 +170,12 @@ func getSecretsFromVault() ([]token, error) {
|
||||||
return nil, fmt.Errorf("The key %q does not have a field named %q.", k, cfg.Field)
|
return nil, fmt.Errorf("The key %q does not have a field named %q.", k, cfg.Field)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp = append(resp, token{Name: k, Secret: data.Data[cfg.Field].(string)})
|
name := k
|
||||||
|
if data.Data["name"] != nil {
|
||||||
|
name = data.Data["name"].(string)
|
||||||
|
}
|
||||||
|
|
||||||
|
resp = append(resp, token{Name: name, Secret: data.Data[cfg.Field].(string)})
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp, nil
|
return resp, nil
|
||||||
|
|
Loading…
Reference in a new issue