diff options
author | vnugent <public@vaughnnugent.com> | 2024-01-02 02:33:18 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2024-01-02 02:33:18 -0500 |
commit | d1df44912c5519158603f75a21e70d40742623ed (patch) | |
tree | f735ebebfc4f2cb27057ede107ad535b145d99c2 /libs/VNLib.Plugins.Sessions.OAuth/src | |
parent | 4f5b6a9819609f6e9a9238b78621019fb144f01a (diff) |
breaking changes: plugin service pools & move plugin api away from web related
Diffstat (limited to 'libs/VNLib.Plugins.Sessions.OAuth/src')
-rw-r--r-- | libs/VNLib.Plugins.Sessions.OAuth/src/O2AuthenticationPluginEntry.cs | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/libs/VNLib.Plugins.Sessions.OAuth/src/O2AuthenticationPluginEntry.cs b/libs/VNLib.Plugins.Sessions.OAuth/src/O2AuthenticationPluginEntry.cs index 1d74b7e..8181193 100644 --- a/libs/VNLib.Plugins.Sessions.OAuth/src/O2AuthenticationPluginEntry.cs +++ b/libs/VNLib.Plugins.Sessions.OAuth/src/O2AuthenticationPluginEntry.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2023 Vaughn Nugent +* Copyright (c) 2024 Vaughn Nugent * * Library: VNLib * Package: VNLib.Plugins.Essentials.Sessions.OAuth @@ -22,42 +22,43 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ -using System; +/* + * This file exists to make this library standalone. Meaining is can be loaded + * directly by the host as a plugin instead of being loaded by the session + * provider plugin as an asset. + */ -using System.ComponentModel.Design; +using System; using VNLib.Utils.Logging; -using VNLib.Plugins.Attributes; using VNLib.Plugins.Essentials.Sessions; using VNLib.Plugins.Extensions.Loading; namespace VNLib.Plugins.Sessions.OAuth { + public sealed class O2AuthenticationPluginEntry : PluginBase { - public override string PluginName => "Essentials.Oauth.Authentication"; - - private OAuth2SessionProvider? SessionProvider; + ///<inheritdoc/> + public override string PluginName => "Essentials.Oauth.Authentication"; - [ServiceConfigurator] - public void OnServicesLoading(IServiceContainer services) - { - //Expose the OAuth2 session provider as a service singleton - services.AddService<ISessionProvider>(SessionProvider!); - } - + ///<inheritdoc/> protected override void OnLoad() { - SessionProvider = this.GetOrCreateSingleton<OAuth2SessionProvider>(); + OAuth2SessionProvider sessionProvider = this.GetOrCreateSingleton<OAuth2SessionProvider>(); + this.ExportService<ISessionProvider>(sessionProvider); + Log.Information("Plugin loaded"); } + ///<inheritdoc/> protected override void OnUnLoad() { Log.Information("Plugin unloaded"); } + ///<inheritdoc/> protected override void ProcessHostCommand(string cmd) { throw new NotImplementedException(); |