aboutsummaryrefslogtreecommitdiff
path: root/Plugins/SessionCacheServer/Endpoints/ConnectEndpoint.cs
diff options
context:
space:
mode:
authorLibravatar vman <public@vaughnnugent.com>2022-12-28 14:19:32 -0500
committerLibravatar vman <public@vaughnnugent.com>2022-12-28 14:19:32 -0500
commit9bb5ddd8f19c0ecabd7af4ee58d80c16826bc183 (patch)
tree7f8a3863d18f4673294ab11e427fe0b77fd70abf /Plugins/SessionCacheServer/Endpoints/ConnectEndpoint.cs
parent1f2b3530ebeafa162fe4df41e691c33cb2ff0009 (diff)
Cache provider abstractions, reduced deps
Diffstat (limited to 'Plugins/SessionCacheServer/Endpoints/ConnectEndpoint.cs')
-rw-r--r--Plugins/SessionCacheServer/Endpoints/ConnectEndpoint.cs14
1 files changed, 4 insertions, 10 deletions
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)