[java-identity-provider] branch main updated: Module for RemoteUserInternal flow.

Scott Cantor cantor.2 at osu.edu
Tue Sep 8 23:57:02 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=e7d387c27b63414ec80b28112e2b0e279a8358fa

The following commit(s) were added to refs/heads/main by this push:
       new  e7d387c27 Module for RemoteUserInternal flow.
e7d387c27 is described below

commit e7d387c27b63414ec80b28112e2b0e279a8358fa
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Sep 8 19:56:54 2020 -0400

    Module for RemoteUserInternal flow.
---
 .../idp/authn/impl/ExtractRemoteUser.java          | 10 +++---
 .../idp/module/authn/impl/RemoteUserInternal.java  | 41 ++++++++++++++++++++++
 .../services/net.shibboleth.idp.module.IdPModule   |  1 +
 .../authn/remoteuser-internal-authn-beans.xml      | 16 ++++-----
 .../idp/module/authn/impl/module.properties        |  7 ++++
 .../authn/remoteuser-internal-authn-config.xml     |  0
 6 files changed, 62 insertions(+), 13 deletions(-)

diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java
index 9911a72e2..32f128e00 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ExtractRemoteUser.java
@@ -17,11 +17,11 @@
 
 package net.shibboleth.idp.authn.impl;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import javax.servlet.http.HttpServletRequest;
 
 import net.shibboleth.idp.authn.AbstractExtractionAction;
@@ -85,10 +85,10 @@ public class ExtractRemoteUser extends AbstractExtractionAction {
      * 
      * @param attributes    list of request attributes to check
      */
-    public void setCheckAttributes(@Nonnull @NonnullElements final Collection<String> attributes) {
+    public void setCheckAttributes(@Nullable @NonnullElements final Collection<String> attributes) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         
-        checkAttributes = new ArrayList<>(StringSupport.normalizeStringCollection(attributes));
+        checkAttributes = StringSupport.normalizeStringCollection(attributes);
     }
 
     /**
@@ -96,10 +96,10 @@ public class ExtractRemoteUser extends AbstractExtractionAction {
      * 
      * @param headers list of request headers to check
      */
-    public void setCheckHeaders(@Nonnull @NonnullElements final Collection<String> headers) {
+    public void setCheckHeaders(@Nullable @NonnullElements final Collection<String> headers) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         
-        checkHeaders = new ArrayList<>(StringSupport.normalizeStringCollection(headers));
+        checkHeaders = StringSupport.normalizeStringCollection(headers);
     }
     
     /** {@inheritDoc} */
diff --git a/idp-conf-impl/src/main/java/net/shibboleth/idp/module/authn/impl/RemoteUserInternal.java b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/authn/impl/RemoteUserInternal.java
new file mode 100644
index 000000000..e8da29e77
--- /dev/null
+++ b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/authn/impl/RemoteUserInternal.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.authn.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 RemoteUserInternal extends PropertyDrivenIdPModule {
+
+    /**
+     * Constructor.
+     *  
+     * @throws ModuleException on error
+     * @throws IOException on error
+     */
+    public RemoteUserInternal() throws IOException, ModuleException {
+        super(RemoteUserInternal.class);
+    }
+
+}
\ No newline at end of file
diff --git a/idp-conf-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule b/idp-conf-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
index c7dec094c..07dafa495 100644
--- a/idp-conf-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
+++ b/idp-conf-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
@@ -1,2 +1,3 @@
 net.shibboleth.idp.module.authn.impl.Function
 net.shibboleth.idp.module.authn.impl.IPAddress
+net.shibboleth.idp.module.authn.impl.RemoteUserInternal
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/remoteuser-internal-authn-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/remoteuser-internal-authn-beans.xml
index 8f8a72c4d..18475e544 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/remoteuser-internal-authn-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/remoteuser-internal-authn-beans.xml
@@ -18,7 +18,7 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <import resource="%{idp.home}/conf/authn/remoteuser-internal-authn-config.xml" />
+    <import resource="conditional:%{idp.home}/conf/authn/remoteuser-internal-authn-config.xml" />
 
     <bean class="net.shibboleth.ext.spring.util.DeprecatedBeanDetector" c:_1="remoteuser-internal-authn-config.xml">
         <constructor-arg index="0">
@@ -31,13 +31,13 @@
     
     <bean id="ExtractRemoteUser" class="net.shibboleth.idp.authn.impl.ExtractRemoteUser" scope="prototype"
         p:httpServletRequest-ref="shibboleth.HttpServletRequest"
-        p:checkRemoteUser-ref="shibboleth.authn.RemoteUser.checkRemoteUser"
-        p:checkHeaders-ref="shibboleth.authn.RemoteUser.checkHeaders"
-        p:checkAttributes-ref="shibboleth.authn.RemoteUser.checkAttributes"
-        p:lowercase-ref="shibboleth.authn.RemoteUser.Lowercase"
-        p:uppercase-ref="shibboleth.authn.RemoteUser.Uppercase"
-        p:trim-ref="shibboleth.authn.RemoteUser.Trim"
-        p:transforms-ref="shibboleth.authn.RemoteUser.Transforms" />
+        p:checkRemoteUser="#{getObject('shibboleth.authn.RemoteUser.checkRemoteUser') ?: true}"
+        p:checkHeaders="#{getObject('shibboleth.authn.RemoteUser.checkHeaders')}"
+        p:checkAttributes="#{getObject('shibboleth.authn.RemoteUser.checkAttributes')}"
+        p:lowercase="#{getObject('shibboleth.authn.RemoteUser.Lowercase') ?: false}"
+        p:uppercase="#{getObject('shibboleth.authn.RemoteUser.Uppercase') ?: false}"
+        p:trim="#{getObject('shibboleth.authn.RemoteUser.Trim') ?: true}"
+        p:transforms="#{getObject('shibboleth.authn.RemoteUser.Transforms')}" />
         
     <bean id="ValidateRemoteUser" class="net.shibboleth.idp.authn.impl.ValidateRemoteUser" scope="prototype"
         p:matchExpression="#{getObject('shibboleth.authn.RemoteUser.matchExpression')}"
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/authn/impl/module.properties b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/authn/impl/module.properties
index 304db81c1..4ea2daf47 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/authn/impl/module.properties
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/authn/impl/module.properties
@@ -3,6 +3,7 @@
 # Class to Module ID mappings
 net.shibboleth.idp.module.authn.impl.Function.id = idp.authn.Function
 net.shibboleth.idp.module.authn.impl.IPAddress.id = idp.authn.IPAddress
+net.shibboleth.idp.module.authn.impl.RemoteUserInternal.id = idp.authn.RemoteUserInternal
 
 idp.authn.Function.name = Function Authentication
 idp.authn.Function.desc = Authentication flow that produces a result from a function.
@@ -15,3 +16,9 @@ idp.authn.IPAddress.desc = Authentication flow that maps IP Address ranges to su
 idp.authn.IPAddress.url = https://wiki.shibboleth.net/confluence/display/IDP4/IPAddressAuthnConfiguration
 idp.authn.IPAddress.1.src = /net/shibboleth/idp/module/conf/authn/ipaddress-authn-config.xml
 idp.authn.IPAddress.1.dest = conf/authn/ipaddress-authn-config.xml
+
+idp.authn.RemoteUserInternal.name = RemoteUserInternal Authentication
+idp.authn.RemoteUserInternal.desc = Authentication flow for container-based authentication with no redirects.
+idp.authn.RemoteUserInternal.url = https://wiki.shibboleth.net/confluence/display/IDP4/IPAddressAuthnConfiguration
+idp.authn.RemoteUserInternal.1.src = /net/shibboleth/idp/module/conf/authn/remoteuser-internal-authn-config.xml
+idp.authn.RemoteUserInternal.1.dest = conf/authn/remoteuser-internal-authn-config.xml
diff --git a/idp-conf/src/main/resources/conf/authn/remoteuser-internal-authn-config.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/conf/authn/remoteuser-internal-authn-config.xml
similarity index 100%
rename from idp-conf/src/main/resources/conf/authn/remoteuser-internal-authn-config.xml
rename to idp-conf-impl/src/main/resources/net/shibboleth/idp/module/conf/authn/remoteuser-internal-authn-config.xml

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


More information about the commits mailing list