public Task <string> UpdateCredentialsAsync(string context, string key, string oldAugumentedKey,
                                             Credential value)
 {
     throw new SecureStoreException(SecureStoreException.Type.UnsupportedOperation,
                                    SecretServerResource.GetResource("ReadOnly"));
 }
 public Task RemoveValueAsync(string context, string key)
 {
     throw new SecureStoreException(SecureStoreException.Type.UnsupportedOperation,
                                    SecretServerResource.GetResource("ReadOnly"));
 }
        public Task <Credential> GetCredentialsAsync(string context, string key)
        {
            var ctx    = DeserializeContext(context);
            var client = _clientFactory.GetClient(ctx);

            var result = int.TryParse(key, out var outKey);

            if (!result)
            {
                throw new SecureStoreException(SecureStoreException.Type.InvalidConfiguration, SecretServerResource.GetResource("InvalidSecretId"));
            }

            var secretResponse = client.GetSecret(outKey);
            var items          = secretResponse.Items.ToDictionary(x => $"{x.Slug}", x => x.ItemValue);

            var cred = new Credential
            {
                Username = items[GetFieldSlug(ctx.UsernameField)],
                Password = items[GetFieldSlug(ctx.PasswordField)],
            };

            return(Task.FromResult(cred));
        }