[java-identity-provider] branch master updated: Remove additional redundant null checks.

Scott Cantor cantor.2 at osu.edu
Wed Dec 4 11:25:59 EST 2019


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

scantor pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=55ad4382cde81df505a8ca61d25b71eb0144afad

The following commit(s) were added to refs/heads/master by this push:
       new  55ad438   Remove additional redundant null checks.
55ad438 is described below

commit 55ad4382cde81df505a8ca61d25b71eb0144afad
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Dec 4 11:25:56 2019 -0500

    Remove additional redundant null checks.
---
 .../idp/authn/impl/ValidateCredentials.java          |  7 -------
 .../idp/authn/impl/ValidateFunctionResult.java       | 20 --------------------
 .../idp/authn/impl/ValidateRemoteUser.java           |  8 --------
 .../idp/authn/impl/ValidateUserAgentAddress.java     | 10 +---------
 .../idp/authn/impl/ValidateX509Certificate.java      |  8 --------
 5 files changed, 1 insertion(+), 52 deletions(-)

diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateCredentials.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateCredentials.java
index 4e49ec1..f637670 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateCredentials.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateCredentials.java
@@ -49,7 +49,6 @@ import org.slf4j.LoggerFactory;
  * An action that processes a list of {@link CredentialValidator} objects to produce an {@link AuthenticationResult}.
  *  
  * @event {@link EventIds#PROCEED_EVENT_ID}
- * @event {@link EventIds#INVALID_PROFILE_CTX}
  * @event others on error
  * @pre <pre>ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAttemptedFlow() != null</pre>
  * 
@@ -167,12 +166,6 @@ public class ValidateCredentials extends AbstractValidationAction implements War
             return false;
         }
         
-        if (authenticationContext.getAttemptedFlow() == null) {
-            log.info("{} No attempted flow within authentication context", getLogPrefix());
-            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
-            return false;
-        }
-        
         return true;
     }
 
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateFunctionResult.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateFunctionResult.java
index 745762b..144068d 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateFunctionResult.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateFunctionResult.java
@@ -46,7 +46,6 @@ import org.slf4j.LoggerFactory;
  * {@link net.shibboleth.idp.authn.AuthenticationResult} based on the function result.
  * 
  * @event {@link EventIds#PROCEED_EVENT_ID}
- * @event {@link EventIds#INVALID_PROFILE_CTX}
  * @event {@link AuthnEventIds#INVALID_CREDENTIALS}
  * @event {@link AuthnEventIds#NO_CREDENTIALS}
  * @pre <pre>ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAttemptedFlow() != null</pre>
@@ -99,25 +98,6 @@ public class ValidateFunctionResult extends AbstractValidationAction {
 
     /** {@inheritDoc} */
     @Override
-    protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext,
-            @Nonnull final AuthenticationContext authenticationContext) {
-
-        if (!super.doPreExecute(profileRequestContext, authenticationContext)) {
-            return false;
-        }
-        
-        if (authenticationContext.getAttemptedFlow() == null) {
-            log.debug("{} No attempted flow within authentication context", getLogPrefix());
-            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
-            recordFailure();
-            return false;
-        }
-        
-        return true;
-    }
-    
-    /** {@inheritDoc} */
-    @Override
     protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
             @Nonnull final AuthenticationContext authenticationContext) {
 
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
index 833e61f..53d89b9 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
@@ -50,7 +50,6 @@ import org.slf4j.LoggerFactory;
  * <p>Various optional properties are supported to control the validation process.</p>
  *  
  * @event {@link EventIds#PROCEED_EVENT_ID}
- * @event {@link EventIds#INVALID_PROFILE_CTX}
  * @event {@link AuthnEventIds#INVALID_CREDENTIALS}
  * @event {@link AuthnEventIds#NO_CREDENTIALS}
  * @pre <pre>ProfileRequestContext.getSubcontext(AuthenticationContext.class, false).getAttemptedFlow() != null</pre>
@@ -126,13 +125,6 @@ public class ValidateRemoteUser extends AbstractValidationAction {
             return false;
         }
         
-        if (authenticationContext.getAttemptedFlow() == null) {
-            log.debug("{} No attempted flow within authentication context", getLogPrefix());
-            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
-            recordFailure();
-            return false;
-        }
-        
         usernameContext = authenticationContext.getSubcontext(UsernameContext.class);
         if (usernameContext == null) {
             log.debug("{} No UsernameContext available within authentication context", getLogPrefix());
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java
index e71d332..2591395 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java
@@ -53,7 +53,6 @@ import com.google.common.base.Strings;
  * is within a given range and generates an {@link net.shibboleth.idp.authn.AuthenticationResult}.
  *  
  * @event {@link EventIds#PROCEED_EVENT_ID}
- * @event {@link EventIds#INVALID_PROFILE_CTX}
  * @event {@link AuthnEventIds#NO_CREDENTIALS}
  * @event {@link AuthnEventIds#INVALID_CREDENTIALS}
  * @pre <pre>ProfileRequestContext.getSubcontext(AuthenticationContext.class, false).getAttemptedFlow() != null</pre>
@@ -108,14 +107,7 @@ public class ValidateUserAgentAddress extends AbstractValidationAction {
         if (!super.doPreExecute(profileRequestContext, authenticationContext)) {
             return false;
         }
-        
-        if (authenticationContext.getAttemptedFlow() == null) {
-            log.debug("{} No attempted flow within authentication context", getLogPrefix());
-            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
-            recordFailure();
-            return false;
-        }
-        
+
         uaContext = authenticationContext.getSubcontext(UserAgentContext.class, false);
         if (uaContext == null) {
             log.debug("{} No UserAgentContext available within authentication context", getLogPrefix());
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateX509Certificate.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateX509Certificate.java
index b7eb4f3..ce173a2 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateX509Certificate.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateX509Certificate.java
@@ -48,7 +48,6 @@ import org.slf4j.LoggerFactory;
  * optionally validating the certificate(s) against a {@link TrustEngine}.
  *  
  * @event {@link EventIds#PROCEED_EVENT_ID}
- * @event {@link EventIds#INVALID_PROFILE_CTX}
  * @event {@link AuthnEventIds#INVALID_CREDENTIALS}
  * @event {@link AuthnEventIds#NO_CREDENTIALS}
  * @pre <pre>ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAttemptedFlow() != null</pre>
@@ -97,13 +96,6 @@ public class ValidateX509Certificate extends AbstractValidationAction {
             return false;
         }
         
-        if (authenticationContext.getAttemptedFlow() == null) {
-            log.info("{} No attempted flow within authentication context", getLogPrefix());
-            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
-            recordFailure();
-            return false;
-        }
-        
         certContext = authenticationContext.getSubcontext(CertificateContext.class);
         if (certContext == null) {
             log.info("{} No CertificateContext available within authentication context", getLogPrefix());

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


More information about the commits mailing list