Exemplo n.º 1
0
        void Download()
        {
            Log.Debug("Downloading secret: " + SecretId + "...");

            try
            {
                var secrets = AwsSecretProvider.GetProvider(SecretProviderType).Download(SecretId).RiskDeadlockAndAwaitResult();
                if (secrets.IsEmpty())
                {
                    throw new Exception("AWS SecretString was empty!");
                }

                SecretString = secrets;

                Log.Debug("Downloaded secrets successfully.");
            }
            catch (AggregateException ex)
            {
                Log.Error(ex.InnerException, "Failed to obtain the AWS secret: " + SecretId);
                throw;
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Failed to obtain the AWS secret: " + SecretId);
                throw;
            }
        }
Exemplo n.º 2
0
 protected override string DownloadSecrets() =>
 AwsSecretProvider.GetProvider(SecretProviderType).Download(SecretId).RiskDeadlockAndAwaitResult();