From fdb055f4687c59c5bd0859388dace05766f7ce06 Mon Sep 17 00:00:00 2001 From: vman Date: Fri, 4 Nov 2022 22:12:55 -0400 Subject: Jwt/jwk support, runtime provider updates --- Plugins/CacheBroker/Endpoints/BrokerRegistrationEndpoint.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Plugins/CacheBroker/Endpoints') diff --git a/Plugins/CacheBroker/Endpoints/BrokerRegistrationEndpoint.cs b/Plugins/CacheBroker/Endpoints/BrokerRegistrationEndpoint.cs index cdc0dc1..06ebfc3 100644 --- a/Plugins/CacheBroker/Endpoints/BrokerRegistrationEndpoint.cs +++ b/Plugins/CacheBroker/Endpoints/BrokerRegistrationEndpoint.cs @@ -22,13 +22,13 @@ using VNLib.Utils.Logging; using VNLib.Utils.Extensions; using VNLib.Hashing.IdentityUtility; using VNLib.Plugins.Essentials; +using VNLib.Plugins.Essentials.Endpoints; using VNLib.Plugins.Essentials.Extensions; using VNLib.Plugins.Extensions.Loading; using VNLib.Plugins.Extensions.Loading.Events; using VNLib.Plugins.Extensions.Loading.Configuration; using VNLib.Net.Rest.Client; - #nullable enable namespace VNLib.Plugins.Cache.Broker.Endpoints @@ -188,7 +188,7 @@ namespace VNLib.Plugins.Cache.Broker.Endpoints //Copy input stream to buffer await inputStream.CopyToAsync(buffer, 4096, Memory.Shared); //Parse jwt - return JsonWebToken.Parse(buffer.AsSpan()); + return JsonWebToken.ParseRaw(buffer.AsSpan()); } protected override async ValueTask PutAsync(HttpEntity entity) @@ -200,7 +200,7 @@ namespace VNLib.Plugins.Cache.Broker.Endpoints { alg.ImportSubjectPublicKeyInfo(CachePubKey.Result, out _); //Verify the jwt - if (!jwt.Verify(alg, SignatureHashAlg)) + if (!jwt.Verify(alg, in SignatureHashAlg)) { entity.CloseResponse(HttpStatusCode.Unauthorized); return VfReturnType.VirtualSkip; -- cgit