Streamline SecurityPolicy methods and rule modification.
[shibboleth/opensaml2.git] / samltest / saml2 / binding / SAML2ArtifactTest.h
index 05d832c..329af90 100644 (file)
@@ -38,7 +38,8 @@ public:
     void testSAML2Artifact() {
         try {
             QName idprole(samlconstants::SAML20MD_NS, IDPSSODescriptor::LOCAL_NAME);
-            SecurityPolicy policy(m_rules2, m_metadata, &idprole, m_trust, false);
+            SecurityPolicy policy(m_metadata, &idprole, m_trust, false);
+            policy.getRules().assign(m_rules2.begin(), m_rules2.end());
 
             // Read message to use from file.
             string path = data_path + "saml2/binding/SAML2Response.xml";
@@ -61,7 +62,9 @@ public:
 
             // Encode message.
             auto_ptr<MessageEncoder> encoder(
-                SAMLConfig::getConfig().MessageEncoderManager.newPlugin(samlconstants::SAML20_BINDING_HTTP_ARTIFACT, NULL)
+                SAMLConfig::getConfig().MessageEncoderManager.newPlugin(
+                    samlconstants::SAML20_BINDING_HTTP_ARTIFACT, pair<const DOMElement*,const XMLCh*>(NULL,NULL)
+                    )
                 );
             Locker locker(m_metadata);
             encoder->encode(
@@ -72,7 +75,9 @@ public:
             // Decode message.
             string relayState;
             auto_ptr<MessageDecoder> decoder(
-                SAMLConfig::getConfig().MessageDecoderManager.newPlugin(samlconstants::SAML20_BINDING_HTTP_ARTIFACT, NULL)
+                SAMLConfig::getConfig().MessageDecoderManager.newPlugin(
+                    samlconstants::SAML20_BINDING_HTTP_ARTIFACT, pair<const DOMElement*,const XMLCh*>(NULL,NULL)
+                    )
                 );
             decoder->setArtifactResolver(this);
             auto_ptr<Response> response(dynamic_cast<Response*>(decoder->decode(relayState,*this,policy)));
@@ -130,7 +135,7 @@ public:
         sc->setValue(StatusCode::SUCCESS);
         response->marshall();
         SchemaValidators.validate(response.get());
-        policy.evaluate(*(response.get()), this);
+        policy.evaluate(*(response.get()), this, samlconstants::SAML20P_NS);
         return response.release();
     }
 };