[java-idp-plugin-duo] 02/02: Replace ComponentSupport with corresponding methods from parent class

Phil Smart philip.smart at jisc.ac.uk
Tue Jul 4 13:51:57 UTC 2023


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch dev/JDUO-71
in repository java-idp-plugin-duo.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-duo.git;a=commit;h=3d284ac9f1d33e502cae6fbd66bf85e354a37463

commit 3d284ac9f1d33e502cae6fbd66bf85e354a37463
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Jul 4 14:50:33 2023 +0100

    Replace ComponentSupport with corresponding methods from parent class
---
 .../authn/duo/AbstractDuoAuthenticationAction.java |  5 ++--
 .../authn/duo/DefaultDuoOIDCIntegration.java       | 28 ++++++++++++++--------
 .../plugin/authn/duo/SimpleDuoOIDCIntegration.java | 25 ++++++++++++-------
 .../duo/impl/DefaultDuoOIDCClientRegistry.java     |  5 ++--
 .../authn/duo/impl/DuoOIDCAuthnController.java     |  5 ++--
 .../duo/impl/PopulateDuoAuthenticationContext.java | 21 ++++++++--------
 .../impl/ValidateDuoTokenAuthenticationResult.java |  5 ++--
 .../plugin/authn/duo/impl/ValidateTokenClaims.java |  9 ++++---
 .../authn/duo/impl/ValidateTokenSignature.java     |  5 ++--
 .../authn/duo/nimbus/impl/NimbusClientFactory.java | 13 +++++-----
 .../authn/duo/sdk/impl/DuoSDKClientFactory.java    |  8 +++----
 11 files changed, 68 insertions(+), 61 deletions(-)

diff --git a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/AbstractDuoAuthenticationAction.java b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/AbstractDuoAuthenticationAction.java
index 489f359..9709e3f 100644
--- a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/AbstractDuoAuthenticationAction.java
+++ b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/AbstractDuoAuthenticationAction.java
@@ -33,7 +33,6 @@ import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.plugin.authn.duo.context.DuoOIDCAuthenticationContext;
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.logic.Constraint;
 
 /**
@@ -77,8 +76,8 @@ public abstract class AbstractDuoAuthenticationAction extends AbstractAuthentica
      */
     public void setDuoContextLookupStrategy(
             @Nonnull final Function<ProfileRequestContext,DuoOIDCAuthenticationContext> strategy) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
 
         duoContextLookupStrategy = Constraint.isNotNull(strategy, "DuoContextLookuplookup strategy cannot be null");
     }
diff --git a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DefaultDuoOIDCIntegration.java b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DefaultDuoOIDCIntegration.java
index 362f763..0e6ced1 100644
--- a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DefaultDuoOIDCIntegration.java
+++ b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/DefaultDuoOIDCIntegration.java
@@ -39,7 +39,6 @@ import net.shibboleth.shared.annotation.constraint.NotLive;
 import net.shibboleth.shared.annotation.constraint.Unmodifiable;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.primitive.StringSupport;
 
@@ -101,7 +100,8 @@ public final class DefaultDuoOIDCIntegration
      * @param hosts the hostnames to allow.
      */
     public synchronized void setAllowedOrigins(@Nullable @NonnullElements final Collection<String> hosts) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         allowedOrigins = Set.copyOf(StringSupport.normalizeStringCollection(
                 Constraint.isNotNull(hosts, "Types cannot be null")));
@@ -124,7 +124,8 @@ public final class DefaultDuoOIDCIntegration
      * @param host API host
      */
     public synchronized void setAPIHost(@Nonnull @NotEmpty final String host) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         apiHost = Constraint.isNotNull(StringSupport.trimOrNull(host), "API host cannot be null or empty");
     }
@@ -140,7 +141,8 @@ public final class DefaultDuoOIDCIntegration
      * @param endpoint the endpoint.
      */
     public synchronized void setHealthCheckEndpoint(@Nonnull @NotEmpty final String endpoint) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         healthEndpoint = Constraint.isNotNull(StringSupport.trimOrNull(endpoint), 
                 "Health check endpoint cannot be null or empty");
@@ -157,7 +159,8 @@ public final class DefaultDuoOIDCIntegration
      * @param endpoint the endpoint.
      */
     public synchronized void setAuthorizeEndpoint(@Nonnull @NotEmpty final String endpoint) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         authorizeEndpoint = Constraint.isNotNull(StringSupport.trimOrNull(endpoint), 
                 "Authorize endpoint cannot be null or empty");
@@ -174,7 +177,8 @@ public final class DefaultDuoOIDCIntegration
      * @param endpoint the endpoint.
      */
     public synchronized void setTokenEndpoint(@Nonnull @NotEmpty final String endpoint) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         tokenEndpoint = Constraint.isNotNull(StringSupport.trimOrNull(endpoint), 
                 "Token endpoint cannot be null or empty");
@@ -191,7 +195,8 @@ public final class DefaultDuoOIDCIntegration
      * @param uri the redirect_uri
      */
     public synchronized void setRegisteredRedirectURI(@Nullable final String uri) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
        
         registeredRedirectURI = StringSupport.trimOrNull(uri);
     }
@@ -226,7 +231,8 @@ public final class DefaultDuoOIDCIntegration
      * @param id the client identifier.
      */
     public synchronized void setClientId(@Nonnull @NotEmpty final String id) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         clientId = Constraint.isNotNull(StringSupport.trimOrNull(id), "ClientID cannot be null or empty");
     }
@@ -242,7 +248,8 @@ public final class DefaultDuoOIDCIntegration
      * @param key secret key
      */
     public synchronized void setSecretKey(@Nonnull @NotEmpty final String key) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         secretKey = Constraint.isNotNull(StringSupport.trimOrNull(key), "Secret key cannot be null or empty");
     }
@@ -270,7 +277,8 @@ public final class DefaultDuoOIDCIntegration
      */
     public synchronized <T extends Principal> void setSupportedPrincipals(
             @Nullable @NonnullElements final Collection<T> principals) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         supportedPrincipals.getPrincipals().clear();
         
diff --git a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/SimpleDuoOIDCIntegration.java b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/SimpleDuoOIDCIntegration.java
index fb11a80..405adcd 100644
--- a/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/SimpleDuoOIDCIntegration.java
+++ b/idp-duo-api/src/main/java/net/shibboleth/idp/plugin/authn/duo/SimpleDuoOIDCIntegration.java
@@ -37,7 +37,6 @@ import net.shibboleth.shared.annotation.constraint.NotEmpty;
 import net.shibboleth.shared.annotation.constraint.Unmodifiable;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.primitive.StringSupport;
 
@@ -94,7 +93,8 @@ public final class SimpleDuoOIDCIntegration
      * @param host API host
      */
     public synchronized void setAPIHost(@Nonnull @NotEmpty final String host) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         apiHost = Constraint.isNotNull(StringSupport.trimOrNull(host), "API host cannot be null or empty");
     }
@@ -110,7 +110,8 @@ public final class SimpleDuoOIDCIntegration
      * @param endpoint the endpoint.
      */
     public synchronized void setHealthCheckEndpoint(@Nonnull @NotEmpty final String endpoint) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         healthEndpoint = Constraint.isNotNull(StringSupport.trimOrNull(endpoint), 
                 "Health check endpoint cannot be null or empty");
@@ -127,7 +128,8 @@ public final class SimpleDuoOIDCIntegration
      * @param endpoint the endpoint.
      */
     public synchronized void setAuthorizeEndpoint(@Nonnull @NotEmpty final String endpoint) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         authorizeEndpoint = Constraint.isNotNull(StringSupport.trimOrNull(endpoint), 
                 "Authorize endpoint cannot be null or empty");
@@ -144,7 +146,8 @@ public final class SimpleDuoOIDCIntegration
      * @param endpoint the endpoint.
      */
     public synchronized void setTokenEndpoint(@Nonnull @NotEmpty final String endpoint) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         tokenEndpoint = Constraint.isNotNull(StringSupport.trimOrNull(endpoint), 
                 "Token endpoint cannot be null or empty");
@@ -161,7 +164,8 @@ public final class SimpleDuoOIDCIntegration
      * @param url the url.
      */
     public synchronized void setRedirectURI(@Nonnull final String url) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         redirectURI = Constraint.isNotNull(StringSupport.trimOrNull(url), "Redirect URI cannot be null or empty");;
     }
@@ -173,7 +177,8 @@ public final class SimpleDuoOIDCIntegration
      * @param id the client identifier.
      */
     public synchronized void setClientId(@Nonnull @NotEmpty final String id) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         clientId = Constraint.isNotNull(StringSupport.trimOrNull(id), "ClientID cannot be null or empty");
     }
@@ -189,7 +194,8 @@ public final class SimpleDuoOIDCIntegration
      * @param key secret key
      */
     public synchronized void setSecretKey(@Nonnull @NotEmpty final String key) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         secretKey = Constraint.isNotNull(StringSupport.trimOrNull(key), "Secret key cannot be null or empty");
     }
@@ -217,7 +223,8 @@ public final class SimpleDuoOIDCIntegration
      */
     public synchronized <T extends Principal> void setSupportedPrincipals(
             @Nullable @NonnullElements final Collection<T> principals) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         supportedPrincipals.getPrincipals().clear();
         
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DefaultDuoOIDCClientRegistry.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DefaultDuoOIDCClientRegistry.java
index 27e3039..ff6b452 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DefaultDuoOIDCClientRegistry.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DefaultDuoOIDCClientRegistry.java
@@ -42,7 +42,6 @@ import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.annotation.constraint.NonnullElements;
 import net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.logic.Constraint;
 
 /**
@@ -95,8 +94,8 @@ public class DefaultDuoOIDCClientRegistry extends AbstractIdentifiableInitializa
      * @param factory the factory.
      */
     public synchronized void setClientFactory(@Nonnull final DuoOIDCClientFactory factory) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         clientFactory = Constraint.isNotNull(factory, "Duo client factory can not be null");
     }
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoOIDCAuthnController.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoOIDCAuthnController.java
index 2a1ba07..4b16c5f 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoOIDCAuthnController.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoOIDCAuthnController.java
@@ -45,7 +45,6 @@ import net.shibboleth.idp.plugin.authn.duo.DuoOIDCClient;
 import net.shibboleth.idp.plugin.authn.duo.context.DuoOIDCAuthenticationContext;
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.logic.Constraint;
 
 
@@ -92,8 +91,8 @@ public class DuoOIDCAuthnController extends AbstractInitializableComponent{
      */
     public synchronized void setDuoContextLookupStrategy(
             @Nonnull final Function<ProfileRequestContext,DuoOIDCAuthenticationContext> strategy) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         duoContextLookupStrategy = Constraint.isNotNull(strategy, "DuoContext lookup strategy cannot be null");
     }
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/PopulateDuoAuthenticationContext.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/PopulateDuoAuthenticationContext.java
index c25a858..0cf12e9 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/PopulateDuoAuthenticationContext.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/PopulateDuoAuthenticationContext.java
@@ -43,7 +43,6 @@ import net.shibboleth.idp.plugin.authn.duo.context.DuoOIDCAuthenticationContext;
 import net.shibboleth.idp.session.context.navigate.CanonicalUsernameLookupStrategy;
 import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.utilities.java.support.logic.FunctionSupport;
 
@@ -101,8 +100,8 @@ public class PopulateDuoAuthenticationContext extends AbstractAuthenticationActi
      * @param duoRegistry the registry
      */
     public void setClientRegistry(@Nonnull final DuoOIDCClientRegistry duoRegistry) { 
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         clientRegistry = Constraint.isNotNull(duoRegistry,"DuoClient registry can not be null");
     }
@@ -114,8 +113,8 @@ public class PopulateDuoAuthenticationContext extends AbstractAuthenticationActi
      */
     public void setUsernameLookupStrategy(
             @Nonnull final Function<ProfileRequestContext, String> strategy) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
 
         usernameLookupStrategy = Constraint.isNotNull(strategy, "Username lookup strategy cannot be null");
     }
@@ -128,8 +127,8 @@ public class PopulateDuoAuthenticationContext extends AbstractAuthenticationActi
      */
     public void setRedirectURICreationStrategy(
             @Nonnull final BiFunction<HttpServletRequest, DynamicDuoOIDCIntegration, String> strategy) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         redirectURICreationStrategy =  Constraint.isNotNull(strategy, "RedirectURI"
                 + " creation strategy cannot be null");
@@ -142,8 +141,8 @@ public class PopulateDuoAuthenticationContext extends AbstractAuthenticationActi
      */
     public void setDuoContextCreationStrategy(
             @Nonnull final Function<ProfileRequestContext,DuoOIDCAuthenticationContext> strategy) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
 
         duoAuthContextCreationStrategy = Constraint.isNotNull(strategy, "DuoAuthenticationContext"
                 + " creation strategy cannot be null");
@@ -156,8 +155,8 @@ public class PopulateDuoAuthenticationContext extends AbstractAuthenticationActi
      */
     public void setDuoIntegrationLookupStrategy(
             @Nonnull final Function<ProfileRequestContext, DuoOIDCIntegration> strategy) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
 
         duoIntegrationLookupStrategy = Constraint.isNotNull(strategy, "DuoIntegration lookup strategy cannot be null");
     }
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoTokenAuthenticationResult.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoTokenAuthenticationResult.java
index 4c6e1e9..2a3507f 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoTokenAuthenticationResult.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateDuoTokenAuthenticationResult.java
@@ -47,7 +47,6 @@ import net.shibboleth.idp.plugin.authn.duo.DuoException;
 import net.shibboleth.idp.plugin.authn.duo.DuoOIDCAuthAPI;
 import net.shibboleth.idp.plugin.authn.duo.context.DuoOIDCAuthenticationContext;
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.component.ComponentSupport;
 
 /**
  * A validation action that checks for a valid Duo authentication token and directly produces an
@@ -103,8 +102,8 @@ public class ValidateDuoTokenAuthenticationResult extends AbstractAuditingValida
      */
     public void setContextToPrincipalMappingStrategy(@Nullable final 
             Function<ProfileRequestContext,Collection<Principal>> hook) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         contextToPrincipalMappingStrategy = hook;
     }
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateTokenClaims.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateTokenClaims.java
index 81bbc17..7494a25 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateTokenClaims.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateTokenClaims.java
@@ -40,7 +40,6 @@ import net.shibboleth.oidc.jwt.claims.ClaimsValidator;
 import net.shibboleth.oidc.jwt.claims.JWTValidationException;
 import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.logic.Constraint;
 
 /**
@@ -105,8 +104,8 @@ public class ValidateTokenClaims extends AbstractDuoAuthenticationAction {
      * 
      */
     public void setCleanupHook(@Nullable final Consumer<ProfileRequestContext> hook) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         cleanupHook = hook;
     }
@@ -118,8 +117,8 @@ public class ValidateTokenClaims extends AbstractDuoAuthenticationAction {
      */
     public void setClaimsValidator(
             @Nonnull final ClaimsValidator validator) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         claimsValidator = Constraint.isNotNull(validator, "Claims validator cannot be null");
     }
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateTokenSignature.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateTokenSignature.java
index 3533273..8342fcd 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateTokenSignature.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/ValidateTokenSignature.java
@@ -44,7 +44,6 @@ import net.shibboleth.idp.plugin.authn.duo.context.DuoOIDCAuthenticationContext;
 import net.shibboleth.oidc.security.JWSAssemblyUtils;
 import net.shibboleth.oidc.security.credential.BasicJWKCredential;
 import net.shibboleth.oidc.security.impl.JWTSignatureValidationUtil;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.logic.ConstraintViolationException;
 
@@ -105,8 +104,8 @@ public class ValidateTokenSignature extends AbstractDuoAuthenticationAction {
      * @param algo the JWS signature algorithm.
      */
     public void setSignatureAlgorithm(@Nonnull final JWSAlgorithm algo) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         
         Constraint.isNotNull(algo, "Signature algorithm can not be null");
         
diff --git a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientFactory.java b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientFactory.java
index 21bb59c..0aead00 100644
--- a/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientFactory.java
+++ b/idp-duo-nimbus-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/nimbus/impl/NimbusClientFactory.java
@@ -34,7 +34,6 @@ import net.shibboleth.idp.plugin.authn.duo.DuoOIDCIntegration;
 import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.ComponentSupport;
 import net.shibboleth.shared.logic.Constraint;
 
 /**
@@ -110,8 +109,8 @@ public final class NimbusClientFactory extends AbstractInitializableComponent im
      * @param client the http client.
      */
     public synchronized void setHttpClient(@Nonnull final HttpClient client) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
 
         httpClient = Constraint.isNotNull(client, "HTTP client cannot be null");
     }
@@ -122,8 +121,8 @@ public final class NimbusClientFactory extends AbstractInitializableComponent im
      * @param params the new client security parameters
      */
     public synchronized void setHttpClientSecurityParameters(@Nullable final HttpClientSecurityParameters params) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
 
         httpClientSecurityParameters = params;
     }
@@ -134,8 +133,8 @@ public final class NimbusClientFactory extends AbstractInitializableComponent im
      * @param mapper object mapper
      */
     public synchronized void setObjectMapper(@Nonnull final ObjectMapper mapper) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
 
         objectMapper = Constraint.isNotNull(mapper, "Object mapper cannot be null");
     }
diff --git a/idp-duo-sdk-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientFactory.java b/idp-duo-sdk-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientFactory.java
index be575b1..49ca469 100644
--- a/idp-duo-sdk-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientFactory.java
+++ b/idp-duo-sdk-client-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/sdk/impl/DuoSDKClientFactory.java
@@ -34,8 +34,8 @@ import net.shibboleth.idp.plugin.authn.duo.DuoOIDCIntegration;
 import net.shibboleth.shared.annotation.constraint.NonnullElements;
 import net.shibboleth.shared.annotation.constraint.Unmodifiable;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
-import net.shibboleth.shared.component.ComponentSupport;
-import net.shibboleth.utilities.java.support.primitive.StringSupport;
+import net.shibboleth.shared.primitive.StringSupport;
+
 
 
 /** Abstract factory implementation for the {@link DuoSDKClientAdaptor}. */
@@ -55,8 +55,8 @@ public final class DuoSDKClientFactory extends AbstractInitializableComponent im
      * @param certs the list of certificate pins.
      */
     public synchronized void setCaCerts(@Nullable final List<String> certs) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        ifInitializedThrowUnmodifiabledComponentException();
+        ifDestroyedThrowDestroyedComponentException();
         //check if null, as the native duo client uses the internal defaults if null
         //but will respect an empty list.
         if (certs != null) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list