Move config logic into an "XML" SP plugin, divorce shibd and modules from old libs.
[shibboleth/cpp-sp.git] / test / shibtest.cpp
index faa3f98..19b343e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2005 Internet2
+ *  Copyright 2001-2007 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -74,18 +74,18 @@ int main(int argc,char* argv[])
         SPConfig::Metadata |
         SPConfig::Trust |
         SPConfig::Credentials |
-        SPConfig::AAP |
+        SPConfig::AttributeResolver |
         SPConfig::OutOfProcess |
         SPConfig::Caching
         );
     if (!conf.init(path) || !conf.load(config))
         return -10;
 
-    IConfig* ini=ShibTargetConfig::getConfig().getINI();
-    xmltooling::Locker locker(ini);
+    ServiceProvider* sp=SPConfig::getConfig().getServiceProvider();
+    xmltooling::Locker locker(sp);
 
     try {
-        const IApplication* app=dynamic_cast<const IApplication*>(ini->getApplication(a_param));
+        const IApplication* app=dynamic_cast<const IApplication*>(sp->getApplication(a_param));
         if (!app)
             throw SAMLException("specified <Application> section not found in configuration");
 
@@ -104,8 +104,7 @@ int main(int argc,char* argv[])
                             format.get() ? format.get() : shibspconstants::SHIB1_NAMEID_FORMAT_URI
                             )
                         ),
-                    resource.get(),
-                    app->getAttributeDesignators().clone()
+                    resource.get()
                     )
                 )
             );
@@ -141,18 +140,6 @@ int main(int argc,char* argv[])
         if (!response)
             throw opensaml::BindingException("unable to successfully query for attributes");
 
-        // Run it through the AAP. Note that we could end up with an empty response!
-        Iterator<SAMLAssertion*> a=response->getAssertions();
-        for (unsigned long c=0; c < a.size();) {
-            try {
-                shibboleth::AAP::apply(app->getAAPProviders(),*(a[c]),AA);
-                c++;
-            }
-            catch (SAMLException&) {
-                response->removeAssertion(c);
-            }
-        }
-
         Iterator<SAMLAssertion*> i=response->getAssertions();
         if (i.hasNext())
         {