From d50f8bf6a2c7a1bb98c607b32f6a999fbb613de0 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 20 Apr 2021 11:44:17 -0600 Subject: [PATCH] Update reconfigurable device to prevent writing secrets to local file --- .../Devices/ReconfigurableDevice.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs index 7b4f1c99..fe548732 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/ReconfigurableDevice.cs @@ -20,11 +20,16 @@ namespace PepperDash.Essentials.Core.Devices public DeviceConfig Config { get; private set; } protected ReconfigurableDevice(DeviceConfig config) - : base(config.Key) + : this(config.Key) { - SetNameHelper(config); + } - Config = config; + protected ReconfigurableDevice(string key) : base(key) + { + //getting config directly from ConfigReader to avoid the possiblitiy of writing secrets to file + Config = ConfigReader.ConfigObject.GetDeviceForKey(key); + + SetNameHelper(Config); } ///