diff options
Diffstat (limited to 'plugins')
3 files changed, 10 insertions, 19 deletions
diff --git a/plugins/VNLib.Plugins.Essentials.Accounts/src/AccountsEntryPoint.cs b/plugins/VNLib.Plugins.Essentials.Accounts/src/AccountsEntryPoint.cs index 73ea51f..bd191a1 100644 --- a/plugins/VNLib.Plugins.Essentials.Accounts/src/AccountsEntryPoint.cs +++ b/plugins/VNLib.Plugins.Essentials.Accounts/src/AccountsEntryPoint.cs @@ -131,21 +131,19 @@ namespace VNLib.Plugins.Essentials.Accounts string? username = args.GetArgument("-u"); string? password = args.GetArgument("-p"); - if (args.Count < 3) + if (args.Count < 1) { Log.Warn("Not enough arguments, use the help command to view available commands"); return; } - switch (args[2].ToLower(null)) + switch (args[0].ToLower(null)) { case "help": const string help = @" Command help for {name} -Usage: p {name} <command> [options] - Commands: create -u <username> -p <password> Create a new user reset-password -u <username> -p <password> -l <priv level> Reset a user's password @@ -390,9 +388,9 @@ Commands: { Log.Error("User already exists"); } - catch(UserCreationFailedException) + catch(UserCreationFailedException ucfe) { - Log.Error("Failed to create the new user"); + Log.Error(ucfe, "Failed to create the new user"); } catch (ArgumentOutOfRangeException) { diff --git a/plugins/VNLib.Plugins.Essentials.Accounts/src/SecurityProvider/AccountSecProvider.cs b/plugins/VNLib.Plugins.Essentials.Accounts/src/SecurityProvider/AccountSecProvider.cs index dd8c8d5..8770930 100644 --- a/plugins/VNLib.Plugins.Essentials.Accounts/src/SecurityProvider/AccountSecProvider.cs +++ b/plugins/VNLib.Plugins.Essentials.Accounts/src/SecurityProvider/AccountSecProvider.cs @@ -60,7 +60,7 @@ namespace VNLib.Plugins.Essentials.Accounts.SecurityProvider [ConfigurationName("account_security", Required = false)] [MiddlewareImpl(MiddlewareImplOptions.SecurityCritical)] - internal class AccountSecProvider : IAccountSecurityProvider, IHttpMiddleware + internal sealed class AccountSecProvider : IAccountSecurityProvider, IHttpMiddleware { private const int PUB_KEY_JWT_NONCE_SIZE = 16; diff --git a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Router.cs b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Router.cs index fda572a..72f091a 100644 --- a/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Router.cs +++ b/plugins/VNLib.Plugins.Essentials.Content.Routing/src/Router.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2023 Vaughn Nugent +* Copyright (c) 2024 Vaughn Nugent * * Library: VNLib * Package: VNLib.Plugins.Essentials.Content.Routing @@ -41,21 +41,14 @@ using VNLib.Plugins.Essentials.Content.Routing.Model; namespace VNLib.Plugins.Essentials.Content.Routing { - internal sealed class Router : IPageRouter + internal sealed class Router(PluginBase plugin) : IPageRouter { private static readonly RouteComparer Comparer = new(); - private readonly IRouteStore Store; - private readonly ILogProvider Logger; + private readonly IRouteStore Store = plugin.GetOrCreateSingleton<ManagedRouteStore>(); + private readonly ILogProvider Logger = plugin.Log; - private readonly ConcurrentDictionary<IWebProcessor, Task<ReadOnlyCollection<Route>>> RouteTable; - - public Router(PluginBase plugin) - { - Store = plugin.GetOrCreateSingleton<ManagedRouteStore>(); - Logger = plugin.Log; - RouteTable = new(); - } + private readonly ConcurrentDictionary<IWebProcessor, Task<ReadOnlyCollection<Route>>> RouteTable = new(); public Router(PluginBase plugin, IConfigScope config):this(plugin) { } |