1
0
Fork 0
mirror of https://github.com/Luzifer/vault-totp.git synced 2024-12-22 22:01:19 +00:00

Support name field in Vault keys

This commit is contained in:
Knut Ahlers 2017-01-04 22:47:23 +01:00
parent 860a5daf02
commit edafa68d44
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -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)
}
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