diff options
author | vman <public@vaughnnugent.com> | 2022-12-15 01:45:03 -0500 |
---|---|---|
committer | vman <public@vaughnnugent.com> | 2022-12-15 01:45:03 -0500 |
commit | 1f2b3530ebeafa162fe4df41e691c33cb2ff0009 (patch) | |
tree | 7f60d7c761cee2df89303c3ef0550743790a63e2 /Libs/VNLib.Plugins.Essentials.Sessions.OAuth/O2SessionProviderEntry.cs | |
parent | a0d5a8d40de9806e21e64475e3297a2a84effe22 (diff) |
JWK sigs, session cleanup v1
Diffstat (limited to 'Libs/VNLib.Plugins.Essentials.Sessions.OAuth/O2SessionProviderEntry.cs')
-rw-r--r-- | Libs/VNLib.Plugins.Essentials.Sessions.OAuth/O2SessionProviderEntry.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Libs/VNLib.Plugins.Essentials.Sessions.OAuth/O2SessionProviderEntry.cs b/Libs/VNLib.Plugins.Essentials.Sessions.OAuth/O2SessionProviderEntry.cs index 07b6530..f4462a4 100644 --- a/Libs/VNLib.Plugins.Essentials.Sessions.OAuth/O2SessionProviderEntry.cs +++ b/Libs/VNLib.Plugins.Essentials.Sessions.OAuth/O2SessionProviderEntry.cs @@ -27,16 +27,17 @@ using System.Text.Json; using VNLib.Net.Http; using VNLib.Utils.Logging; using VNLib.Utils.Extensions; +using VNLib.Data.Caching.Extensions; using VNLib.Plugins.Essentials.Oauth.Tokens; using VNLib.Plugins.Essentials.Oauth.Applications; using VNLib.Plugins.Essentials.Sessions.OAuth; +using VNLib.Plugins.Essentials.Sessions.Runtime; using VNLib.Plugins.Essentials.Sessions.OAuth.Endpoints; using VNLib.Plugins.Extensions.Loading; using VNLib.Plugins.Extensions.Loading.Routing; using VNLib.Plugins.Extensions.Loading.Sql; using VNLib.Plugins.Extensions.Loading.Events; -using VNLib.Plugins.Essentials.Sessions.Runtime; -using VNLib.Data.Caching.Extensions; + namespace VNLib.Plugins.Essentials.Sessions.Oauth { @@ -69,7 +70,7 @@ namespace VNLib.Plugins.Essentials.Sessions.Oauth //Optional application jwt token Task<JsonDocument?> jwtTokenSecret = plugin.TryGetSecretAsync("application_token_key") - .ContinueWith(static t => t.Result == null ? null : JsonDocument.Parse(t.Result), TaskScheduler.Default); + .ContinueWith(static t => t.Result == null ? null : t.Result.GetJsonDocument(), TaskScheduler.Default); //Access token endpoint is optional if (oauth2Config.TryGetValue("token_path", out JsonElement el)) @@ -107,7 +108,7 @@ namespace VNLib.Plugins.Essentials.Sessions.Oauth IReadOnlyDictionary<string, JsonElement> oauth2Config) { //Init cache client - using VnCacheClient cache = new(plugin.IsDebug() ? plugin.Log : null, Utils.Memory.Memory.Shared); + using VnCacheClient cache = new(plugin.IsDebug() ? localized : null, Utils.Memory.Memory.Shared); try { @@ -125,7 +126,7 @@ namespace VNLib.Plugins.Essentials.Sessions.Oauth await cache.LoadConfigAsync(plugin, cacheConfig); //Init session provider now that client is loaded - _sessions = new(cache.Resource!, cacheLimit, idProv, plugin.GetContextOptions()); + _sessions = new(cache.Resource!, cacheLimit, 100, idProv, plugin.GetContextOptions()); //Schedule cleanup interval with the plugin scheduler plugin.ScheduleInterval(_sessions, cleanupInterval); |