[java-identity-provider] branch master updated: Parallel lookup function for SAMLMetadataContext via MessageContext
Scott Cantor
cantor.2 at osu.edu
Sun Sep 30 13:35:01 EDT 2018
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=8e34ff6d2a366041121e7ffebe4a9e63781baec6
The following commit(s) were added to refs/heads/master by this push:
new 8e34ff6 Parallel lookup function for SAMLMetadataContext via MessageContext
8e34ff6 is described below
commit 8e34ff6d2a366041121e7ffebe4a9e63781baec6
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Sun Sep 30 13:34:43 2018 -0400
Parallel lookup function for SAMLMetadataContext via MessageContext
---
.../system/conf/relying-party-mddriven.xml | 13 +-----
.../SAMLMetadataContextLookupFunction.java | 53 ++++++++++++++++++++++
.../context/navigate/messaging/package-info.java | 22 +++++++++
3 files changed, 76 insertions(+), 12 deletions(-)
diff --git a/idp-conf/src/main/resources/system/conf/relying-party-mddriven.xml b/idp-conf/src/main/resources/system/conf/relying-party-mddriven.xml
index 2727a25..cf2ec28 100644
--- a/idp-conf/src/main/resources/system/conf/relying-party-mddriven.xml
+++ b/idp-conf/src/main/resources/system/conf/relying-party-mddriven.xml
@@ -102,18 +102,7 @@
<bean class="org.opensaml.saml.common.messaging.context.navigate.EntityDescriptorLookupFunction" />
</constructor-arg>
<constructor-arg name="f">
- <bean class="net.shibboleth.idp.saml.profile.context.navigate.SAMLMetadataContextLookupFunction">
- <property name="relyingPartyContextLookupStrategy">
- <bean class="com.google.common.base.Functions" factory-method="compose">
- <constructor-arg name="g">
- <ref bean="shibboleth.ChildLookup.RelyingParty" />
- </constructor-arg>
- <constructor-arg name="f">
- <ref bean="SOAPClient.OperationContextLookup" />
- </constructor-arg>
- </bean>
- </property>
- </bean>
+ <bean class="net.shibboleth.idp.saml.profile.context.navigate.messaging.SAMLMetadataContextLookupFunction" />
</constructor-arg>
</bean>
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/messaging/SAMLMetadataContextLookupFunction.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/messaging/SAMLMetadataContextLookupFunction.java
new file mode 100644
index 0000000..03ba6fd
--- /dev/null
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/messaging/SAMLMetadataContextLookupFunction.java
@@ -0,0 +1,53 @@
+/*
+ * 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.saml.profile.context.navigate.messaging;
+
+import javax.annotation.Nullable;
+
+import net.shibboleth.idp.profile.context.RelyingPartyContext;
+import net.shibboleth.idp.profile.context.navigate.messaging.AbstractRelyingPartyLookupFunction;
+
+import org.opensaml.messaging.context.BaseContext;
+import org.opensaml.messaging.context.MessageContext;
+import org.opensaml.saml.common.messaging.context.SAMLMetadataContext;
+
+/**
+ * A function to access a {@link SAMLMetadataContext} underlying a {@link RelyingPartyContext} located via a
+ * lookup function.
+ */
+public class SAMLMetadataContextLookupFunction extends AbstractRelyingPartyLookupFunction<SAMLMetadataContext> {
+
+ /** {@inheritDoc} */
+ @Override
+ @Nullable public SAMLMetadataContext apply(@Nullable final MessageContext input) {
+ final RelyingPartyContext rpCtx = getRelyingPartyContextLookupStrategy().apply(input);
+ if (rpCtx != null) {
+ final BaseContext peer = rpCtx.getRelyingPartyIdContextTree();
+ if (peer != null) {
+ if (peer instanceof SAMLMetadataContext) {
+ return (SAMLMetadataContext) peer;
+ } else {
+ return peer.getSubcontext(SAMLMetadataContext.class);
+ }
+ }
+ }
+
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/messaging/package-info.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/messaging/package-info.java
new file mode 100644
index 0000000..1ea1c07
--- /dev/null
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/profile/context/navigate/messaging/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.
+ */
+
+/**
+ * Functions for navigating SAML message context objects.
+ */
+
+package net.shibboleth.idp.saml.profile.context.navigate.messaging;
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list