diff options
author | vnugent <public@vaughnnugent.com> | 2023-01-14 16:33:37 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-01-14 16:33:37 -0500 |
commit | 0e38da4b583f0227beca3a3f870c395f152c507a (patch) | |
tree | e4afcff6390ef2d4528ab4c16bc4c328f8607e56 /plugins/ObjectCacheServer | |
parent | 509ecc7ee4f6cd1d85e10c1e3f7e8303edbd94ae (diff) |
Utils updates
Diffstat (limited to 'plugins/ObjectCacheServer')
-rw-r--r-- | plugins/ObjectCacheServer/src/Endpoints/ConnectEndpoint.cs | 4 | ||||
-rw-r--r-- | plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/ObjectCacheServer/src/Endpoints/ConnectEndpoint.cs b/plugins/ObjectCacheServer/src/Endpoints/ConnectEndpoint.cs index 2fe0994..15cc086 100644 --- a/plugins/ObjectCacheServer/src/Endpoints/ConnectEndpoint.cs +++ b/plugins/ObjectCacheServer/src/Endpoints/ConnectEndpoint.cs @@ -171,7 +171,7 @@ namespace VNLib.Plugins.Essentials.Sessions.Server.Endpoints auth.WriteHeader(cert.JwtHeader); auth.InitPayloadClaim() .AddClaim("aud", AudienceLocalServerId) - .AddClaim("exp", DateTimeOffset.UtcNow.Add(AuthTokenExpiration).ToUnixTimeSeconds()) + .AddClaim("exp", entity.RequestedTimeUtc.Add(AuthTokenExpiration).ToUnixTimeSeconds()) .AddClaim("nonce", RandomHash.GetRandomBase32(8)) .AddClaim("chl", challenge!) //Set the ispeer flag if the request was signed by a cache server @@ -279,7 +279,7 @@ namespace VNLib.Plugins.Essentials.Sessions.Server.Endpoints } if (!doc.RootElement.TryGetProperty("exp", out JsonElement expEl) - || DateTimeOffset.FromUnixTimeSeconds(expEl.GetInt64()) < DateTimeOffset.UtcNow) + || DateTimeOffset.FromUnixTimeSeconds(expEl.GetInt64()) < entity.RequestedTimeUtc) { entity.CloseResponse(HttpStatusCode.Unauthorized); return VfReturnType.VirtualSkip; diff --git a/plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs b/plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs index 85a7996..7b7b9fb 100644 --- a/plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs +++ b/plugins/ObjectCacheServer/src/ObjectCacheServerEntry.cs @@ -74,7 +74,7 @@ namespace VNLib.Plugins.Essentials.Sessions.Server protected override void OnLoad() { //Create default heap - IUnmangedHeap CacheHeap = Memory.InitializeNewHeapForProcess(); + IUnmangedHeap CacheHeap = MemoryUtil.InitializeNewHeapForProcess(); try { IReadOnlyDictionary<string, JsonElement> clusterConf = this.GetConfig("cluster"); |