Added some QoL improvements to SecretsManager meant to protect the integrity of the providers dictionary from accidental manipulation

Debug statement improvements

Improvements to verbosity of console command returns for the SecretsManager
This commit is contained in:
Trevor Payne
2021-04-16 12:29:41 -05:00
parent 452d0a5a39
commit 3c9ca1e527
4 changed files with 97 additions and 38 deletions

View File

@@ -93,7 +93,8 @@ namespace PepperDash.Essentials.Core
{
if (prop.Name.ToLower() == "secret")
{
var secret = GetSecret(JsonConvert.DeserializeObject<SecretsPropertiesConfig>(prop.Children().First().ToString()));
var secret = GetSecret(prop.Children().First().ToObject<SecretsPropertiesConfig>());
//var secret = GetSecret(JsonConvert.DeserializeObject<SecretsPropertiesConfig>(prop.Children().First().ToString()));
prop.Parent.Replace(secret);
}
var recurseProp = prop.Value as JObject;
@@ -152,7 +153,9 @@ namespace PepperDash.Essentials.Core
}
catch (Exception ex)
{
Debug.Console(2, "Issue with getting device - {0}", ex.Message);
Debug.Console(0, Debug.ErrorLogLevel.Error, "Exception occurred while creating device {0}: {1}", dc.Key, ex.Message);
Debug.Console(2, "{0}", ex.StackTrace);
return null;
}
}