Form generator for discovery along with sample form.
[shibboleth/sp.git] / util / resolvertest.cpp
index 4628d42..6e589f7 100644 (file)
@@ -84,9 +84,10 @@ public:
     }
 
 private:
-    string implementProtocol(
+    void implementProtocol(
         const Application& application,
         const HTTPRequest& httpRequest,
+        HTTPResponse& httpResponse,
         SecurityPolicy& policy,
         const PropertySet* settings,
         const XMLObject& xmlObject
@@ -215,8 +216,9 @@ int main(int argc,char* argv[])
 
             MetadataProvider* m=app->getMetadataProvider();
             xmltooling::Locker mlocker(m);
-            const EntityDescriptor* site=m->getEntityDescriptor(issuer.get());
-            if (!site)
+            MetadataProvider::Criteria mc(i_param, &IDPSSODescriptor::ELEMENT_QNAME, protocol);
+            pair<const EntityDescriptor*,const RoleDescriptor*> site=m->getEntityDescriptor(mc);
+            if (!site.first)
                 throw MetadataException("Unable to locate metadata for IdP ($1).", params(1,i_param));
 
             // Build NameID(s).
@@ -233,7 +235,7 @@ int main(int argc,char* argv[])
 
             ResolverTest rt(NULL, a_param);
             try {
-                ctx = rt.resolveAttributes(*app, site->getIDPSSODescriptor(protocol), protocol, v1name, v2name.get(), NULL, NULL, NULL);
+                ctx = rt.resolveAttributes(*app, site.second, protocol, v1name, v2name.get(), NULL, NULL, NULL);
             }
             catch (...) {
                 delete v1name;
@@ -285,8 +287,9 @@ int main(int argc,char* argv[])
 
             MetadataProvider* m=app->getMetadataProvider();
             xmltooling::Locker mlocker(m);
-            const EntityDescriptor* site=m->getEntityDescriptor(issuer);
-            if (!site) {
+            MetadataProvider::Criteria mc(issuer, &IDPSSODescriptor::ELEMENT_QNAME, protocol);
+            pair<const EntityDescriptor*,const RoleDescriptor*> site=m->getEntityDescriptor(mc);
+            if (!site.first) {
                 auto_ptr_char temp(issuer);
                 throw MetadataException("Unable to locate metadata for IdP ($1).", params(1,temp.get()));
             }
@@ -294,7 +297,7 @@ int main(int argc,char* argv[])
             vector<const Assertion*> tokens(1, dynamic_cast<Assertion*>(token.get()));
             ResolverTest rt(NULL, a_param);
             try {
-                ctx = rt.resolveAttributes(*app, site->getIDPSSODescriptor(protocol), protocol, v1name, v2name, NULL, NULL, &tokens);
+                ctx = rt.resolveAttributes(*app, site.second, protocol, v1name, v2name, NULL, NULL, &tokens);
             }
             catch (...) {
                 if (v1name)