[java-identity-provider] branch master updated: IDP-1271 - Admin flow for metadata queries

Scott Cantor cantor.2 at osu.edu
Thu Apr 5 17:51:17 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=85de086f8235fb4d0f2be8d80c7367a4c3fdb159

The following commit(s) were added to refs/heads/master by this push:
       new  85de086   IDP-1271 - Admin flow for metadata queries
85de086 is described below

commit 85de086f8235fb4d0f2be8d80c7367a4c3fdb159
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Apr 5 17:51:14 2018 -0400

    IDP-1271 - Admin flow for metadata queries
    
    https://issues.shibboleth.net/jira/browse/IDP-1271
---
 .../main/resources/conf/admin/general-admin.xml    |  6 ++
 idp-conf/src/main/resources/conf/audit.xml         |  1 +
 .../main/resources/system/conf/webflow-config.xml  |  1 +
 .../resources/system/flows/admin/mdquery-beans.xml | 62 ++++++++++++++
 .../resources/system/flows/admin/mdquery-flow.xml  | 55 +++++++++++++
 .../src/main/resources/system/views/mdquery.vm     | 34 ++++++++
 .../shibboleth/idp/cli/MetadataQueryArguments.java | 95 ++++++++++++++++++++++
 .../src/main/resources/bin/mdquery.bat             |  4 +
 idp-distribution/src/main/resources/bin/mdquery.sh |  9 ++
 .../idp/profile/impl/MetadataQueryRequest.java     | 94 +++++++++++++++++++++
 ...coder.java => MetadataQueryRequestDecoder.java} | 72 ++++------------
 .../profile/impl/ResolverTestRequestDecoder.java   |  2 +-
 12 files changed, 379 insertions(+), 56 deletions(-)

diff --git a/idp-conf/src/main/resources/conf/admin/general-admin.xml b/idp-conf/src/main/resources/conf/admin/general-admin.xml
index 2a8a0e0..5301fe7 100644
--- a/idp-conf/src/main/resources/conf/admin/general-admin.xml
+++ b/idp-conf/src/main/resources/conf/admin/general-admin.xml
@@ -36,6 +36,12 @@
             p:loggingId="%{idp.service.logging.resolvertest:ResolverTest}"
             p:policyName="%{idp.resolvertest.accessPolicy:AccessByIPAddress}" />
 
+        <!-- Metadata Query -->
+        <bean parent="shibboleth.AdminFlow"
+            c:id="http://shibboleth.net/ns/profiles/mdquery"
+            p:loggingId="MetadataQuery}"
+            p:policyName="AccessByIPAddress" />
+
         <!-- REST AccountLockoutManager Access -->
         <bean parent="shibboleth.AdminFlow"
             c:id="http://shibboleth.net/ns/profiles/lockout-manager"
diff --git a/idp-conf/src/main/resources/conf/audit.xml b/idp-conf/src/main/resources/conf/audit.xml
index 22949fd..d7e69f9 100644
--- a/idp-conf/src/main/resources/conf/audit.xml
+++ b/idp-conf/src/main/resources/conf/audit.xml
@@ -27,6 +27,7 @@
     <!-- Allows auditing to be disabled selectively for particular profiles/flows. -->
     <util:list id="shibboleth.AuditSuppressedProfiles">
         <value>http://shibboleth.net/ns/profiles/status</value>
+        <value>http://shibboleth.net/ns/profiles/mdquery</value>
     </util:list>
 
 </beans>
diff --git a/idp-conf/src/main/resources/system/conf/webflow-config.xml b/idp-conf/src/main/resources/system/conf/webflow-config.xml
index 46d99b8..b8e3cb0 100644
--- a/idp-conf/src/main/resources/system/conf/webflow-config.xml
+++ b/idp-conf/src/main/resources/system/conf/webflow-config.xml
@@ -27,6 +27,7 @@
                 <entry key="admin/reload-service" value="../system/flows/admin/reload-service-flow.xml" />
                 <entry key="admin/reload-metadata" value="../system/flows/admin/reload-metadata-flow.xml" />
                 <entry key="admin/lockout" value="../system/flows/admin/lockout-flow.xml" />
+                <entry key="admin/mdquery" value="../system/flows/admin/mdquery-flow.xml" />
                 <entry key="admin/metrics" value="../system/flows/admin/metrics-flow.xml" />
                 <entry key="admin/storage" value="../system/flows/admin/storage-flow.xml" />
                 
diff --git a/idp-conf/src/main/resources/system/flows/admin/mdquery-beans.xml b/idp-conf/src/main/resources/system/flows/admin/mdquery-beans.xml
new file mode 100644
index 0000000..0d8c6b6
--- /dev/null
+++ b/idp-conf/src/main/resources/system/flows/admin/mdquery-beans.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans
+    xmlns="http://www.springframework.org/schema/beans"
+    xmlns:c="http://www.springframework.org/schema/c"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:p="http://www.springframework.org/schema/p"
+    xmlns:util="http://www.springframework.org/schema/util"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+                        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
+                        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
+    default-init-method="initialize"
+    default-destroy-method="destroy">
+
+    <bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"
+        p:placeholderPrefix="%{" p:placeholderSuffix="}" />
+
+    <import resource="admin-abstract-beans.xml" />
+
+    <!-- Profile ID for flow. -->    
+    <bean id="shibboleth.AdminProfileId" class="java.lang.String"
+        c:_0="http://shibboleth.net/ns/profiles/mdquery" />
+
+    <!-- Default operation/resource suppliers for access checks. -->
+    
+    <bean id="shibboleth.AdminOperationLookupStrategy" class="com.google.common.base.Functions"
+        factory-method="constant" c:_0="read" />
+        
+    <bean id="shibboleth.AdminResourceLookupStrategy"
+        class="net.shibboleth.idp.profile.context.navigate.SpringExpressionContextLookupFunction"
+        c:inClass="#{T(org.opensaml.profile.context.ProfileRequestContext)}"
+        c:outputType="#{T(java.lang.String)}"
+        c:expression="#input.getInboundMessageContext().getMessage().getEntityID()" />
+        
+    <bean id="DecodeMessage" class="org.opensaml.profile.action.impl.DecodeMessage" scope="prototype">
+        <constructor-arg>
+            <bean class="net.shibboleth.idp.profile.impl.MetadataQueryRequestDecoder" scope="prototype">
+                <property name="httpServletRequest" ref="shibboleth.HttpServletRequest" />
+            </bean>
+        </constructor-arg>
+    </bean>
+    
+    <bean id="PostDecodePopulateAuditContext" parent="shibboleth.AbstractPopulateAuditContext"
+        p:fieldExtractors="#{getObject('shibboleth.PostDecodeAuditExtractors') ?: getObject('shibboleth.DefaultPostDecodeAuditExtractors')}" />
+    
+    <bean id="SAMLMetadataLookup"
+            class="net.shibboleth.idp.profile.impl.WebFlowMessageHandlerAdaptor" scope="prototype"
+            c:executionDirection="INBOUND">
+        <constructor-arg name="messageHandler">
+            <bean class="org.opensaml.saml.common.binding.impl.SAMLMetadataLookupHandler" scope="prototype">
+                <property name="roleDescriptorResolver">
+                    <bean class="org.opensaml.saml.metadata.resolver.impl.PredicateRoleDescriptorResolver"
+                        c:mdResolver-ref="shibboleth.MetadataResolver" />
+                </property>
+            </bean>
+        </constructor-arg>
+    </bean>
+    
+    <bean id="PostLookupPopulateAuditContext" parent="shibboleth.AbstractPopulateAuditContext"
+        p:fieldExtractors="#{getObject('shibboleth.PostLookupAuditExtractors') ?: getObject('shibboleth.DefaultPostLookupAuditExtractors')}" />
+    
+</beans>
diff --git a/idp-conf/src/main/resources/system/flows/admin/mdquery-flow.xml b/idp-conf/src/main/resources/system/flows/admin/mdquery-flow.xml
new file mode 100644
index 0000000..fcc5061
--- /dev/null
+++ b/idp-conf/src/main/resources/system/flows/admin/mdquery-flow.xml
@@ -0,0 +1,55 @@
+<flow xmlns="http://www.springframework.org/schema/webflow"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow.xsd"
+    parent="admin.abstract">
+    
+    <!-- Start action. -->
+
+    <on-start>
+        <evaluate expression="'ResponseView'"  result="flowScope.ErrorState"/>
+        <evaluate expression="'ResponseView'"  result="flowScope.AuditedErrorState"/>
+    </on-start>
+
+    <action-state id="InitializeProfileRequestContext">
+        <evaluate expression="InitializeProfileRequestContext" />
+        <evaluate expression="'proceed'" />
+        
+        <transition on="proceed" to="DecodeMessage" />
+    </action-state>
+
+    <action-state id="DecodeMessage">
+        <evaluate expression="DecodeMessage" />
+        <evaluate expression="PostDecodePopulateAuditContext" />
+        <evaluate expression="'proceed'" />
+        
+        <transition on="proceed" to="DoAdminPreamble" />
+    </action-state>
+    
+    <!-- Resume actual flow processing. -->
+    
+    <action-state id="DoProfileWork">
+        <evaluate expression="CheckAccess" />
+        <evaluate expression="SAMLMetadataLookup" />
+        <evaluate expression="PostLookupPopulateAuditContext" />
+        <evaluate expression="'proceed'" />
+    
+        <transition on="proceed" to="ResponseView" />
+    </action-state>
+    
+    <end-state id="ResponseView" view="mdquery">
+        <on-entry>
+            <evaluate expression="WriteAuditLog" />
+            <evaluate expression="environment" result="requestScope.environment" />
+            <evaluate expression="opensamlProfileRequestContext" result="requestScope.profileRequestContext" />
+            <evaluate expression="T(org.opensaml.core.xml.util.XMLObjectSupport)" result="requestScope.XMLObjectSupport" />
+            <evaluate expression="T(net.shibboleth.utilities.java.support.xml.SerializeSupport)" result="requestScope.SerializeSupport" />
+            <evaluate expression="T(net.shibboleth.utilities.java.support.codec.HTMLEncoder)" result="requestScope.encoder" />
+            <evaluate expression="flowRequestContext.getExternalContext().getNativeRequest()" result="requestScope.request" />
+            <evaluate expression="flowRequestContext.getExternalContext().getNativeResponse()" result="requestScope.response" />
+            <evaluate expression="flowRequestContext.getActiveFlow().getApplicationContext().containsBean('shibboleth.CustomViewContext') ? flowRequestContext.getActiveFlow().getApplicationContext().getBean('shibboleth.CustomViewContext') : null" result="requestScope.custom" />
+        </on-entry>
+    </end-state>
+
+    <bean-import resource="mdquery-beans.xml" />
+
+</flow>
diff --git a/idp-conf/src/main/resources/system/views/mdquery.vm b/idp-conf/src/main/resources/system/views/mdquery.vm
new file mode 100644
index 0000000..3530ff3
--- /dev/null
+++ b/idp-conf/src/main/resources/system/views/mdquery.vm
@@ -0,0 +1,34 @@
+##
+## Velocity Template for mdquery Utility Output
+##
+## Velocity context will contain the following properties
+## flowRequestContext - the Spring Web Flow RequestContext
+## request - HttpServletRequest
+## response - HttpServletResponse
+## profileRequestContext
+## XMLObjectSupport
+## SerializeSupport
+## environment - Spring Environment object for property resolution
+## custom - arbitrary object injected by deployer
+##
+#if ($flowRequestContext.getCurrentEvent() and !$flowRequestContext.getCurrentEvent().getId().equals("proceed"))
+$flowRequestContext.getCurrentEvent().getId()
+$response.setContentType("text/plain")
+$response.setStatus(500)
+#stop
+#end
+#if ($profileRequestContext.getInboundMessageContext())
+#set ($peerCtx = $profileRequestContext.getInboundMessageContext().getSubcontext("org.opensaml.saml.common.messaging.context.SAMLPeerEntityContext"))
+#if ($peerCtx)
+#set ($mdCtx = $peerCtx.getSubcontext("org.opensaml.saml.common.messaging.context.SAMLMetadataContext"))
+#if ($mdCtx && $mdCtx.getEntityDescriptor())
+$SerializeSupport.prettyPrintXML($XMLObjectSupport.marshall($mdCtx.getEntityDescriptor()))
+$response.setContentType("text/xml")
+$response.setStatus(200)
+#stop
+#end
+#end
+#end
+Not Found
+$response.setContentType("text/plain")
+$response.setStatus(404)
diff --git a/idp-core/src/main/java/net/shibboleth/idp/cli/MetadataQueryArguments.java b/idp-core/src/main/java/net/shibboleth/idp/cli/MetadataQueryArguments.java
new file mode 100644
index 0000000..081fced
--- /dev/null
+++ b/idp-core/src/main/java/net/shibboleth/idp/cli/MetadataQueryArguments.java
@@ -0,0 +1,95 @@
+/*
+ * 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.cli;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.beust.jcommander.Parameter;
+
+/** Command line processing for MetadataQuery flow. */
+public class MetadataQueryArguments extends AbstractCommandLineArguments {
+
+    /** EntityID. */
+    @Parameter(names = {"-e", "--entityID"}, required = true, description = "EntityID to find metadata for")
+    @Nullable private String entityID;
+
+    /** Role protocol.  */
+    @Parameter(names = {"--protocol"}, description = "Optional protocol to find metadata role for")
+    @Nullable private String protocol;
+
+    /** SAML 1.1 protocol. */
+    @Parameter(names = {"--saml1"}, description = "Query for SAML 1.1 role")
+    private boolean saml1;
+
+    /** SAML 2.0 protocol. */
+    @Parameter(names = {"--saml2"}, description = "Query for SAML 2.0 role")
+    private boolean saml2;
+    
+    /** {@inheritDoc} */
+    @Override
+    public void validate() {
+        if (saml1) {
+            if (saml2 || protocol != null) {
+                throw new IllegalArgumentException("The saml1, saml2, and protocol options are mutually exclusive");
+            }
+        } else if (saml2) {
+            if (saml1 || protocol != null) {
+                throw new IllegalArgumentException("The saml1, saml2, and protocol options are mutually exclusive");
+            }
+        } else if (protocol != null) {
+            if (saml1 || saml2) {
+                throw new IllegalArgumentException("The saml1, saml2, and protocol options are mutually exclusive");
+            }
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    protected StringBuilder doBuildURL(@Nonnull final StringBuilder builder) {
+        
+        if (getPath() == null) {
+            builder.append("/profile/admin/mdquery");
+        }
+        
+        if (builder.toString().contains("?")) {
+            builder.append('&');
+        } else {
+            builder.append('?');
+        }
+        
+        try {
+            builder.append("entityID=").append(URLEncoder.encode(entityID, "UTF-8"));
+            if (saml1) {
+                builder.append("&saml1");
+            } else if (saml2) {
+                builder.append("&saml2");
+            } else if (protocol != null) {
+                builder.append("&protocol=").append(URLEncoder.encode(protocol, "UTF-8"));
+            }
+        } catch (final UnsupportedEncodingException e) {
+            // UTF-8 is a required encoding. 
+        }
+        
+        return builder;
+    }
+        
+}
\ No newline at end of file
diff --git a/idp-distribution/src/main/resources/bin/mdquery.bat b/idp-distribution/src/main/resources/bin/mdquery.bat
new file mode 100644
index 0000000..73d8ca0
--- /dev/null
+++ b/idp-distribution/src/main/resources/bin/mdquery.bat
@@ -0,0 +1,4 @@
+ at echo off
+setlocal
+
+"%~dp0\runclass.bat" -Dnet.shibboleth.idp.cli.arguments=net.shibboleth.idp.cli.MetadataQueryArguments net.shibboleth.idp.cli.CLI %*
diff --git a/idp-distribution/src/main/resources/bin/mdquery.sh b/idp-distribution/src/main/resources/bin/mdquery.sh
new file mode 100755
index 0000000..8cbe3fb
--- /dev/null
+++ b/idp-distribution/src/main/resources/bin/mdquery.sh
@@ -0,0 +1,9 @@
+#! /bin/bash
+
+declare LOCATION
+
+LOCATION=$0
+LOCATION=${LOCATION%/*}
+
+$LOCATION/runclass.sh -Dnet.shibboleth.idp.cli.arguments=net.shibboleth.idp.cli.MetadataQueryArguments \
+    net.shibboleth.idp.cli.CLI "$@"
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/MetadataQueryRequest.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/MetadataQueryRequest.java
new file mode 100644
index 0000000..9c5efe1
--- /dev/null
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/MetadataQueryRequest.java
@@ -0,0 +1,94 @@
+/*
+ * 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.profile.impl;
+
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.ThreadSafe;
+
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+import net.shibboleth.utilities.java.support.primitive.StringSupport;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Object representing a query for metadata.
+ * 
+ * <p>This abstracts the parameters used to populate the context tree.</p>
+ */
+ at ThreadSafe
+public class MetadataQueryRequest {
+
+    /** An entityID. */
+    @Nullable @NotEmpty private String entityID;
+    
+    /** Protocol identifier for query. */
+    @Nullable private String protocol;
+
+    /**
+     * Constructor.
+     */
+    public MetadataQueryRequest() {
+        
+    }
+
+    /**
+     * Get the entityID to query on.
+     * 
+     * @return entityID for query
+     */
+    @Nullable @NotEmpty public String getEntityID() {
+        return entityID;
+    }
+    
+    /**
+     * Set the entityID to query on.
+     * 
+     * @param id entityID for query
+     */
+    public void setEntityID(@Nullable @NotEmpty final String id) {
+        entityID = StringSupport.trimOrNull(id);
+    }
+
+    /**
+     * Get the protocol to query on.
+     * 
+     * @return protocol for query
+     */
+    @Nullable @NotEmpty public String getProtocol() {
+        return protocol;
+    }
+    
+    /**
+     * Set the protocol to query on.
+     * 
+     * @param prot protocol for query
+     */
+    public void setProtocol(@Nullable @NotEmpty final String prot) {
+        protocol = StringSupport.trimOrNull(prot);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+            .add("entityID", entityID)
+            .add("protocol", protocol)
+            .toString();
+    }
+    
+}
\ No newline at end of file
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolverTestRequestDecoder.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/MetadataQueryRequestDecoder.java
similarity index 63%
copy from idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolverTestRequestDecoder.java
copy to idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/MetadataQueryRequestDecoder.java
index e904cdf..0634c91 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolverTestRequestDecoder.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/MetadataQueryRequestDecoder.java
@@ -35,18 +35,12 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Decodes an incoming Shibboleth Authentication Request message.
+ * Decodes an incoming metadata query request.
  */
-public class ResolverTestRequestDecoder extends AbstractHttpServletRequestMessageDecoder<ResolverTestRequest> {
+public class MetadataQueryRequestDecoder extends AbstractHttpServletRequestMessageDecoder<MetadataQueryRequest> {
 
-    /** Name of the query parameter carrying the subject name: {@value} . */
-    @Nonnull @NotEmpty public static final String PRINCIPAL_PARAM = "principal";
-
-    /** Name of the query parameter carrying the requesterID: {@value} . */
-    @Nonnull @NotEmpty public static final String REQUESTER_ID_PARAM = "requester";
-
-    /** Name of the query parameter carrying the ACS index: {@value} . */
-    @Nonnull @NotEmpty public static final String ACS_INDEX_PARAM = "acsIndex";
+    /** Name of the query parameter carrying the entityID: {@value} . */
+    @Nonnull @NotEmpty public static final String ENTITY_ID_PARAM = "entityID";
 
     /** Name of the query parameter carrying the protocol: {@value} . */
     @Nonnull @NotEmpty public static final String PROTOCOL_PARAM = "protocol";
@@ -58,7 +52,7 @@ public class ResolverTestRequestDecoder extends AbstractHttpServletRequestMessag
     @Nonnull @NotEmpty public static final String SAML2_PARAM = "saml2";
 
     /** Class logger. */
-    @Nonnull private final Logger log = LoggerFactory.getLogger(ResolverTestRequestDecoder.class);
+    @Nonnull private final Logger log = LoggerFactory.getLogger(MetadataQueryRequestDecoder.class);
     
     /** {@inheritDoc} */
     @Override
@@ -68,15 +62,17 @@ public class ResolverTestRequestDecoder extends AbstractHttpServletRequestMessag
             throw new MessageDecodingException("Unable to locate HttpServletRequest");
         }
         
-        final ResolverTestRequest message = new ResolverTestRequest(getPrincipal(request), getRequesterId(request),
-                getIndex(request), getProtocol(request));
-        final MessageContext<ResolverTestRequest> messageContext = new MessageContext<>();
+        final MetadataQueryRequest message = new MetadataQueryRequest();
+        message.setEntityID(getEntityID(request));
+        message.setProtocol(getProtocol(request));
+        
+        final MessageContext<MetadataQueryRequest> messageContext = new MessageContext<>();
         messageContext.setMessage(message);
         setMessageContext(messageContext);
         
         final SAMLPeerEntityContext peerCtx = new SAMLPeerEntityContext();
         peerCtx.setRole(SPSSODescriptor.DEFAULT_ELEMENT_NAME);
-        peerCtx.setEntityId(message.getRequesterId());
+        peerCtx.setEntityId(message.getEntityID());
         messageContext.addSubcontext(peerCtx, true);
         
         if (message.getProtocol() != null) {
@@ -85,59 +81,25 @@ public class ResolverTestRequestDecoder extends AbstractHttpServletRequestMessag
     }
 
     /**
-     * Get the name of the subject.
+     * Get the entityID parameter.
      * 
      * @param request current HTTP request
      * 
-     * @return the name of the subject
+     * @return the entityID
      * 
-     * @throws MessageDecodingException thrown if the request does not contain a subject name
+     * @throws MessageDecodingException thrown if the request does not contain an entityID
      */
-    @Nonnull @NotEmpty protected String getPrincipal(@Nonnull final HttpServletRequest request)
+    @Nonnull @NotEmpty protected String getEntityID(@Nonnull final HttpServletRequest request)
             throws MessageDecodingException {
-        final String name = StringSupport.trimOrNull(request.getParameter(PRINCIPAL_PARAM));
+        final String name = StringSupport.trimOrNull(request.getParameter(ENTITY_ID_PARAM));
         if (name == null) {
-            throw new MessageDecodingException("Request did not contain the " + PRINCIPAL_PARAM + " query parameter.");
-        }
-        return name;
-    }
-
-    /**
-     * Get the ID of the requester.
-     * 
-     * @param request current HTTP request
-     * 
-     * @return the ID of the requester
-     * 
-     * @throws MessageDecodingException thrown if the request does not contain a requester name
-     */
-    @Nonnull @NotEmpty protected String getRequesterId(@Nonnull final HttpServletRequest request)
-            throws MessageDecodingException {
-        final String name = StringSupport.trimOrNull(request.getParameter(REQUESTER_ID_PARAM));
-        if (name == null) {
-            throw new MessageDecodingException("Request did not contain the " + REQUESTER_ID_PARAM
+            throw new MessageDecodingException("Request did not contain the " + ENTITY_ID_PARAM
                     + " query parameter.");
         }
         return name;
     }
 
     /**
-     * Get the ACS index.
-     * 
-     * @param request current HTTP request
-     * 
-     * @return the ACS index, or null
-     */
-    @Nullable protected Integer getIndex(@Nonnull final HttpServletRequest request) {
-        final String index = StringSupport.trimOrNull(request.getParameter(ACS_INDEX_PARAM));
-        if (index != null) {
-            return Integer.valueOf(index);
-        }
-        
-        return null;
-    }
-
-    /**
      * Get the protocol.
      * 
      * @param request current HTTP request
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolverTestRequestDecoder.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolverTestRequestDecoder.java
index e904cdf..fbd017e 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolverTestRequestDecoder.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/ResolverTestRequestDecoder.java
@@ -35,7 +35,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Decodes an incoming Shibboleth Authentication Request message.
+ * Decodes an incoming resolver test message.
  */
 public class ResolverTestRequestDecoder extends AbstractHttpServletRequestMessageDecoder<ResolverTestRequest> {
 

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


More information about the commits mailing list