[java-shib-attribute] 03/04: JSATTR-6: SAML AttributeQuery DataConnector
Codeberg
noreply at shibboleth.net
Fri Jan 16 17:07:55 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-shib-attribute.
View the commit online:
https://codeberg.org/Shibboleth/java-shib-attribute/commit/7b87e0378adf733cade2de14ffc718e7b692fc26
commit 7b87e0378adf733cade2de14ffc718e7b692fc26
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Fri Jan 16 11:52:53 2026 -0500
JSATTR-6: SAML AttributeQuery DataConnector
Add impls of a couple of lookup functions needed for the SAML validation
context builder.
---
.../plugin/impl/SelfEntityIDLookupFunction.java | 53 +++++++++++++++++++
.../plugin/impl/ValidIssuersLookupFunction.java | 60 ++++++++++++++++++++++
2 files changed, 113 insertions(+)
diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/saml/plugin/impl/SelfEntityIDLookupFunction.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/saml/plugin/impl/SelfEntityIDLookupFunction.java
new file mode 100644
index 000000000..788e80473
--- /dev/null
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/saml/plugin/impl/SelfEntityIDLookupFunction.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed 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.attribute.resolver.dc.saml.plugin.impl;
+
+import java.util.function.Function;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.opensaml.messaging.context.InOutOperationContext;
+import org.opensaml.messaging.context.navigate.ChildContextLookup;
+import org.opensaml.saml.common.messaging.context.SAMLSelfEntityContext;
+import org.opensaml.saml.common.messaging.context.navigate.SAMLEntityIDFunction;
+
+import net.shibboleth.shared.annotation.constraint.NotLive;
+import net.shibboleth.shared.annotation.constraint.Unmodifiable;
+
+/**
+ * Function to resolve the self entityID from the SOAP client operation context.
+ */
+public class SelfEntityIDLookupFunction implements Function<InOutOperationContext, String> {
+
+ /** The lookup delegate. */
+ @Nonnull private Function<InOutOperationContext, String> delegate;
+
+ /** Constructor. */
+ public SelfEntityIDLookupFunction() {
+ delegate = new SAMLEntityIDFunction().compose(
+ new ChildContextLookup<>(SAMLSelfEntityContext.class));
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Unmodifiable @NotLive public String apply(@Nullable final InOutOperationContext opContext) {
+ if (opContext == null) {
+ return null;
+ }
+
+ return delegate.apply(opContext);
+ }
+
+}
diff --git a/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/saml/plugin/impl/ValidIssuersLookupFunction.java b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/saml/plugin/impl/ValidIssuersLookupFunction.java
new file mode 100644
index 000000000..57f7b4da0
--- /dev/null
+++ b/shib-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/saml/plugin/impl/ValidIssuersLookupFunction.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed 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.attribute.resolver.dc.saml.plugin.impl;
+
+import java.util.Set;
+import java.util.function.Function;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.opensaml.messaging.context.InOutOperationContext;
+import org.opensaml.messaging.context.navigate.ChildContextLookup;
+import org.opensaml.saml.common.messaging.context.SAMLPeerEntityContext;
+import org.opensaml.saml.common.messaging.context.navigate.SAMLEntityIDFunction;
+
+import net.shibboleth.shared.annotation.constraint.NotLive;
+import net.shibboleth.shared.annotation.constraint.Unmodifiable;
+import net.shibboleth.shared.collection.CollectionSupport;
+
+/**
+ * Function to resolve the valid issuers from the SOAP client operation context.
+ */
+public class ValidIssuersLookupFunction implements Function<InOutOperationContext, Set<String>> {
+
+ /** The lookup delegate. */
+ @Nonnull private Function<InOutOperationContext, String> delegate;
+
+ /** Constructor. */
+ public ValidIssuersLookupFunction() {
+ delegate = new SAMLEntityIDFunction().compose(
+ new ChildContextLookup<>(SAMLPeerEntityContext.class));
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Unmodifiable @NotLive public Set<String> apply(@Nullable final InOutOperationContext opContext) {
+ if (opContext == null) {
+ return null;
+ }
+
+ final String entityID = delegate.apply(opContext);
+ if (entityID != null) {
+ return CollectionSupport.singleton(entityID);
+ }
+ return CollectionSupport.emptySet();
+ }
+
+
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list