Exemple #1
0
func (k KeychainSecretStore) RetrieveSecret(accountName NormalizedUsername) ([]byte, error) {
	encodedSecret, err := keychain.GetGenericPassword(k.serviceName(), string(accountName), "", "")
	if err != nil {
		return nil, err
	}
	if encodedSecret == nil {
		return nil, SecretStoreError{Msg: "No secret for " + string(accountName)}
	}

	secret, err := base64.StdEncoding.DecodeString(string(encodedSecret))
	if err != nil {
		return nil, err
	}

	return secret, nil
}
Exemple #2
0
func (k KeychainSecretStore) RetrieveSecret() ([]byte, error) {
	return keychain.GetGenericPassword(G.Env.GetStoredSecretServiceName(), k.accountName, "", "")
}