From 9bb5ddd8f19c0ecabd7af4ee58d80c16826bc183 Mon Sep 17 00:00:00 2001 From: vman Date: Wed, 28 Dec 2022 14:19:32 -0500 Subject: Cache provider abstractions, reduced deps --- Plugins/SessionCacheServer/Endpoints/ConnectEndpoint.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Plugins/SessionCacheServer/Endpoints/ConnectEndpoint.cs') 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 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 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 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) -- cgit