[java-idp-plugin-duo] branch main updated: Remove redundant statement, add annotation

Phil Smart philip.smart at jisc.ac.uk
Wed Mar 10 15:24:05 UTC 2021


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

philsmart pushed a commit to branch main
in repository java-idp-plugin-duo.

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

The following commit(s) were added to refs/heads/main by this push:
       new  2da3fc9   Remove redundant statement, add annotation
2da3fc9 is described below

commit 2da3fc9de2bf853fd17c3d26c042dc48635bd3c8
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Mar 10 15:24:03 2021 +0000

    Remove redundant statement, add annotation
---
 .../shibboleth/idp/plugin/authn/duo/impl/DuoOIDCAuthnController.java | 5 ++++-
 .../idp/plugin/authn/duo/impl/HealthCheckDuoOIDCAuthAPI.java         | 5 -----
 2 files changed, 4 insertions(+), 6 deletions(-)

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 1f08320..7e81cd9 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
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.util.function.Function;
 
 import javax.annotation.Nonnull;
+import javax.annotation.concurrent.GuardedBy;
 import javax.annotation.concurrent.ThreadSafe;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -80,7 +81,8 @@ public class DuoOIDCAuthnController extends AbstractInitializableComponent{
     @Nonnull private final Logger log = LoggerFactory.getLogger(DuoOIDCAuthnController.class);    
     
     /** Lookup strategy to locate the Duo authentication context. */
-    @Nonnull private Function<ProfileRequestContext,DuoOIDCAuthenticationContext> duoContextLookupStrategy;
+    @Nonnull @GuardedBy("this") 
+    private Function<ProfileRequestContext,DuoOIDCAuthenticationContext> duoContextLookupStrategy;
     
     /** Constructor. */
     public DuoOIDCAuthnController() {
@@ -98,6 +100,7 @@ public class DuoOIDCAuthnController extends AbstractInitializableComponent{
             @Nonnull final Function<ProfileRequestContext,DuoOIDCAuthenticationContext> strategy) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        
         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/HealthCheckDuoOIDCAuthAPI.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/HealthCheckDuoOIDCAuthAPI.java
index a368523..60ba42c 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/HealthCheckDuoOIDCAuthAPI.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/HealthCheckDuoOIDCAuthAPI.java
@@ -69,11 +69,6 @@ public class HealthCheckDuoOIDCAuthAPI extends AbstractDuoAuthenticationAction{
             final DuoHealthCheck healthCheckResponse = client.healthCheck();            
             log.trace("{} Duo health check response '{}'",getLogPrefix(),healthCheckResponse);           
             
-            if (healthCheckResponse == null) {
-                //no response.
-                throw new DuoClientException("Duo 2FA is unavailable, null response from the "
-                        + "health check endpoint");                
-            }
             //These checks are redundant if using the Duo WebSDK v4 client as it throws an exception if not 'OK'.
             //They are still included  to be compatible with other implementations which return the full response. 
             if (DuoOIDCAuthAPI.DUO_RESPONSE_STATUS_OK.equalsIgnoreCase(healthCheckResponse.getStatus())) {

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


More information about the commits mailing list