[java-identity-provider] branch main updated: IDP-1642 - Migrate configuration into jars where feasible

Scott Cantor cantor.2 at osu.edu
Tue Sep 22 17:56:09 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=8f7d0b415972a85187435ac780bc51ad7f5b7820

The following commit(s) were added to refs/heads/main by this push:
       new  8f7d0b415 IDP-1642 - Migrate configuration into jars where feasible
8f7d0b415 is described below

commit 8f7d0b415972a85187435ac780bc51ad7f5b7820
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Sep 22 13:56:06 2020 -0400

    IDP-1642 - Migrate configuration into jars where feasible
    
    https://issues.shibboleth.net/jira/browse/IDP-1642
    
    Convert warning interceptor flows into modules.
---
 .../module/intercept/impl/ExpiringPassword.java    | 41 ++++++++++++++++++++++
 .../idp/module/intercept/impl/Warning.java         | 41 ++++++++++++++++++++++
 .../idp/module/intercept/impl/package-info.java    | 22 ++++++++++++
 .../flows/intercept/expiring-password-beans.xml    | 11 ++++--
 .../idp/flows/intercept/warning-beans.xml          | 10 ++++--
 .../expiring-password-intercept-config.xml         |  3 --
 .../conf/intercept/warning-intercept-config.xml    |  3 --
 .../idp/module/intercept/impl/module.properties    | 19 ++++++++++
 .../module}/views/intercept/expiring-password.vm   |  0
 9 files changed, 140 insertions(+), 10 deletions(-)

diff --git a/idp-conf-impl/src/main/java/net/shibboleth/idp/module/intercept/impl/ExpiringPassword.java b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/intercept/impl/ExpiringPassword.java
new file mode 100644
index 000000000..d17d01a83
--- /dev/null
+++ b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/intercept/impl/ExpiringPassword.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.idp.module.intercept.impl;
+
+import java.io.IOException;
+
+import net.shibboleth.idp.module.IdPModule;
+import net.shibboleth.idp.module.ModuleException;
+import net.shibboleth.idp.module.PropertyDrivenIdPModule;
+
+/**
+ * {@link IdPModule} implementation.
+ */
+public final class ExpiringPassword extends PropertyDrivenIdPModule {
+
+    /**
+     * Constructor.
+     *  
+     * @throws ModuleException on error
+     * @throws IOException on error
+     */
+    public ExpiringPassword() throws IOException, ModuleException {
+        super(ExpiringPassword.class);
+    }
+
+}
\ No newline at end of file
diff --git a/idp-conf-impl/src/main/java/net/shibboleth/idp/module/intercept/impl/Warning.java b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/intercept/impl/Warning.java
new file mode 100644
index 000000000..d217e2e46
--- /dev/null
+++ b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/intercept/impl/Warning.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.idp.module.intercept.impl;
+
+import java.io.IOException;
+
+import net.shibboleth.idp.module.IdPModule;
+import net.shibboleth.idp.module.ModuleException;
+import net.shibboleth.idp.module.PropertyDrivenIdPModule;
+
+/**
+ * {@link IdPModule} implementation.
+ */
+public final class Warning extends PropertyDrivenIdPModule {
+
+    /**
+     * Constructor.
+     *  
+     * @throws ModuleException on error
+     * @throws IOException on error
+     */
+    public Warning() throws IOException, ModuleException {
+        super(Warning.class);
+    }
+
+}
\ No newline at end of file
diff --git a/idp-conf-impl/src/main/java/net/shibboleth/idp/module/intercept/impl/package-info.java b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/intercept/impl/package-info.java
new file mode 100644
index 000000000..7bb4446b6
--- /dev/null
+++ b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/intercept/impl/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Interceptor modules.
+ */
+
+package net.shibboleth.idp.module.intercept.impl;
\ No newline at end of file
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/expiring-password-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/expiring-password-beans.xml
index 4a0868c29..2d237eeae 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/expiring-password-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/expiring-password-beans.xml
@@ -18,12 +18,19 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <import resource="%{idp.home}/conf/intercept/expiring-password-intercept-config.xml" />
+    <!-- Name of cookie to track when user was last notified. -->
+    <bean id="shibboleth.expiring-password.NotifyCookieName" class="java.lang.String" c:_0="shib_idp_exp_pwd" />
+
+    <!-- Default beans for override via config. -->
+    <bean id="shibboleth.expiring-password.NotifyInterval" class="java.lang.Long" c:_0="28800000" />
+    <bean id="shibboleth.expiring-password.Condition" parent="shibboleth.Conditions.TRUE" />
+
+    <import resource="conditional:%{idp.home}/conf/intercept/expiring-password-intercept-config.xml" />
 
     <!-- Simplifies flow definition expressions. -->
     <alias name="shibboleth.expiring-password.Condition" alias="ExpiringPasswordPredicate"/>
-    <alias name="shibboleth.PersistentCookieManager" alias="ExpiringPasswordCookieManager" />
     <alias name="shibboleth.expiring-password.NotifyCookieName" alias="ExpiringPasswordCookieName" />
     <alias name="shibboleth.expiring-password.NotifyInterval" alias="ExpiringPasswordNotifyInterval" />
+    <alias name="shibboleth.PersistentCookieManager" alias="ExpiringPasswordCookieManager" />
     
 </beans>
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/warning-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/warning-beans.xml
index aa99966b3..60be357b4 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/warning-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/intercept/warning-beans.xml
@@ -18,11 +18,17 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <import resource="%{idp.home}/conf/intercept/warning-intercept-config.xml" />
+    <!-- Empty map to override in config file. -->
+    <util:map id="shibboleth.warning.ConditionMap" />
+
+    <!-- Prefix of cookie name to track when user was last warned. -->
+    <bean id="shibboleth.warning.NotifyCookiePrefix" class="java.lang.String" c:_0="shib_idp_warn_" />
+
+    <import resource="conditional:%{idp.home}/conf/intercept/warning-intercept-config.xml" />
 
     <!-- Simplifies flow definition expressions. -->
     <alias name="shibboleth.warning.ConditionMap" alias="WarningConditionMap" />
-    <alias name="shibboleth.PersistentCookieManager" alias="WarningCookieManager" />
     <alias name="shibboleth.warning.NotifyCookiePrefix" alias="WarningCookiePrefix" />
+    <alias name="shibboleth.PersistentCookieManager" alias="WarningCookieManager" />
     
 </beans>
diff --git a/idp-conf/src/main/resources/conf/intercept/expiring-password-intercept-config.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/conf/intercept/expiring-password-intercept-config.xml
similarity index 90%
rename from idp-conf/src/main/resources/conf/intercept/expiring-password-intercept-config.xml
rename to idp-conf-impl/src/main/resources/net/shibboleth/idp/module/conf/intercept/expiring-password-intercept-config.xml
index 925d0e6e2..55a58dae9 100644
--- a/idp-conf/src/main/resources/conf/intercept/expiring-password-intercept-config.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/conf/intercept/expiring-password-intercept-config.xml
@@ -22,9 +22,6 @@
             c:attribute="passwordExpiration" c:formatString="yyyyMMddHHmmssX"
             p:resultIfMissing="true" p:offset="-P14D" />
     
-    <!-- Name of cookie to track when user was last notified. -->
-    <bean id="shibboleth.expiring-password.NotifyCookieName" class="java.lang.String" c:_0="shib_idp_exp_pwd" />
-
     <!-- Interval (milliseconds) between notifications, default is 8 hours. -->
     <bean id="shibboleth.expiring-password.NotifyInterval" class="java.lang.Long" c:_0="28800000" />
     
diff --git a/idp-conf/src/main/resources/conf/intercept/warning-intercept-config.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/conf/intercept/warning-intercept-config.xml
similarity index 92%
rename from idp-conf/src/main/resources/conf/intercept/warning-intercept-config.xml
rename to idp-conf-impl/src/main/resources/net/shibboleth/idp/module/conf/intercept/warning-intercept-config.xml
index 86cf57f92..e078e5f86 100644
--- a/idp-conf/src/main/resources/conf/intercept/warning-intercept-config.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/conf/intercept/warning-intercept-config.xml
@@ -42,8 +42,5 @@
         </entry>
         -->
     </util:map>
-
-    <!-- Prefix of cookie name to track when user was last warned. -->
-    <bean id="shibboleth.warning.NotifyCookiePrefix" class="java.lang.String" c:_0="shib_idp_warn_" />
     
 </beans>
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/intercept/impl/module.properties b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/intercept/impl/module.properties
new file mode 100644
index 000000000..c2a43eb9b
--- /dev/null
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/intercept/impl/module.properties
@@ -0,0 +1,19 @@
+# Properties defining interceptor modules
+
+# Class to Module ID mappings
+net.shibboleth.idp.module.intercept.impl.ExpiringPassword = idp.intercept.ExpiringPassword
+net.shibboleth.idp.module.intercept.impl.Warning = idp.intercept.Warning
+
+idp.intercept.ExpiringPassword.name = Expiring Password Interceptor
+idp.intercept.ExpiringPassword.desc = Interceptor flow for warning about an expired password
+idp.intercept.ExpiringPassword.url = https://wiki.shibboleth.net/confluence/display/IDP4/ExpiringPasswordInterceptConfiguration
+idp.intercept.ExpiringPassword.1.src = /net/shibboleth/idp/module/conf/intercept/expiring-password-intercept-config.xml
+idp.intercept.ExpiringPassword.1.dest = conf/intercept/expiring-password-intercept-config.xml
+idp.intercept.ExpiringPassword.2.src = /net/shibboleth/idp/module/views/intercept/expiring-password.vm
+idp.intercept.ExpiringPassword.2.dest = views/intercept/expiring-password.vm
+
+idp.intercept.Warning.name = Warning Interceptor
+idp.intercept.Warning.desc = Interceptor flow for generic warning conditions
+idp.intercept.Warning.url = https://wiki.shibboleth.net/confluence/display/IDP4/WarningInterceptConfiguration
+idp.intercept.Warning.1.src = /net/shibboleth/idp/module/conf/intercept/warning-intercept-config.xml
+idp.intercept.Warning.1.dest = conf/intercept/warning-intercept-config.xml
diff --git a/idp-conf/src/main/resources/views/intercept/expiring-password.vm b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/views/intercept/expiring-password.vm
similarity index 100%
rename from idp-conf/src/main/resources/views/intercept/expiring-password.vm
rename to idp-conf-impl/src/main/resources/net/shibboleth/idp/module/views/intercept/expiring-password.vm

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


More information about the commits mailing list