[java-identity-provider COMMIT] in /trunk/idp-authn-impl/src: main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUs...

noreply at shibboleth.net noreply at shibboleth.net
Thu Aug 1 17:27:32 EDT 2013


Author: scantor
Date: Thu Aug  1 17:27:32 2013
New Revision: 4647

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4647&view=rev
Log:
IDP-112: validation of REMOTE_USER and unit test

Added:
    trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateRemoteUserTest.java   (with props)
Modified:
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromFormRequest.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InitializeAuthenticationContext.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SendHTTPBasicAuthChallenge.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateRemoteUser.java
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java?rev=4647&r1=4646&r2=4647&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java Thu Aug  1 17:27:32 2013
@@ -30,6 +30,7 @@
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
+import net.shibboleth.utilities.java.support.component.ComponentSupport;
 
 import org.opensaml.profile.action.ActionSupport;
 import org.opensaml.profile.context.ProfileRequestContext;
@@ -86,6 +87,8 @@
      * @param flag value to set  
      */
     void setCheckRemoteUser(boolean flag) {
+        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        
         checkRemoteUser = flag;
     }
     
@@ -104,6 +107,8 @@
      * @param attributes    list of request attributes to check
      */
     void setCheckAttributes(List<String> attributes) {
+        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        
         checkAttributes = ImmutableList.copyOf(Collections2.filter(attributes, Predicates.notNull()));
     }
     
@@ -122,6 +127,8 @@
      * @param headers list of request headers to check
      */
     void setCheckHeaders(List<String> headers) {
+        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        
         checkHeaders = ImmutableList.copyOf(Collections2.filter(headers, Predicates.notNull()));
     }
     

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromFormRequest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromFormRequest.java?rev=4647&r1=4646&r2=4647&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromFormRequest.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractUsernamePasswordFromFormRequest.java Thu Aug  1 17:27:32 2013
@@ -26,6 +26,7 @@
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.context.UsernamePasswordContext;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
@@ -76,6 +77,8 @@
      * @param fieldName the username parameter name
      */
     public void setUsernameFieldName(@Nonnull @NotEmpty final String fieldName) {
+        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        
         usernameFieldName = Constraint.isNotNull(
                 StringSupport.trimOrNull(fieldName), "Username field name cannot be null or empty.");
     }
@@ -95,6 +98,8 @@
      * @param fieldName the password parameter name
      */
     public void setPasswordFieldName(@Nonnull @NotEmpty final String fieldName) {
+        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+        
         passwordFieldName = Constraint.isNotNull(
                 StringSupport.trimOrNull(fieldName), "Password field name cannot be null or empty.");
     }

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InitializeAuthenticationContext.java

[... 300 lines stripped ...]


More information about the commits mailing list