[java-identity-provider] branch main updated: Property support for matchExpression.

Scott Cantor cantor.2 at osu.edu
Wed Oct 14 19:23:54 UTC 2020


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

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

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

The following commit(s) were added to refs/heads/main by this push:
       new  a60e05b54 Property support for matchExpression.
a60e05b54 is described below

commit a60e05b54040e4890de248c636f846c2e815c210
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Oct 14 15:23:51 2020 -0400

    Property support for matchExpression.
---
 .../idp/authn/AbstractUsernamePasswordCredentialValidator.java    | 8 ++++++--
 .../net/shibboleth/idp/flows/authn/password-authn-beans.xml       | 2 +-
 idp-conf/src/main/resources/conf/authn/authn.properties           | 1 +
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractUsernamePasswordCredentialValidator.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractUsernamePasswordCredentialValidator.java
index 54c0be397..576b8d53b 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractUsernamePasswordCredentialValidator.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AbstractUsernamePasswordCredentialValidator.java
@@ -168,7 +168,11 @@ public abstract class AbstractUsernamePasswordCredentialValidator extends Abstra
     public void setMatchExpression(@Nullable final Pattern expression) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         
-        matchExpression = expression;
+        if (expression != null && !expression.pattern().isEmpty()) {
+            matchExpression = expression;
+        } else {
+            matchExpression = null;
+        }
     }
     
     /**
@@ -176,7 +180,7 @@ public abstract class AbstractUsernamePasswordCredentialValidator extends Abstra
      * 
      * @param newTransforms collection of replacement transforms
      */
-    public void setTransforms(@Nullable @NonnullElements final Collection<Pair<String, String>> newTransforms) {
+    public void setTransforms(@Nullable @NonnullElements final Collection<Pair<String,String>> newTransforms) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
 
         if (newTransforms != null) {
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/password-authn-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/password-authn-beans.xml
index 77424603f..11f9c1bbd 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/password-authn-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/password-authn-beans.xml
@@ -96,7 +96,7 @@
         p:uppercase="#{getObject('shibboleth.authn.Password.Uppercase') ?: %{idp.authn.Password.uppercase:false}}"
         p:trim="#{getObject('shibboleth.authn.Password.Trim') ?: %{idp.authn.Password.trim:true}}"
         p:transforms="#{getObject('shibboleth.authn.Password.Transforms')}"
-        p:matchExpression="#{getObject('shibboleth.authn.Password.matchExpression')}" />
+        p:matchExpression="#{getObject('shibboleth.authn.Password.matchExpression') ?: '%{idp.authn.Password.matchExpression:}'}" />
 
     <!-- New validator(s) that didn't exist in prior versions. -->
     <bean id="shibboleth.HTPasswdCredentialValidator" parent="shibboleth.CredentialValidator" abstract="true"
diff --git a/idp-conf/src/main/resources/conf/authn/authn.properties b/idp-conf/src/main/resources/conf/authn/authn.properties
index f5f6f451f..e20a466aa 100644
--- a/idp-conf/src/main/resources/conf/authn/authn.properties
+++ b/idp-conf/src/main/resources/conf/authn/authn.properties
@@ -47,6 +47,7 @@
 #idp.authn.Password.trim = true
 #idp.authn.Password.lowercase = false
 #idp.authn.Password.uppercase = false
+#idp.authn.Password.matchExpression = 
 # Override default form field names
 #idp.authn.Password.usernameFieldName = j_username
 #idp.authn.Password.passwordFieldName = j_password

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


More information about the commits mailing list