diff options
Diffstat (limited to 'Plugins/SessionCacheServer')
4 files changed, 16 insertions, 21 deletions
diff --git a/Plugins/SessionCacheServer/Endpoints/BrokerHeartBeat.cs b/Plugins/SessionCacheServer/Endpoints/BrokerHeartBeat.cs index 2e380a3..bd1233e 100644 --- a/Plugins/SessionCacheServer/Endpoints/BrokerHeartBeat.cs +++ b/Plugins/SessionCacheServer/Endpoints/BrokerHeartBeat.cs @@ -37,7 +37,7 @@ using VNLib.Plugins.Extensions.Loading; namespace VNLib.Plugins.Essentials.Sessions.Server.Endpoints { - internal class BrokerHeartBeat : ResourceEndpointBase + internal sealed class BrokerHeartBeat : ResourceEndpointBase { public override string Path => "/heartbeat"; @@ -64,9 +64,7 @@ namespace VNLib.Plugins.Essentials.Sessions.Server.Endpoints private async Task<ReadOnlyJsonWebKey> GetBrokerPubAsync() { - using SecretResult brokerPubKey = await Pbase.TryGetSecretAsync("broker_public_key") ?? throw new KeyNotFoundException("Missing required secret : broker_public_key"); - - return brokerPubKey.GetJsonWebKey(); + return await Pbase.TryGetSecretAsync("broker_public_key").ToJsonWebKey() ?? throw new KeyNotFoundException("Missing required secret : broker_public_key"); } protected override async ValueTask<VfReturnType> GetAsync(HttpEntity entity) diff --git a/Plugins/SessionCacheServer/Endpoints/ConnectEndpoint.cs b/Plugins/SessionCacheServer/Endpoints/ConnectEndpoint.cs index 77acb13..2fe0994 100644 --- a/Plugins/SessionCacheServer/Endpoints/ConnectEndpoint.cs +++ b/Plugins/SessionCacheServer/Endpoints/ConnectEndpoint.cs @@ -47,7 +47,7 @@ using VNLib.Plugins.Essentials.Extensions; namespace VNLib.Plugins.Essentials.Sessions.Server.Endpoints { - class ConnectEndpoint : ResourceEndpointBase + internal sealed class ConnectEndpoint : ResourceEndpointBase { const int MAX_RECV_BUF_SIZE = 1000 * 1024; const int MIN_RECV_BUF_SIZE = 8 * 1024; @@ -194,21 +194,15 @@ namespace VNLib.Plugins.Essentials.Sessions.Server.Endpoints private async Task<ReadOnlyJsonWebKey> GetClientPubAsync() { - using SecretResult brokerPubKey = await Pbase.TryGetSecretAsync("client_public_key") ?? throw new KeyNotFoundException("Missing required secret : client_public_key"); - - return brokerPubKey.GetJsonWebKey(); + return await Pbase.TryGetSecretAsync("client_public_key").ToJsonWebKey() ?? throw new KeyNotFoundException("Missing required secret : client_public_key"); } private async Task<ReadOnlyJsonWebKey> GetCachePubAsync() { - using SecretResult cachPublic = await Pbase.TryGetSecretAsync("cache_public_key") ?? throw new KeyNotFoundException("Missing required secret : client_public_key"); - - return cachPublic.GetJsonWebKey(); + return await Pbase.TryGetSecretAsync("cache_public_key").ToJsonWebKey() ?? throw new KeyNotFoundException("Missing required secret : client_public_key"); } private async Task<ReadOnlyJsonWebKey> GetCachePrivateKeyAsync() { - using SecretResult cachePrivate = await Pbase.TryGetSecretAsync("cache_private_key") ?? throw new KeyNotFoundException("Missing required secret : client_public_key"); - - return cachePrivate.GetJsonWebKey(); + return await Pbase.TryGetSecretAsync("cache_private_key").ToJsonWebKey() ?? throw new KeyNotFoundException("Missing required secret : client_public_key"); } private async Task ChangeWorkerAsync(CancellationToken cancellation) diff --git a/Plugins/SessionCacheServer/ObjectCacheServer.csproj b/Plugins/SessionCacheServer/ObjectCacheServer.csproj index 2cf298d..ff239cc 100644 --- a/Plugins/SessionCacheServer/ObjectCacheServer.csproj +++ b/Plugins/SessionCacheServer/ObjectCacheServer.csproj @@ -1,5 +1,4 @@ <Project Sdk="Microsoft.NET.Sdk"> - <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <Nullable>enable</Nullable> @@ -7,7 +6,8 @@ <Version>1.0.1.1</Version> <RootNamespace>VNLib.Plugins.Essentials.Sessions.Server</RootNamespace> <Copyright>Copyright © 2022 Vaughn Nugent</Copyright> - + <SignAssembly>True</SignAssembly> + <AssemblyOriginatorKeyFile>\\vaughnnugent.com\Internal\Folder Redirection\vman\Documents\Programming\Software\StrongNameingKey.snk</AssemblyOriginatorKeyFile> </PropertyGroup> <!-- Resolve nuget dll files and store them in the output dir --> @@ -52,7 +52,12 @@ </ItemGroup> <Target Name="PostBuild" AfterTargets="PostBuildEvent"> - <Exec Command="start xcopy "$(TargetDir)" "$(ProjectDir)/liveplugin/$(TargetName)" /E /Y /R
start xcopy "$(TargetDir)" "\\vaughnnugent.com\Internal\Vaughns Folder\Programming\LiveWebPlugins\SessionServerPlugins/$(TargetName)" /E /Y /R" /> + + <Exec Command="erase "\vaughnnugent.com\Internal\Folder Redirection\vman\Documents\Programming\Software\VNLib\Web Plugins/$(TargetName)" /q > nul
start xcopy "$(TargetDir)" "$(ProjectDir)/liveplugin/$(TargetName)" /E /Y /R
start xcopy "$(TargetDir)" "\\vaughnnugent.com\Internal\Folder Redirection\vman\Documents\Programming\Software\VNLib\Web Plugins/$(TargetName)" /E /Y /R" /> + </Target> + + <Target Name="PostBuild" AfterTargets="PostBuildEvent"> + <Exec Command="erase "F:\Programming\Web Plugins\DevPlugins\$(TargetName)" /q > nul" /> </Target> </Project> diff --git a/Plugins/SessionCacheServer/ObjectCacheServerEntry.cs b/Plugins/SessionCacheServer/ObjectCacheServerEntry.cs index 20a6268..85a7996 100644 --- a/Plugins/SessionCacheServer/ObjectCacheServerEntry.cs +++ b/Plugins/SessionCacheServer/ObjectCacheServerEntry.cs @@ -287,14 +287,12 @@ namespace VNLib.Plugins.Essentials.Sessions.Server private async Task<ReadOnlyJsonWebKey> GetCachePrivate() { - using SecretResult secret = await this.TryGetSecretAsync("cache_private_key") ?? throw new KeyNotFoundException("Failed to load the cache private key"); - return secret.GetJsonWebKey(); + return await this.TryGetSecretAsync("cache_private_key").ToJsonWebKey() ?? throw new KeyNotFoundException("Failed to load the cache private key"); } private async Task<ReadOnlyJsonWebKey> GetBrokerPublic() { - using SecretResult secret = await this.TryGetSecretAsync("broker_public_key") ?? throw new KeyNotFoundException("Failed to load the broker's public key"); - return secret.GetJsonWebKey(); + return await this.TryGetSecretAsync("broker_public_key").ToJsonWebKey() ?? throw new KeyNotFoundException("Failed to load the broker's public key"); } |