From ae4f70c6ae26d174b6f0a44c2fe5ce521f8da9b6 Mon Sep 17 00:00:00 2001 From: slewis74 Date: Tue, 9 Mar 2021 09:19:30 +1000 Subject: [PATCH 1/2] new logging infra --- .../AzureADAuthenticationProvider.cs | 2 +- .../Configuration/AzureADConfigureCommands.cs | 2 +- .../Issuer/AzureADKeyRetriever.cs | 2 +- source/Server.AzureAD/Server.AzureAD.csproj | 2 +- .../Tokens/AzureADAuthTokenHandler.cs | 2 +- .../Web/AzureADUserAuthenticatedAction.cs | 6 ++--- .../Web/AzureADUserAuthenticationAction.cs | 6 ++--- .../GoogleAppsConfigureCommands.cs | 2 +- .../GoogleAppsAuthenticationProvider.cs | 2 +- .../Issuer/GoogleKeyRetriever.cs | 2 +- .../Tokens/GoogleAuthTokenHandler.cs | 2 +- .../Web/GoogleAppsUserAuthenticatedAction.cs | 6 ++--- .../Web/GoogleAppsUserAuthenticationAction.cs | 8 +++---- .../OctopusIDConfigureCommands.cs | 2 +- .../Issuer/OctopusIDKeyRetriever.cs | 2 +- .../OctopusIDAuthenticationProvider.cs | 2 +- .../Server.OctopusID/Server.OctopusID.csproj | 2 +- .../Tokens/OctopusIDAuthTokenHandler.cs | 2 +- .../Web/OctopusIDUserAuthenticatedAction.cs | 6 ++--- .../Web/OctopusIDUserAuthenticationAction.cs | 6 ++--- .../Configuration/OktaConfigureCommands.cs | 2 +- source/Server.Okta/Issuer/OktaKeyRetriever.cs | 2 +- .../Server.Okta/OktaAuthenticationProvider.cs | 2 +- source/Server.Okta/Server.Okta.csproj | 2 +- .../Tokens/OktaAuthTokenHandler.cs | 2 +- .../Web/OktaUserAuthenticatedAction.cs | 6 ++--- .../Web/OktaUserAuthenticationAction.cs | 6 ++--- .../Certificates/KeyRetriever.cs | 10 ++++----- .../OpenIDConnectConfigureCommands.cs | 4 ++-- .../OpenIDConnectAuthenticationProvider.cs | 8 +++---- .../Server.OpenIDConnect.Common.csproj | 6 ++--- .../Tokens/AuthTokenHandler.cs | 22 +++++++++---------- .../Tokens/OpenIDConnectAuthTokenHandler.cs | 8 +++---- .../OpenIDConnectAuthTokenWithRolesHandler.cs | 2 +- .../Web/UserAuthenticatedAction.cs | 4 ++-- .../Web/UserAuthenticationAction.cs | 6 ++--- .../CustomOpenIDConnectAuthTokenHandler.cs | 6 ++--- ...omOpenIDConnectWithRoleAuthTokenHandler.cs | 6 ++--- .../OpenIDConnectAuthTokenHandlerFixture.cs | 4 ++-- ...ConnectWithRolesAuthTokenHandlerFixture.cs | 4 ++-- 40 files changed, 89 insertions(+), 89 deletions(-) diff --git a/source/Server.AzureAD/AzureADAuthenticationProvider.cs b/source/Server.AzureAD/AzureADAuthenticationProvider.cs index ff0302c..598bb39 100644 --- a/source/Server.AzureAD/AzureADAuthenticationProvider.cs +++ b/source/Server.AzureAD/AzureADAuthenticationProvider.cs @@ -10,7 +10,7 @@ namespace Octopus.Server.Extensibility.Authentication.AzureAD class AzureADAuthenticationProvider : OpenIDConnectAuthenticationProvider { public const string ProviderName = "Azure AD"; - public AzureADAuthenticationProvider(ILog log, IAzureADConfigurationStore configurationStore) : base(log, configurationStore) + public AzureADAuthenticationProvider(ISystemLog log, IAzureADConfigurationStore configurationStore) : base(log, configurationStore) { } diff --git a/source/Server.AzureAD/Configuration/AzureADConfigureCommands.cs b/source/Server.AzureAD/Configuration/AzureADConfigureCommands.cs index 1f2e7c4..d16971b 100644 --- a/source/Server.AzureAD/Configuration/AzureADConfigureCommands.cs +++ b/source/Server.AzureAD/Configuration/AzureADConfigureCommands.cs @@ -10,7 +10,7 @@ namespace Octopus.Server.Extensibility.Authentication.AzureAD.Configuration class AzureADConfigureCommands : OpenIdConnectConfigureCommands { public AzureADConfigureCommands( - ILog log, + ISystemLog log, Lazy configurationStore, Lazy webPortalConfigurationStore) : base(log, configurationStore, webPortalConfigurationStore) diff --git a/source/Server.AzureAD/Issuer/AzureADKeyRetriever.cs b/source/Server.AzureAD/Issuer/AzureADKeyRetriever.cs index b387b31..8c6182b 100644 --- a/source/Server.AzureAD/Issuer/AzureADKeyRetriever.cs +++ b/source/Server.AzureAD/Issuer/AzureADKeyRetriever.cs @@ -6,7 +6,7 @@ namespace Octopus.Server.Extensibility.Authentication.AzureAD.Issuer { class AzureADKeyRetriever : KeyRetriever, IAzureADKeyRetriever { - public AzureADKeyRetriever(IAzureADConfigurationStore configurationStore, IKeyJsonParser keyParser, ILog log) : base(configurationStore, keyParser, log) + public AzureADKeyRetriever(ISystemLog log, IAzureADConfigurationStore configurationStore, IKeyJsonParser keyParser) : base(log, configurationStore, keyParser) { } } diff --git a/source/Server.AzureAD/Server.AzureAD.csproj b/source/Server.AzureAD/Server.AzureAD.csproj index 8f89b8e..b0b8b59 100644 --- a/source/Server.AzureAD/Server.AzureAD.csproj +++ b/source/Server.AzureAD/Server.AzureAD.csproj @@ -15,7 +15,7 @@ - + diff --git a/source/Server.AzureAD/Tokens/AzureADAuthTokenHandler.cs b/source/Server.AzureAD/Tokens/AzureADAuthTokenHandler.cs index 131c95e..0a48b22 100644 --- a/source/Server.AzureAD/Tokens/AzureADAuthTokenHandler.cs +++ b/source/Server.AzureAD/Tokens/AzureADAuthTokenHandler.cs @@ -8,7 +8,7 @@ namespace Octopus.Server.Extensibility.Authentication.AzureAD.Tokens { class AzureADAuthTokenHandler : OpenIDConnectAuthTokenWithRolesHandler, IAzureADAuthTokenHandler { - public AzureADAuthTokenHandler(ILog log, IAzureADConfigurationStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IAzureADKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) + public AzureADAuthTokenHandler(ISystemLog log, IAzureADConfigurationStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IAzureADKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) { } } diff --git a/source/Server.AzureAD/Web/AzureADUserAuthenticatedAction.cs b/source/Server.AzureAD/Web/AzureADUserAuthenticatedAction.cs index e7c5a64..f575196 100644 --- a/source/Server.AzureAD/Web/AzureADUserAuthenticatedAction.cs +++ b/source/Server.AzureAD/Web/AzureADUserAuthenticatedAction.cs @@ -13,16 +13,16 @@ namespace Octopus.Server.Extensibility.Authentication.AzureAD.Web class AzureADUserAuthenticatedAction : UserAuthenticatedAction { public AzureADUserAuthenticatedAction( - ILog log, + ISystemLog log, IAzureADAuthTokenHandler authTokenHandler, IAzureADPrincipalToUserResourceMapper principalToUserResourceMapper, IUpdateableUserStore userStore, IAzureADConfigurationStore configurationStore, IAuthCookieCreator authCookieCreator, IInvalidLoginTracker loginTracker, - ISleep sleep, + ISleep sleep, IAzureADIdentityCreator identityCreator, - IClock clock, + IClock clock, IUrlEncoder encoder) : base( log, diff --git a/source/Server.AzureAD/Web/AzureADUserAuthenticationAction.cs b/source/Server.AzureAD/Web/AzureADUserAuthenticationAction.cs index 7b96708..c3e2933 100644 --- a/source/Server.AzureAD/Web/AzureADUserAuthenticationAction.cs +++ b/source/Server.AzureAD/Web/AzureADUserAuthenticationAction.cs @@ -11,9 +11,9 @@ namespace Octopus.Server.Extensibility.Authentication.AzureAD.Web class AzureADUserAuthenticationAction : UserAuthenticationAction { public AzureADUserAuthenticationAction( - ILog log, - IAzureADConfigurationStore configurationStore, - IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, + ISystemLog log, + IAzureADConfigurationStore configurationStore, + IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IAzureADAuthorizationEndpointUrlBuilder urlBuilder, IApiActionModelBinder modelBinder, IAuthenticationConfigurationStore authenticationConfigurationStore) : base(log, configurationStore, identityProviderConfigDiscoverer, urlBuilder, modelBinder, authenticationConfigurationStore) diff --git a/source/Server.GoogleApps/Configuration/GoogleAppsConfigureCommands.cs b/source/Server.GoogleApps/Configuration/GoogleAppsConfigureCommands.cs index 30461a0..2ec9c13 100644 --- a/source/Server.GoogleApps/Configuration/GoogleAppsConfigureCommands.cs +++ b/source/Server.GoogleApps/Configuration/GoogleAppsConfigureCommands.cs @@ -10,7 +10,7 @@ namespace Octopus.Server.Extensibility.Authentication.GoogleApps.Configuration class GoogleAppsConfigureCommands : OpenIdConnectConfigureCommands { public GoogleAppsConfigureCommands( - ILog log, + ISystemLog log, Lazy configurationStore, Lazy webPortalConfigurationStore) : base(log, configurationStore, webPortalConfigurationStore) diff --git a/source/Server.GoogleApps/GoogleAppsAuthenticationProvider.cs b/source/Server.GoogleApps/GoogleAppsAuthenticationProvider.cs index 6fd7f87..b617e0e 100644 --- a/source/Server.GoogleApps/GoogleAppsAuthenticationProvider.cs +++ b/source/Server.GoogleApps/GoogleAppsAuthenticationProvider.cs @@ -11,7 +11,7 @@ class GoogleAppsAuthenticationProvider : OpenIDConnectAuthenticationProvider, IGoogleKeyRetriever { - public GoogleKeyRetriever(IGoogleAppsConfigurationStore configurationStore, IKeyJsonParser keyParser, ILog log) : base(configurationStore, keyParser, log) + public GoogleKeyRetriever(ISystemLog log, IGoogleAppsConfigurationStore configurationStore, IKeyJsonParser keyParser) : base(log, configurationStore, keyParser) { } } diff --git a/source/Server.GoogleApps/Tokens/GoogleAuthTokenHandler.cs b/source/Server.GoogleApps/Tokens/GoogleAuthTokenHandler.cs index 6df50c5..c64c349 100644 --- a/source/Server.GoogleApps/Tokens/GoogleAuthTokenHandler.cs +++ b/source/Server.GoogleApps/Tokens/GoogleAuthTokenHandler.cs @@ -10,7 +10,7 @@ namespace Octopus.Server.Extensibility.Authentication.GoogleApps.Tokens { class GoogleAuthTokenHandler : OpenIDConnectAuthTokenHandler, IGoogleAuthTokenHandler { - public GoogleAuthTokenHandler(ILog log, IGoogleAppsConfigurationStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IGoogleKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) + public GoogleAuthTokenHandler(ISystemLog log, IGoogleAppsConfigurationStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IGoogleKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) { } diff --git a/source/Server.GoogleApps/Web/GoogleAppsUserAuthenticatedAction.cs b/source/Server.GoogleApps/Web/GoogleAppsUserAuthenticatedAction.cs index fb0e3cc..a0b0a0e 100644 --- a/source/Server.GoogleApps/Web/GoogleAppsUserAuthenticatedAction.cs +++ b/source/Server.GoogleApps/Web/GoogleAppsUserAuthenticatedAction.cs @@ -10,11 +10,11 @@ namespace Octopus.Server.Extensibility.Authentication.GoogleApps.Web { - class GoogleAppsUserAuthenticatedAction + class GoogleAppsUserAuthenticatedAction : UserAuthenticatedAction { public GoogleAppsUserAuthenticatedAction( - ILog log, + ISystemLog log, IGoogleAuthTokenHandler authTokenHandler, IPrincipalToUserResourceMapper principalToUserResourceMapper, IUpdateableUserStore userStore, @@ -23,7 +23,7 @@ public GoogleAppsUserAuthenticatedAction( IInvalidLoginTracker loginTracker, ISleep sleep, IGoogleAppsIdentityCreator identityCreator, - IClock clock, IUrlEncoder encoder) + IClock clock, IUrlEncoder encoder) : base(log, authTokenHandler, principalToUserResourceMapper, userStore, configurationStore, authCookieCreator, loginTracker, sleep, identityCreator, clock, encoder) { } diff --git a/source/Server.GoogleApps/Web/GoogleAppsUserAuthenticationAction.cs b/source/Server.GoogleApps/Web/GoogleAppsUserAuthenticationAction.cs index ba950d0..b69a5c5 100644 --- a/source/Server.GoogleApps/Web/GoogleAppsUserAuthenticationAction.cs +++ b/source/Server.GoogleApps/Web/GoogleAppsUserAuthenticationAction.cs @@ -11,12 +11,12 @@ namespace Octopus.Server.Extensibility.Authentication.GoogleApps.Web class GoogleAppsUserAuthenticationAction : UserAuthenticationAction { public GoogleAppsUserAuthenticationAction( - ILog log, - IGoogleAppsConfigurationStore configurationStore, - IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, + ISystemLog log, + IGoogleAppsConfigurationStore configurationStore, + IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IGoogleAppsAuthorizationEndpointUrlBuilder urlBuilder, IApiActionModelBinder modelBinder, - IAuthenticationConfigurationStore authenticationConfigurationStore) + IAuthenticationConfigurationStore authenticationConfigurationStore) : base(log, configurationStore, identityProviderConfigDiscoverer, urlBuilder, modelBinder, authenticationConfigurationStore) { } diff --git a/source/Server.OctopusID/Configuration/OctopusIDConfigureCommands.cs b/source/Server.OctopusID/Configuration/OctopusIDConfigureCommands.cs index 66feb75..2cd406c 100644 --- a/source/Server.OctopusID/Configuration/OctopusIDConfigureCommands.cs +++ b/source/Server.OctopusID/Configuration/OctopusIDConfigureCommands.cs @@ -11,7 +11,7 @@ namespace Octopus.Server.Extensibility.Authentication.OctopusID.Configuration class OctopusIDConfigureCommands : OpenIdConnectConfigureCommands { public OctopusIDConfigureCommands( - ILog log, + ISystemLog log, Lazy configurationStore, Lazy webPortalConfigurationStore) : base(log, configurationStore, webPortalConfigurationStore) diff --git a/source/Server.OctopusID/Issuer/OctopusIDKeyRetriever.cs b/source/Server.OctopusID/Issuer/OctopusIDKeyRetriever.cs index 41a05d6..c9b11e4 100644 --- a/source/Server.OctopusID/Issuer/OctopusIDKeyRetriever.cs +++ b/source/Server.OctopusID/Issuer/OctopusIDKeyRetriever.cs @@ -6,7 +6,7 @@ namespace Octopus.Server.Extensibility.Authentication.OctopusID.Issuer { class OctopusIDKeyRetriever : KeyRetriever, IOctopusIDKeyRetriever { - public OctopusIDKeyRetriever(IOctopusIDConfigurationStore configurationStore, IKeyJsonParser keyParser, ILog log) : base(configurationStore, keyParser, log) + public OctopusIDKeyRetriever(ISystemLog log, IOctopusIDConfigurationStore configurationStore, IKeyJsonParser keyParser) : base(log, configurationStore, keyParser) { } } diff --git a/source/Server.OctopusID/OctopusIDAuthenticationProvider.cs b/source/Server.OctopusID/OctopusIDAuthenticationProvider.cs index 712b610..c7b7e32 100644 --- a/source/Server.OctopusID/OctopusIDAuthenticationProvider.cs +++ b/source/Server.OctopusID/OctopusIDAuthenticationProvider.cs @@ -9,7 +9,7 @@ class OctopusIDAuthenticationProvider : OpenIDConnectAuthenticationProvider - + diff --git a/source/Server.OctopusID/Tokens/OctopusIDAuthTokenHandler.cs b/source/Server.OctopusID/Tokens/OctopusIDAuthTokenHandler.cs index 4f99b5d..20d3efd 100644 --- a/source/Server.OctopusID/Tokens/OctopusIDAuthTokenHandler.cs +++ b/source/Server.OctopusID/Tokens/OctopusIDAuthTokenHandler.cs @@ -7,7 +7,7 @@ namespace Octopus.Server.Extensibility.Authentication.OctopusID.Tokens { class OctopusIDAuthTokenHandler : OpenIDConnectAuthTokenWithRolesHandler, IOctopusIDAuthTokenHandler { - public OctopusIDAuthTokenHandler(ILog log, IOctopusIDConfigurationStore configurationStore, IOctopusIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IOctopusIDKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) + public OctopusIDAuthTokenHandler(ISystemLog log, IOctopusIDConfigurationStore configurationStore, IOctopusIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IOctopusIDKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) { } } diff --git a/source/Server.OctopusID/Web/OctopusIDUserAuthenticatedAction.cs b/source/Server.OctopusID/Web/OctopusIDUserAuthenticatedAction.cs index c267142..a0945af 100644 --- a/source/Server.OctopusID/Web/OctopusIDUserAuthenticatedAction.cs +++ b/source/Server.OctopusID/Web/OctopusIDUserAuthenticatedAction.cs @@ -13,7 +13,7 @@ namespace Octopus.Server.Extensibility.Authentication.OctopusID.Web class OctopusIDUserAuthenticatedAction : UserAuthenticatedAction { public OctopusIDUserAuthenticatedAction( - ILog log, + ISystemLog log, IOctopusIDAuthTokenHandler authTokenHandler, IOctopusIDPrincipalToUserResourceMapper principalToUserResourceMapper, IUpdateableUserStore userStore, @@ -32,8 +32,8 @@ public OctopusIDUserAuthenticatedAction( authCookieCreator, loginTracker, sleep, - identityCreator, - clock, + identityCreator, + clock, encoder) { } diff --git a/source/Server.OctopusID/Web/OctopusIDUserAuthenticationAction.cs b/source/Server.OctopusID/Web/OctopusIDUserAuthenticationAction.cs index f0d26b9..f010cbe 100644 --- a/source/Server.OctopusID/Web/OctopusIDUserAuthenticationAction.cs +++ b/source/Server.OctopusID/Web/OctopusIDUserAuthenticationAction.cs @@ -10,9 +10,9 @@ namespace Octopus.Server.Extensibility.Authentication.OctopusID.Web class OctopusIDUserAuthenticationAction : UserAuthenticationAction { public OctopusIDUserAuthenticationAction( - ILog log, - IOctopusIDConfigurationStore configurationStore, - IOctopusIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, + ISystemLog log, + IOctopusIDConfigurationStore configurationStore, + IOctopusIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IOctopusIDAuthorizationEndpointUrlBuilder urlBuilder, IApiActionModelBinder modelBinder, IAuthenticationConfigurationStore authenticationConfigurationStore) : base(log, configurationStore, identityProviderConfigDiscoverer, urlBuilder, modelBinder, authenticationConfigurationStore) diff --git a/source/Server.Okta/Configuration/OktaConfigureCommands.cs b/source/Server.Okta/Configuration/OktaConfigureCommands.cs index ea50f20..7858d20 100644 --- a/source/Server.Okta/Configuration/OktaConfigureCommands.cs +++ b/source/Server.Okta/Configuration/OktaConfigureCommands.cs @@ -10,7 +10,7 @@ namespace Octopus.Server.Extensibility.Authentication.Okta.Configuration class OktaConfigureCommands : OpenIdConnectConfigureCommands { public OktaConfigureCommands( - ILog log, + ISystemLog log, Lazy configurationStore, Lazy webPortalConfigurationStore) : base(log, configurationStore, webPortalConfigurationStore) diff --git a/source/Server.Okta/Issuer/OktaKeyRetriever.cs b/source/Server.Okta/Issuer/OktaKeyRetriever.cs index eaf3fdb..92084fc 100644 --- a/source/Server.Okta/Issuer/OktaKeyRetriever.cs +++ b/source/Server.Okta/Issuer/OktaKeyRetriever.cs @@ -6,7 +6,7 @@ namespace Octopus.Server.Extensibility.Authentication.Okta.Issuer { class OktaKeyRetriever : KeyRetriever, IOktaKeyRetriever { - public OktaKeyRetriever(IOktaConfigurationStore configurationStore, IKeyJsonParser keyParser, ILog log) : base(configurationStore, keyParser, log) + public OktaKeyRetriever(ISystemLog log, IOktaConfigurationStore configurationStore, IKeyJsonParser keyParser) : base(log, configurationStore, keyParser) { } } diff --git a/source/Server.Okta/OktaAuthenticationProvider.cs b/source/Server.Okta/OktaAuthenticationProvider.cs index e4342f3..7cac042 100644 --- a/source/Server.Okta/OktaAuthenticationProvider.cs +++ b/source/Server.Okta/OktaAuthenticationProvider.cs @@ -11,7 +11,7 @@ class OktaAuthenticationProvider : OpenIDConnectAuthenticationProvider - + diff --git a/source/Server.Okta/Tokens/OktaAuthTokenHandler.cs b/source/Server.Okta/Tokens/OktaAuthTokenHandler.cs index e89df85..cbf77e3 100644 --- a/source/Server.Okta/Tokens/OktaAuthTokenHandler.cs +++ b/source/Server.Okta/Tokens/OktaAuthTokenHandler.cs @@ -8,7 +8,7 @@ namespace Octopus.Server.Extensibility.Authentication.Okta.Tokens { class OktaAuthTokenHandler : OpenIDConnectAuthTokenWithRolesHandler, IOktaAuthTokenHandler { - public OktaAuthTokenHandler(ILog log, IOktaConfigurationStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IOktaKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) + public OktaAuthTokenHandler(ISystemLog log, IOktaConfigurationStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IOktaKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) { } } diff --git a/source/Server.Okta/Web/OktaUserAuthenticatedAction.cs b/source/Server.Okta/Web/OktaUserAuthenticatedAction.cs index 4d1e0fc..fa87682 100644 --- a/source/Server.Okta/Web/OktaUserAuthenticatedAction.cs +++ b/source/Server.Okta/Web/OktaUserAuthenticatedAction.cs @@ -14,7 +14,7 @@ namespace Octopus.Server.Extensibility.Authentication.Okta.Web class OktaUserAuthenticatedAction : UserAuthenticatedAction { public OktaUserAuthenticatedAction( - ILog log, + ISystemLog log, IOktaAuthTokenHandler authTokenHandler, IOktaPrincipalToUserResourceMapper principalToUserResourceMapper, IUpdateableUserStore userStore, @@ -33,8 +33,8 @@ public OktaUserAuthenticatedAction( authCookieCreator, loginTracker, sleep, - identityCreator, - clock, + identityCreator, + clock, encoder) { } diff --git a/source/Server.Okta/Web/OktaUserAuthenticationAction.cs b/source/Server.Okta/Web/OktaUserAuthenticationAction.cs index 78040d1..7b5631b 100644 --- a/source/Server.Okta/Web/OktaUserAuthenticationAction.cs +++ b/source/Server.Okta/Web/OktaUserAuthenticationAction.cs @@ -11,9 +11,9 @@ namespace Octopus.Server.Extensibility.Authentication.Okta.Web class OktaUserAuthenticationAction : UserAuthenticationAction { public OktaUserAuthenticationAction( - ILog log, - IOktaConfigurationStore configurationStore, - IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, + ISystemLog log, + IOktaConfigurationStore configurationStore, + IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IOktaAuthorizationEndpointUrlBuilder urlBuilder, IApiActionModelBinder modelBinder, IAuthenticationConfigurationStore authenticationConfigurationStore) : base(log, configurationStore, identityProviderConfigDiscoverer, urlBuilder, modelBinder, authenticationConfigurationStore) diff --git a/source/Server.OpenIDConnect.Common/Certificates/KeyRetriever.cs b/source/Server.OpenIDConnect.Common/Certificates/KeyRetriever.cs index b7d66c6..2a90c04 100644 --- a/source/Server.OpenIDConnect.Common/Certificates/KeyRetriever.cs +++ b/source/Server.OpenIDConnect.Common/Certificates/KeyRetriever.cs @@ -18,15 +18,15 @@ public abstract class KeyRetriever : IKeyRetriever where TKeyParser : IKeyJsonParser { readonly TKeyParser keyParser; - readonly ILog log; + readonly ISystemLog log; readonly object funcLock = new object(); Task>? certRetrieveTask; protected readonly TStore ConfigurationStore; - protected KeyRetriever(TStore configurationStore, - TKeyParser keyParser, - ILog log) + protected KeyRetriever(ISystemLog log, + TStore configurationStore, + TKeyParser keyParser) { ConfigurationStore = configurationStore; this.keyParser = keyParser; @@ -42,7 +42,7 @@ public Task> GetKeysAsync(IssuerConfi certRetrieveTask = DoGetKeyAsync(issuerConfiguration); return certRetrieveTask; - } + } } protected virtual string GetDownloadUri(IssuerConfiguration issuerConfiguration) diff --git a/source/Server.OpenIDConnect.Common/Configuration/OpenIDConnectConfigureCommands.cs b/source/Server.OpenIDConnect.Common/Configuration/OpenIDConnectConfigureCommands.cs index 1692e42..cd30ada 100644 --- a/source/Server.OpenIDConnect.Common/Configuration/OpenIDConnectConfigureCommands.cs +++ b/source/Server.OpenIDConnect.Common/Configuration/OpenIDConnectConfigureCommands.cs @@ -10,12 +10,12 @@ namespace Octopus.Server.Extensibility.Authentication.OpenIDConnect.Common.Confi public abstract class OpenIdConnectConfigureCommands : IContributeToConfigureCommand where TStore : IOpenIDConnectConfigurationStore { - protected readonly ILog Log; + protected readonly ISystemLog Log; protected readonly Lazy ConfigurationStore; readonly Lazy webPortalConfigurationStore; protected OpenIdConnectConfigureCommands( - ILog log, + ISystemLog log, Lazy configurationStore, Lazy webPortalConfigurationStore) { diff --git a/source/Server.OpenIDConnect.Common/OpenIDConnectAuthenticationProvider.cs b/source/Server.OpenIDConnect.Common/OpenIDConnectAuthenticationProvider.cs index 2ff345a..27cac18 100644 --- a/source/Server.OpenIDConnect.Common/OpenIDConnectAuthenticationProvider.cs +++ b/source/Server.OpenIDConnect.Common/OpenIDConnectAuthenticationProvider.cs @@ -10,15 +10,15 @@ namespace Octopus.Server.Extensibility.Authentication.OpenIDConnect.Common { - public abstract class OpenIDConnectAuthenticationProvider : IAuthenticationProviderWithGroupSupport, + public abstract class OpenIDConnectAuthenticationProvider : IAuthenticationProviderWithGroupSupport, IUseAuthenticationIdentities, IContributesCSS, IContributesJavascript where TStore : IOpenIDConnectConfigurationStore { - readonly ILog log; + readonly ISystemLog log; - protected OpenIDConnectAuthenticationProvider(ILog log, TStore configurationStore) + protected OpenIDConnectAuthenticationProvider(ISystemLog log, TStore configurationStore) { this.log = log; ConfigurationStore = configurationStore; @@ -88,7 +88,7 @@ public IEnumerable GetJavascriptUris() ? Enumerable.Empty() : new[] { $"~/areas/users/{FilenamePrefix}_auth_provider.js" }; } - + public IdentityMetadataResource GetMetadata() { return new IdentityMetadataResource diff --git a/source/Server.OpenIDConnect.Common/Server.OpenIDConnect.Common.csproj b/source/Server.OpenIDConnect.Common/Server.OpenIDConnect.Common.csproj index de29f9e..f2b820e 100644 --- a/source/Server.OpenIDConnect.Common/Server.OpenIDConnect.Common.csproj +++ b/source/Server.OpenIDConnect.Common/Server.OpenIDConnect.Common.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/source/Server.OpenIDConnect.Common/Tokens/AuthTokenHandler.cs b/source/Server.OpenIDConnect.Common/Tokens/AuthTokenHandler.cs index cb9e5dc..5383a15 100644 --- a/source/Server.OpenIDConnect.Common/Tokens/AuthTokenHandler.cs +++ b/source/Server.OpenIDConnect.Common/Tokens/AuthTokenHandler.cs @@ -19,21 +19,21 @@ public abstract class AuthTokenHandler where TDiscoverer : IIdentityProviderConfigDiscoverer { static string[] hmacAlgorithms = {SecurityAlgorithms.HmacSha256, SecurityAlgorithms.HmacSha384, SecurityAlgorithms.HmacSha512}; - + readonly TDiscoverer identityProviderConfigDiscoverer; readonly TRetriever keyRetriever; - protected readonly ILog Log; + protected readonly ISystemLog Log; protected readonly TStore ConfigurationStore; - protected AuthTokenHandler(TStore configurationStore, + protected AuthTokenHandler(ISystemLog log, + TStore configurationStore, TDiscoverer identityProviderConfigDiscoverer, - TRetriever keyRetriever, - ILog log) + TRetriever keyRetriever) { + Log = log; ConfigurationStore = configurationStore; this.identityProviderConfigDiscoverer = identityProviderConfigDiscoverer; this.keyRetriever = keyRetriever; - Log = log; } protected async Task GetPrincipalFromToken(string? accessToken, string? idToken) @@ -65,9 +65,9 @@ protected async Task GetPrincipalFromToken(string? acc } SetIssuerSpecificTokenValidationParameters(validationParameters); - + var jwt = new JwtSecurityToken(idToken); - + if (hmacAlgorithms.Contains(jwt.Header.Alg)) { principal = ValidateUsingSharedSecret(validationParameters, tokenToValidate); @@ -99,7 +99,7 @@ ClaimsPrincipal ValidateUsingSharedSecret(TokenValidationParameters validationPa { throw new InvalidOperationException($"The received token was signed with a client secret, which is not supported by the {ConfigurationStore.ConfigurationSettingsName} authentication provider."); } - + SecurityToken unused; var handler = new JwtSecurityTokenHandler(); try @@ -126,7 +126,7 @@ async Task ValidateUsingIssuerCertificate(TokenValidationParame return new[] {keys[identifier]}; }; - + SecurityToken unused; ClaimsPrincipal? principal = null; @@ -163,7 +163,7 @@ async Task ValidateUsingIssuerCertificate(TokenValidationParame } throw new InvalidOperationException("Unable to retrieve issuer certificate"); } - + protected virtual void SetIssuerSpecificTokenValidationParameters(TokenValidationParameters validationParameters) { } diff --git a/source/Server.OpenIDConnect.Common/Tokens/OpenIDConnectAuthTokenHandler.cs b/source/Server.OpenIDConnect.Common/Tokens/OpenIDConnectAuthTokenHandler.cs index 7fcafec..e27db25 100644 --- a/source/Server.OpenIDConnect.Common/Tokens/OpenIDConnectAuthTokenHandler.cs +++ b/source/Server.OpenIDConnect.Common/Tokens/OpenIDConnectAuthTokenHandler.cs @@ -13,17 +13,17 @@ public abstract class OpenIDConnectAuthTokenHandler GetPrincipalAsync(IDictionary requestForm, out string? stateString) { stateString = null; - + if (requestForm.ContainsKey("error")) { var errorDescription = requestForm["error_description"] ?? string.Empty; @@ -36,7 +36,7 @@ public Task GetPrincipalAsync(IDictionary : IAsyncApiAction static readonly BadRequestRegistration PotentialOpenDirect = new BadRequestRegistration("Request not allowed, due to potential Open Redirection attack"); static readonly BadRequestRegistration LoginFailed = new BadRequestRegistration("Login failed. Please see the Octopus Server logs for more details."); static readonly OctopusJsonRegistration Result = new OctopusJsonRegistration(); - - readonly ILog log; + + readonly ISystemLog log; readonly IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer; readonly IAuthorizationEndpointUrlBuilder urlBuilder; @@ -28,7 +28,7 @@ public abstract class UserAuthenticationAction : IAsyncApiAction readonly IAuthenticationConfigurationStore authenticationConfigurationStore; protected UserAuthenticationAction( - ILog log, + ISystemLog log, TStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IAuthorizationEndpointUrlBuilder urlBuilder, diff --git a/source/Tests/OpenIdConnect/Tokens/CustomOpenIDConnectAuthTokenHandler.cs b/source/Tests/OpenIdConnect/Tokens/CustomOpenIDConnectAuthTokenHandler.cs index 82773c5..2abf1a0 100644 --- a/source/Tests/OpenIdConnect/Tokens/CustomOpenIDConnectAuthTokenHandler.cs +++ b/source/Tests/OpenIdConnect/Tokens/CustomOpenIDConnectAuthTokenHandler.cs @@ -7,10 +7,10 @@ namespace Tests.OpenIdConnect.Tokens { public class CustomOpenIDConnectAuthTokenHandler : OpenIDConnectAuthTokenHandler - { - public CustomOpenIDConnectAuthTokenHandler(ILog log, IOpenIDConnectConfigurationStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) + { + public CustomOpenIDConnectAuthTokenHandler(ISystemLog log, IOpenIDConnectConfigurationStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) { - + } } } diff --git a/source/Tests/OpenIdConnect/Tokens/CustomOpenIDConnectWithRoleAuthTokenHandler.cs b/source/Tests/OpenIdConnect/Tokens/CustomOpenIDConnectWithRoleAuthTokenHandler.cs index 1d199c0..29bed7a 100644 --- a/source/Tests/OpenIdConnect/Tokens/CustomOpenIDConnectWithRoleAuthTokenHandler.cs +++ b/source/Tests/OpenIdConnect/Tokens/CustomOpenIDConnectWithRoleAuthTokenHandler.cs @@ -7,10 +7,10 @@ namespace Tests.OpenIdConnect.Tokens { public class CustomOpenIDConnectWithRoleAuthTokenHandler : OpenIDConnectAuthTokenWithRolesHandler - { - public CustomOpenIDConnectWithRoleAuthTokenHandler(ILog log, IOpenIDConnectConfigurationWithRoleStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) + { + public CustomOpenIDConnectWithRoleAuthTokenHandler(ISystemLog log, IOpenIDConnectConfigurationWithRoleStore configurationStore, IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer, IKeyRetriever keyRetriever) : base(log, configurationStore, identityProviderConfigDiscoverer, keyRetriever) { - + } } } \ No newline at end of file diff --git a/source/Tests/OpenIdConnect/Tokens/OpenIDConnectAuthTokenHandlerFixture.cs b/source/Tests/OpenIdConnect/Tokens/OpenIDConnectAuthTokenHandlerFixture.cs index 19dacce..aeb2671 100644 --- a/source/Tests/OpenIdConnect/Tokens/OpenIDConnectAuthTokenHandlerFixture.cs +++ b/source/Tests/OpenIdConnect/Tokens/OpenIDConnectAuthTokenHandlerFixture.cs @@ -17,7 +17,7 @@ namespace Tests.OpenIdConnect.Tokens [TestFixture] public class OpenIDConnectAuthTokenHandlerFixture : OpenIDFixtureBase { - ILog log; + ISystemLog log; IOpenIDConnectConfigurationStore configurationStore; IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer; IKeyRetriever keyRetriever; @@ -26,7 +26,7 @@ public class OpenIDConnectAuthTokenHandlerFixture : OpenIDFixtureBase [SetUp] public void SetUp() { - log = Substitute.For(); + log = Substitute.For(); configurationStore = Substitute.For(); identityProviderConfigDiscoverer = Substitute.For(); keyRetriever = Substitute.For(); diff --git a/source/Tests/OpenIdConnect/Tokens/OpenIDConnectWithRolesAuthTokenHandlerFixture.cs b/source/Tests/OpenIdConnect/Tokens/OpenIDConnectWithRolesAuthTokenHandlerFixture.cs index b6cb1e4..d358088 100644 --- a/source/Tests/OpenIdConnect/Tokens/OpenIDConnectWithRolesAuthTokenHandlerFixture.cs +++ b/source/Tests/OpenIdConnect/Tokens/OpenIDConnectWithRolesAuthTokenHandlerFixture.cs @@ -14,7 +14,7 @@ namespace Tests.OpenIdConnect.Tokens [TestFixture] public class OpenIDConnectWithRolesAuthTokenHandlerFixture : OpenIDFixtureBase { - ILog log; + ISystemLog log; IOpenIDConnectConfigurationWithRoleStore configurationStore; IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer; IKeyRetriever keyRetriever; @@ -23,7 +23,7 @@ public class OpenIDConnectWithRolesAuthTokenHandlerFixture : OpenIDFixtureBase [SetUp] public void SetUp() { - log = Substitute.For(); + log = Substitute.For(); configurationStore = Substitute.For(); identityProviderConfigDiscoverer = Substitute.For(); keyRetriever = Substitute.For(); From b966548efad38bc17248a8ad21cd1b59cfd297a6 Mon Sep 17 00:00:00 2001 From: slewis74 Date: Thu, 18 Mar 2021 09:38:56 +1000 Subject: [PATCH 2/2] package updates --- source/Server.AzureAD/Server.AzureAD.csproj | 2 +- source/Server.OctopusID/Server.OctopusID.csproj | 2 +- source/Server.Okta/Server.Okta.csproj | 2 +- .../Server.OpenIDConnect.Common.csproj | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/Server.AzureAD/Server.AzureAD.csproj b/source/Server.AzureAD/Server.AzureAD.csproj index b0b8b59..f2124fc 100644 --- a/source/Server.AzureAD/Server.AzureAD.csproj +++ b/source/Server.AzureAD/Server.AzureAD.csproj @@ -15,7 +15,7 @@ - + diff --git a/source/Server.OctopusID/Server.OctopusID.csproj b/source/Server.OctopusID/Server.OctopusID.csproj index d7701c5..57e6713 100644 --- a/source/Server.OctopusID/Server.OctopusID.csproj +++ b/source/Server.OctopusID/Server.OctopusID.csproj @@ -15,7 +15,7 @@ - + diff --git a/source/Server.Okta/Server.Okta.csproj b/source/Server.Okta/Server.Okta.csproj index 6b0a36f..070a845 100644 --- a/source/Server.Okta/Server.Okta.csproj +++ b/source/Server.Okta/Server.Okta.csproj @@ -15,7 +15,7 @@ - + diff --git a/source/Server.OpenIDConnect.Common/Server.OpenIDConnect.Common.csproj b/source/Server.OpenIDConnect.Common/Server.OpenIDConnect.Common.csproj index f2b820e..37a3913 100644 --- a/source/Server.OpenIDConnect.Common/Server.OpenIDConnect.Common.csproj +++ b/source/Server.OpenIDConnect.Common/Server.OpenIDConnect.Common.csproj @@ -15,8 +15,8 @@ - - + +