diff options
author | vman <public@vaughnnugent.com> | 2022-11-30 14:59:18 -0500 |
---|---|---|
committer | vman <public@vaughnnugent.com> | 2022-11-30 14:59:18 -0500 |
commit | f13193aa928f099c8152653570d2839b46b8f1ee (patch) | |
tree | be2394edec528472258c0da7d354bbb8ad9881e4 /VNLib.Plugins.Essentials.Accounts | |
parent | e4ce3ae25802471bea0ea99698fbb3f6ffdf7953 (diff) |
Project cleanup + analyzer updates
Diffstat (limited to 'VNLib.Plugins.Essentials.Accounts')
3 files changed, 17 insertions, 18 deletions
diff --git a/VNLib.Plugins.Essentials.Accounts/MFA/MFAConfig.cs b/VNLib.Plugins.Essentials.Accounts/MFA/MFAConfig.cs index 8e85e65..f04693e 100644 --- a/VNLib.Plugins.Essentials.Accounts/MFA/MFAConfig.cs +++ b/VNLib.Plugins.Essentials.Accounts/MFA/MFAConfig.cs @@ -34,9 +34,9 @@ namespace VNLib.Plugins.Essentials.Accounts.MFA { internal class MFAConfig { - public byte[]? MFASecret { get; set; } = null; + public byte[]? MFASecret { get; set; } - public bool TOTPEnabled { get; } = false; + public bool TOTPEnabled { get; } public string? IssuerName { get; } public TimeSpan TOTPPeriod { get; } public HashAlg TOTPAlg { get; } diff --git a/VNLib.Plugins.Essentials.Accounts/MFA/UserMFAExtensions.cs b/VNLib.Plugins.Essentials.Accounts/MFA/UserMFAExtensions.cs index 3ebb6dd..6675a31 100644 --- a/VNLib.Plugins.Essentials.Accounts/MFA/UserMFAExtensions.cs +++ b/VNLib.Plugins.Essentials.Accounts/MFA/UserMFAExtensions.cs @@ -228,18 +228,12 @@ namespace VNLib.Plugins.Essentials.Accounts.MFA MFAConfig mfa = new(conf); //Recover secret from config and dangerous 'lazy load' - _ = pbase.TryGetSecretAsync("mfa_secret").ContinueWith(t => { - - if(t.IsFaulted) - { - pbase.Log.Error(t.Exception!.InnerException, "Failed to load MFA signing secret"); - } - else - { - mfa.MFASecret = t.Result != null ? Convert.FromBase64String(t.Result) : null; - } + _ = pbase.DeferTask(async () => + { + string? secret = await pbase.TryGetSecretAsync("mfa_secret"); + mfa.MFASecret = secret != null ? Convert.FromBase64String(secret) : null; }); - + return mfa; } //Return new lazy for diff --git a/VNLib.Plugins.Essentials.Accounts/VNLib.Plugins.Essentials.Accounts.csproj b/VNLib.Plugins.Essentials.Accounts/VNLib.Plugins.Essentials.Accounts.csproj index 56c09bc..719f8df 100644 --- a/VNLib.Plugins.Essentials.Accounts/VNLib.Plugins.Essentials.Accounts.csproj +++ b/VNLib.Plugins.Essentials.Accounts/VNLib.Plugins.Essentials.Accounts.csproj @@ -5,13 +5,11 @@ <RootNamespace>VNLib.Plugins.Essentials.Accounts</RootNamespace> <Copyright>Copyright © 2022 Vaughn Nugent</Copyright> <Authors>Vaughn Nugent</Authors> - <AssemblyVersion>1.0.1.2</AssemblyVersion> - <FileVersion>1.0.1.2</FileVersion> <AssemblyName>Accounts</AssemblyName> - <Platforms>AnyCPU;x64</Platforms> + <PackageId>VNLib.Plugins.Essentials.Accounts</PackageId> - <Version>1.0.1</Version> - <PackageProjectUrl>www.vaughnnugent.com/resources</PackageProjectUrl> + <Version>1.0.1.5</Version> + <PackageProjectUrl>https://www.vaughnnugent.com/resources</PackageProjectUrl> </PropertyGroup> @@ -20,6 +18,13 @@ <!--Enable dynamic loading--> <EnableDynamicLoading>true</EnableDynamicLoading> <Nullable>enable</Nullable> + <AnalysisLevel>latest-all</AnalysisLevel> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> + <Deterministic>False</Deterministic> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> + <Deterministic>False</Deterministic> </PropertyGroup> <ItemGroup> |