Added marker interface for assertion types.
authorScott Cantor <cantor.2@osu.edu>
Mon, 5 Mar 2007 05:50:16 +0000 (05:50 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 5 Mar 2007 05:50:16 +0000 (05:50 +0000)
shibsp/SessionCache.h
shibsp/attribute/resolver/AttributeResolver.h
shibsp/attribute/resolver/ResolutionContext.h
shibsp/attribute/resolver/impl/SimpleAttributeResolver.cpp
shibsp/binding/impl/SOAPClient.cpp
shibsp/impl/RemotedSessionCache.cpp
shibsp/impl/StorageServiceSessionCache.cpp
shibsp/impl/XMLServiceProvider.cpp

index e35cecf..a4cc56b 100644 (file)
@@ -122,14 +122,14 @@ namespace shibsp {
          * @param id    identifier of the assertion to retrieve
          * @return pointer to assertion, or NULL
          */
-        virtual const opensaml::RootObject* getAssertion(const char* id) const=0;
+        virtual const opensaml::Assertion* getAssertion(const char* id) const=0;
         
         /**
          * Stores an assertion in the session.
          * 
          * @param assertion pointer to an assertion to cache (will be freed by cache)
          */
-        virtual void addAssertion(opensaml::RootObject* assertion)=0;        
+        virtual void addAssertion(opensaml::Assertion* assertion)=0;        
     };
     
     /**
@@ -194,7 +194,7 @@ namespace shibsp {
             const char* session_index=NULL,
             const char* authncontext_class=NULL,
             const char* authncontext_decl=NULL,
-            const std::vector<const opensaml::RootObject*>* tokens=NULL,
+            const std::vector<const opensaml::Assertion*>* tokens=NULL,
             const std::vector<Attribute*>* attributes=NULL
             )=0;
 
index ba78d17..1503a7b 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <shibsp/base.h>
 
-#include <saml/saml1/core/Assertions.h>
+#include <saml/Assertion.h>
 #include <saml/saml2/metadata/Metadata.h>
 #include <xmltooling/Lockable.h>
 
@@ -70,7 +70,7 @@ namespace shibsp {
             const char* client_addr,
             const opensaml::saml2md::EntityDescriptor* issuer,
             const opensaml::saml2::NameID& nameid,
-            const std::vector<const opensaml::RootObject*>* tokens=NULL
+            const std::vector<const opensaml::Assertion*>* tokens=NULL
             ) const=0;
 
         /**
index 33a0187..f05bcd0 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <shibsp/base.h>
 
-#include <saml/saml1/core/Assertions.h>
+#include <saml/Assertion.h>
 #include <saml/saml2/metadata/Metadata.h>
 
 namespace shibsp {
@@ -79,7 +79,7 @@ namespace shibsp {
          * 
          * @return pointer to an array of tokens, or NULL
          */
-        virtual const std::vector<const opensaml::RootObject*>* getTokens() const=0;
+        virtual const std::vector<const opensaml::Assertion*>* getTokens() const=0;
         
         /**
          * Returns the active session associated with the subject, if any.
@@ -108,7 +108,7 @@ namespace shibsp {
          * 
          * @return  a mutable array of Assertions
          */
-        virtual std::vector<opensaml::RootObject*>& getResolvedAssertions()=0;
+        virtual std::vector<opensaml::Assertion*>& getResolvedAssertions()=0;
     };
 };
 
index deceee6..bff9752 100644 (file)
@@ -70,7 +70,7 @@ namespace shibsp {
             const char* client_addr,\r
             const EntityDescriptor* issuer,\r
             const NameID& nameid,\r
-            const vector<const opensaml::RootObject*>* tokens=NULL\r
+            const vector<const opensaml::Assertion*>* tokens=NULL\r
             ) : m_app(application), m_session(NULL), m_client_addr(client_addr), m_entity(issuer), m_nameid(nameid), m_tokens(tokens) {\r
         }\r
         \r
@@ -78,7 +78,7 @@ namespace shibsp {
             if (m_metadata)\r
                 m_metadata->unlock();\r
             for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<shibsp::Attribute>());\r
-            for_each(m_assertions.begin(), m_assertions.end(), xmltooling::cleanup<opensaml::RootObject>());\r
+            for_each(m_assertions.begin(), m_assertions.end(), xmltooling::cleanup<opensaml::Assertion>());\r
         }\r
     \r
         const Application& getApplication() const {\r
@@ -102,7 +102,7 @@ namespace shibsp {
         const NameID& getNameID() const {\r
             return m_nameid;\r
         }\r
-        const vector<const opensaml::RootObject*>* getTokens() const {\r
+        const vector<const opensaml::Assertion*>* getTokens() const {\r
             return m_tokens;\r
         }\r
         const Session* getSession() const {\r
@@ -111,7 +111,7 @@ namespace shibsp {
         vector<shibsp::Attribute*>& getResolvedAttributes() {\r
             return m_attributes;\r
         }\r
-        vector<opensaml::RootObject*>& getResolvedAssertions() {\r
+        vector<opensaml::Assertion*>& getResolvedAssertions() {\r
             return m_assertions;\r
         }\r
 \r
@@ -122,9 +122,9 @@ namespace shibsp {
         mutable MetadataProvider* m_metadata;\r
         mutable const EntityDescriptor* m_entity;\r
         const NameID& m_nameid;\r
-        const vector<const opensaml::RootObject*>* m_tokens;\r
+        const vector<const opensaml::Assertion*>* m_tokens;\r
         vector<shibsp::Attribute*> m_attributes;\r
-        vector<opensaml::RootObject*> m_assertions;\r
+        vector<opensaml::Assertion*> m_assertions;\r
     };\r
     \r
 #if defined (_MSC_VER)\r
@@ -153,10 +153,10 @@ namespace shibsp {
             ResolutionContext& ctx, const NameID& nameid, const vector<const char*>* attributes=NULL\r
             ) const;\r
         void resolve(\r
-            ResolutionContext& ctx, const opensaml::saml1::Assertion* token, const vector<const char*>* attributes=NULL\r
+            ResolutionContext& ctx, const saml1::Assertion* token, const vector<const char*>* attributes=NULL\r
             ) const;\r
         void resolve(\r
-            ResolutionContext& ctx, const opensaml::saml2::Assertion* token, const vector<const char*>* attributes=NULL\r
+            ResolutionContext& ctx, const saml2::Assertion* token, const vector<const char*>* attributes=NULL\r
             ) const;\r
 \r
         bool m_allowQuery;\r
@@ -185,7 +185,7 @@ namespace shibsp {
             const char* client_addr,\r
             const EntityDescriptor* issuer,\r
             const NameID& nameid,\r
-            const vector<const opensaml::RootObject*>* tokens=NULL\r
+            const vector<const opensaml::Assertion*>* tokens=NULL\r
             ) const {\r
             return new SimpleContext(application,client_addr,issuer,nameid,tokens);\r
         }\r
@@ -255,29 +255,29 @@ SimpleResolverImpl::SimpleResolverImpl(const DOMElement* e) : m_document(NULL),
         child = XMLHelper::getNextSiblingElement(child, SIMPLE_NS, _AttributeDecoder);\r
     }\r
     \r
-    child = XMLHelper::getFirstChildElement(e, samlconstants::SAML20_NS, opensaml::saml2::Attribute::LOCAL_NAME);\r
+    child = XMLHelper::getFirstChildElement(e, samlconstants::SAML20_NS, saml2::Attribute::LOCAL_NAME);\r
     while (child) {\r
         // Check for missing Name.\r
-        const XMLCh* name = child->getAttributeNS(NULL, opensaml::saml2::Attribute::NAME_ATTRIB_NAME);\r
+        const XMLCh* name = child->getAttributeNS(NULL, saml2::Attribute::NAME_ATTRIB_NAME);\r
         if (!name || !*name) {\r
             log.warn("skipping saml:Attribute declared with no Name");\r
-            child = XMLHelper::getNextSiblingElement(child, samlconstants::SAML20_NS, opensaml::saml2::Attribute::LOCAL_NAME);\r
+            child = XMLHelper::getNextSiblingElement(child, samlconstants::SAML20_NS, saml2::Attribute::LOCAL_NAME);\r
             continue;\r
         }\r
 \r
         const AttributeDecoder* decoder=NULL;\r
-        auto_ptr_char id(child->getAttributeNS(NULL, opensaml::saml2::Attribute::FRIENDLYNAME_ATTRIB_NAME));\r
+        auto_ptr_char id(child->getAttributeNS(NULL, saml2::Attribute::FRIENDLYNAME_ATTRIB_NAME));\r
         auto_ptr_char d(child->getAttributeNS(SIMPLE_NS, decoderId));\r
         if (!id.get() || !*id.get() || !d.get() || !*d.get() || !(decoder=m_decoderMap[d.get()])) {\r
             log.warn("skipping saml:Attribute declared with no FriendlyName or resolvable AttributeDecoder");\r
-            child = XMLHelper::getNextSiblingElement(child, samlconstants::SAML20_NS, opensaml::saml2::Attribute::LOCAL_NAME);\r
+            child = XMLHelper::getNextSiblingElement(child, samlconstants::SAML20_NS, saml2::Attribute::LOCAL_NAME);\r
             continue;\r
         }\r
         \r
         // Empty NameFormat implies the usual Shib URI naming defaults.\r
-        const XMLCh* format = child->getAttributeNS(NULL, opensaml::saml2::Attribute::NAMEFORMAT_ATTRIB_NAME);\r
+        const XMLCh* format = child->getAttributeNS(NULL, saml2::Attribute::NAMEFORMAT_ATTRIB_NAME);\r
         if (!format || XMLString::equals(format, shibspconstants::SHIB1_ATTRIBUTE_NAMESPACE_URI) ||\r
-                XMLString::equals(format, opensaml::saml2::Attribute::URI_REFERENCE))\r
+                XMLString::equals(format, saml2::Attribute::URI_REFERENCE))\r
             format = &chNull;  // ignore default Format/Namespace values\r
 \r
         // Fetch/create the map entry and see if it's a duplicate rule.\r
@@ -290,7 +290,7 @@ SimpleResolverImpl::SimpleResolverImpl(const DOMElement* e) : m_document(NULL),
 #endif\r
         if (decl.first) {\r
             log.warn("skipping duplicate saml:Attribute declaration (same Name and NameFormat)");\r
-            child = XMLHelper::getNextSiblingElement(child, samlconstants::SAML20_NS, opensaml::saml2::Attribute::LOCAL_NAME);\r
+            child = XMLHelper::getNextSiblingElement(child, samlconstants::SAML20_NS, saml2::Attribute::LOCAL_NAME);\r
             continue;\r
         }\r
 \r
@@ -305,12 +305,12 @@ SimpleResolverImpl::SimpleResolverImpl(const DOMElement* e) : m_document(NULL),
         decl.first = decoder;\r
         decl.second = id.get();\r
         \r
-        child = XMLHelper::getNextSiblingElement(child, samlconstants::SAML20_NS, opensaml::saml2::Attribute::LOCAL_NAME);\r
+        child = XMLHelper::getNextSiblingElement(child, samlconstants::SAML20_NS, saml2::Attribute::LOCAL_NAME);\r
     }\r
 }\r
 \r
 void SimpleResolverImpl::resolve(\r
-    ResolutionContext& ctx, const opensaml::saml1::Assertion* token, const vector<const char*>* attributes\r
+    ResolutionContext& ctx, const saml1::Assertion* token, const vector<const char*>* attributes\r
     ) const\r
 {\r
     set<string> aset;\r
@@ -350,10 +350,10 @@ void SimpleResolverImpl::resolve(
         }\r
     }\r
 \r
-    const vector<opensaml::saml1::AttributeStatement*>& statements = token->getAttributeStatements();\r
-    for (vector<opensaml::saml1::AttributeStatement*>::const_iterator s = statements.begin(); s!=statements.end(); ++s) {\r
-        const vector<opensaml::saml1::Attribute*>& attrs = const_cast<const opensaml::saml1::AttributeStatement*>(*s)->getAttributes();\r
-        for (vector<opensaml::saml1::Attribute*>::const_iterator a = attrs.begin(); a!=attrs.end(); ++a) {\r
+    const vector<saml1::AttributeStatement*>& statements = token->getAttributeStatements();\r
+    for (vector<saml1::AttributeStatement*>::const_iterator s = statements.begin(); s!=statements.end(); ++s) {\r
+        const vector<saml1::Attribute*>& attrs = const_cast<const saml1::AttributeStatement*>(*s)->getAttributes();\r
+        for (vector<saml1::Attribute*>::const_iterator a = attrs.begin(); a!=attrs.end(); ++a) {\r
             name = (*a)->getAttributeName();\r
             format = (*a)->getAttributeNamespace();\r
             if (!name || !*name)\r
@@ -378,7 +378,7 @@ void SimpleResolverImpl::resolve(
 }\r
 \r
 void SimpleResolverImpl::resolve(\r
-    ResolutionContext& ctx, const opensaml::saml2::Assertion* token, const vector<const char*>* attributes\r
+    ResolutionContext& ctx, const saml2::Assertion* token, const vector<const char*>* attributes\r
     ) const\r
 {\r
     set<string> aset;\r
@@ -418,10 +418,10 @@ void SimpleResolverImpl::resolve(
         }\r
     }\r
 \r
-    const vector<opensaml::saml2::AttributeStatement*>& statements = token->getAttributeStatements();\r
-    for (vector<opensaml::saml2::AttributeStatement*>::const_iterator s = statements.begin(); s!=statements.end(); ++s) {\r
-        const vector<opensaml::saml2::Attribute*>& attrs = const_cast<const opensaml::saml2::AttributeStatement*>(*s)->getAttributes();\r
-        for (vector<opensaml::saml2::Attribute*>::const_iterator a = attrs.begin(); a!=attrs.end(); ++a) {\r
+    const vector<saml2::AttributeStatement*>& statements = token->getAttributeStatements();\r
+    for (vector<saml2::AttributeStatement*>::const_iterator s = statements.begin(); s!=statements.end(); ++s) {\r
+        const vector<saml2::Attribute*>& attrs = const_cast<const saml2::AttributeStatement*>(*s)->getAttributes();\r
+        for (vector<saml2::Attribute*>::const_iterator a = attrs.begin(); a!=attrs.end(); ++a) {\r
             name = (*a)->getName();\r
             format = (*a)->getNameFormat();\r
             if (!name || !*name)\r
@@ -473,7 +473,7 @@ void SimpleResolverImpl::query(ResolutionContext& ctx, const NameIdentifier& nam
     shibsp::SOAPClient soaper(ctx.getApplication(),policy);\r
 \r
     auto_ptr_XMLCh binding(samlconstants::SAML1_BINDING_SOAP);\r
-    opensaml::saml1p::Response* response=NULL;\r
+    saml1p::Response* response=NULL;\r
     const vector<AttributeService*>& endpoints=AA->getAttributeServices();\r
     for (vector<AttributeService*>::const_iterator ep=endpoints.begin(); !response && ep!=endpoints.end(); ++ep) {\r
         try {\r
@@ -481,9 +481,9 @@ void SimpleResolverImpl::query(ResolutionContext& ctx, const NameIdentifier& nam
                 continue;\r
             auto_ptr_char loc((*ep)->getLocation());\r
             auto_ptr_XMLCh issuer(ctx.getApplication().getString("providerId").second);\r
-            opensaml::saml1::Subject* subject = opensaml::saml1::SubjectBuilder::buildSubject();\r
+            saml1::Subject* subject = saml1::SubjectBuilder::buildSubject();\r
             subject->setNameIdentifier(nameid.cloneNameIdentifier());\r
-            opensaml::saml1p::AttributeQuery* query = opensaml::saml1p::AttributeQueryBuilder::buildAttributeQuery();\r
+            saml1p::AttributeQuery* query = saml1p::AttributeQueryBuilder::buildAttributeQuery();\r
             query->setSubject(subject);\r
             Request* request = RequestBuilder::buildRequest();\r
             request->setAttributeQuery(query);\r
@@ -506,10 +506,10 @@ void SimpleResolverImpl::query(ResolutionContext& ctx, const NameIdentifier& nam
 \r
     time_t now = time(NULL);\r
     const Validator* tokval = ctx.getApplication().getTokenValidator(now, AA);\r
-    const vector<opensaml::saml1::Assertion*>& assertions = const_cast<const opensaml::saml1p::Response*>(response)->getAssertions();\r
+    const vector<saml1::Assertion*>& assertions = const_cast<const saml1p::Response*>(response)->getAssertions();\r
     if (assertions.size()==1) {\r
-        auto_ptr<opensaml::saml1p::Response> wrapper(response);\r
-        opensaml::saml1::Assertion* newtoken = assertions.front();\r
+        auto_ptr<saml1p::Response> wrapper(response);\r
+        saml1::Assertion* newtoken = assertions.front();\r
         if (!XMLString::equals(policy.getIssuer() ? policy.getIssuer()->getName() : NULL, newtoken->getIssuer())) {\r
             log.error("assertion issued by someone other than AA, rejecting it");\r
             return;\r
@@ -526,8 +526,8 @@ void SimpleResolverImpl::query(ResolutionContext& ctx, const NameIdentifier& nam
         resolve(ctx, newtoken, attributes);\r
     }\r
     else {\r
-        auto_ptr<opensaml::saml1p::Response> wrapper(response);\r
-        for (vector<opensaml::saml1::Assertion*>::const_iterator a = assertions.begin(); a!=assertions.end(); ++a) {\r
+        auto_ptr<saml1p::Response> wrapper(response);\r
+        for (vector<saml1::Assertion*>::const_iterator a = assertions.begin(); a!=assertions.end(); ++a) {\r
             if (!XMLString::equals(policy.getIssuer() ? policy.getIssuer()->getName() : NULL, (*a)->getIssuer())) {\r
                 log.error("assertion issued by someone other than AA, rejecting it");\r
                 continue;\r
@@ -566,7 +566,7 @@ void SimpleResolverImpl::query(ResolutionContext& ctx, const NameID& nameid, con
     shibsp::SOAPClient soaper(ctx.getApplication(),policy);\r
 \r
     auto_ptr_XMLCh binding(samlconstants::SAML20_BINDING_SOAP);\r
-    opensaml::saml2p::StatusResponseType* srt=NULL;\r
+    saml2p::StatusResponseType* srt=NULL;\r
     const vector<AttributeService*>& endpoints=AA->getAttributeServices();\r
     for (vector<AttributeService*>::const_iterator ep=endpoints.begin(); !srt && ep!=endpoints.end(); ++ep) {\r
         try {\r
@@ -574,9 +574,9 @@ void SimpleResolverImpl::query(ResolutionContext& ctx, const NameID& nameid, con
                 continue;\r
             auto_ptr_char loc((*ep)->getLocation());\r
             auto_ptr_XMLCh issuer(ctx.getApplication().getString("providerId").second);\r
-            opensaml::saml2::Subject* subject = opensaml::saml2::SubjectBuilder::buildSubject();\r
+            saml2::Subject* subject = saml2::SubjectBuilder::buildSubject();\r
             subject->setNameID(nameid.cloneNameID());\r
-            opensaml::saml2p::AttributeQuery* query = opensaml::saml2p::AttributeQueryBuilder::buildAttributeQuery();\r
+            saml2p::AttributeQuery* query = saml2p::AttributeQueryBuilder::buildAttributeQuery();\r
             query->setSubject(subject);\r
             Issuer* iss = IssuerBuilder::buildIssuer();\r
             query->setIssuer(iss);\r
@@ -595,7 +595,7 @@ void SimpleResolverImpl::query(ResolutionContext& ctx, const NameID& nameid, con
         log.error("unable to successfully query for attributes");\r
         return;\r
     }\r
-    opensaml::saml2p::Response* response = dynamic_cast<opensaml::saml2p::Response*>(srt);\r
+    saml2p::Response* response = dynamic_cast<saml2p::Response*>(srt);\r
     if (!response) {\r
         delete srt;\r
         log.error("message was not a samlp:Response");\r
@@ -604,10 +604,10 @@ void SimpleResolverImpl::query(ResolutionContext& ctx, const NameID& nameid, con
 \r
     time_t now = time(NULL);\r
     const Validator* tokval = ctx.getApplication().getTokenValidator(now, AA);\r
-    const vector<opensaml::saml2::Assertion*>& assertions = const_cast<const opensaml::saml2p::Response*>(response)->getAssertions();\r
+    const vector<saml2::Assertion*>& assertions = const_cast<const saml2p::Response*>(response)->getAssertions();\r
     if (assertions.size()==1) {\r
-        auto_ptr<opensaml::saml2p::Response> wrapper(response);\r
-        opensaml::saml2::Assertion* newtoken = assertions.front();\r
+        auto_ptr<saml2p::Response> wrapper(response);\r
+        saml2::Assertion* newtoken = assertions.front();\r
         if (!XMLString::equals(policy.getIssuer() ? policy.getIssuer()->getName() : NULL, newtoken->getIssuer() ? newtoken->getIssuer()->getName() : NULL)) {\r
             log.error("assertion issued by someone other than AA, rejecting it");\r
             return;\r
@@ -624,8 +624,8 @@ void SimpleResolverImpl::query(ResolutionContext& ctx, const NameID& nameid, con
         resolve(ctx, newtoken, attributes);\r
     }\r
     else {\r
-        auto_ptr<opensaml::saml2p::Response> wrapper(response);\r
-        for (vector<opensaml::saml2::Assertion*>::const_iterator a = assertions.begin(); a!=assertions.end(); ++a) {\r
+        auto_ptr<saml2p::Response> wrapper(response);\r
+        for (vector<saml2::Assertion*>::const_iterator a = assertions.begin(); a!=assertions.end(); ++a) {\r
             if (!XMLString::equals(policy.getIssuer() ? policy.getIssuer()->getName() : NULL, (*a)->getIssuer() ? (*a)->getIssuer()->getName() : NULL)) {\r
                 log.error("assertion issued by someone other than AA, rejecting it");\r
                 return;\r
@@ -652,18 +652,18 @@ void SimpleResolver::resolveAttributes(ResolutionContext& ctx, const vector<cons
     log.debug("examining tokens to resolve");\r
 \r
     bool query = m_impl->m_allowQuery;\r
-    const opensaml::saml1::Assertion* token1;\r
-    const opensaml::saml2::Assertion* token2;\r
+    const saml1::Assertion* token1;\r
+    const saml2::Assertion* token2;\r
     if (ctx.getTokens()) {\r
-        for (vector<const opensaml::RootObject*>::const_iterator t = ctx.getTokens()->begin(); t!=ctx.getTokens()->end(); ++t) {\r
-            token2 = dynamic_cast<const opensaml::saml2::Assertion*>(*t);\r
+        for (vector<const opensaml::Assertion*>::const_iterator t = ctx.getTokens()->begin(); t!=ctx.getTokens()->end(); ++t) {\r
+            token2 = dynamic_cast<const saml2::Assertion*>(*t);\r
             if (token2 && !token2->getAttributeStatements().empty()) {\r
                 log.debug("resolving SAML 2 token with an AttributeStatement");\r
                 m_impl->resolve(ctx, token2, attributes);\r
                 query = false;\r
             }\r
             else {\r
-                token1 = dynamic_cast<const opensaml::saml1::Assertion*>(*t);\r
+                token1 = dynamic_cast<const saml1::Assertion*>(*t);\r
                 if (token1 && !token1->getAttributeStatements().empty()) {\r
                     log.debug("resolving SAML 1 token with an AttributeStatement");\r
                     m_impl->resolve(ctx, token1, attributes);\r
index 5422264..62b0a71 100644 (file)
@@ -60,6 +60,9 @@ SOAPClient::SOAPClient(const Application& application, opensaml::SecurityPolicy&
         policy.addRule(*rule);
     policy.setMetadataProvider(application.getMetadataProvider());
     policy.setTrustEngine(application.getTrustEngine());
+    pair<bool,bool> validate = m_settings->getBool("validate");
+    policy.setValidating(validate.first && validate.second);
+    setValidating(validate.first && validate.second);
 }
 
 void SOAPClient::send(const soap11::Envelope& env, const KeyInfoSource& peer, const char* endpoint)
index f23a057..474f2a5 100644 (file)
@@ -79,7 +79,7 @@ namespace shibsp {
             m_obj.destroy();\r
             delete m_nameid;\r
             for_each(m_attributes.begin(), m_attributes.end(), cleanup_const_pair<string,Attribute>());\r
-            for_each(m_tokens.begin(), m_tokens.end(), cleanup_pair<string,RootObject>());\r
+            for_each(m_tokens.begin(), m_tokens.end(), cleanup_pair<string,Assertion>());\r
         }\r
         \r
         Lockable* lock() {\r
@@ -130,12 +130,12 @@ namespace shibsp {
             return m_ids;\r
         }\r
         \r
-        const RootObject* getAssertion(const char* id) const;\r
+        const Assertion* getAssertion(const char* id) const;\r
 \r
         void addAttributes(const vector<Attribute*>& attributes) {\r
             throw ConfigurationException("addAttributes method not implemented by this session cache plugin.");\r
         }\r
-        void addAssertion(RootObject* assertion) {\r
+        void addAssertion(Assertion* assertion) {\r
             throw ConfigurationException("addAssertion method not implemented by this session cache plugin.");\r
         }\r
 \r
@@ -151,7 +151,7 @@ namespace shibsp {
         saml2::NameID* m_nameid;\r
         mutable map<string,const Attribute*> m_attributes;\r
         mutable vector<const char*> m_ids;\r
-        mutable map<string,RootObject*> m_tokens;\r
+        mutable map<string,Assertion*> m_tokens;\r
         time_t m_expires,m_lastAccess;\r
         RemotedCache* m_cache;\r
         Mutex* m_lock;\r
@@ -173,7 +173,7 @@ namespace shibsp {
             const char* session_index=NULL,\r
             const char* authncontext_class=NULL,\r
             const char* authncontext_decl=NULL,\r
-            const vector<const RootObject*>* tokens=NULL,\r
+            const vector<const Assertion*>* tokens=NULL,\r
             const vector<Attribute*>* attributes=NULL\r
             );\r
         Session* find(const char* key, const Application& application, const char* client_addr=NULL, time_t timeout=0);\r
@@ -220,9 +220,9 @@ void RemotedSession::unmarshallAttributes() const
     }\r
 }\r
 \r
-const RootObject* RemotedSession::getAssertion(const char* id) const\r
+const Assertion* RemotedSession::getAssertion(const char* id) const\r
 {\r
-    map<string,RootObject*>::const_iterator i = m_tokens.find(id);\r
+    map<string,Assertion*>::const_iterator i = m_tokens.find(id);\r
     if (i!=m_tokens.end())\r
         return i->second;\r
 \r
@@ -243,8 +243,8 @@ const RootObject* RemotedSession::getAssertion(const char* id) const
     auto_ptr<XMLObject> xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true));\r
     janitor.release();\r
     \r
-    RootObject* token = dynamic_cast<RootObject*>(xmlObject.get());\r
-    if (!token || !token->isAssertion())\r
+    Assertion* token = dynamic_cast<Assertion*>(xmlObject.get());\r
+    if (!token)\r
         throw FatalProfileException("Cached assertion was of an unknown object type.");\r
 \r
     // Transfer ownership to us.\r
@@ -359,7 +359,7 @@ string RemotedCache::insert(
     const char* session_index,\r
     const char* authncontext_class,\r
     const char* authncontext_decl,\r
-    const vector<const RootObject*>* tokens,\r
+    const vector<const Assertion*>* tokens,\r
     const vector<Attribute*>* attributes\r
     )\r
 {\r
@@ -399,7 +399,7 @@ string RemotedCache::insert(
     if (tokens) {\r
         in.addmember("assertions").list();\r
         in.addmember("tokens").list();\r
-        for (vector<const RootObject*>::const_iterator t = tokens->begin(); t!=tokens->end(); ++t) {\r
+        for (vector<const Assertion*>::const_iterator t = tokens->begin(); t!=tokens->end(); ++t) {\r
             ostringstream tokenstr;\r
             tokenstr << *(*t);\r
             auto_ptr_char tokenid((*t)->getID());\r
@@ -704,9 +704,9 @@ void RemotedSession::addAttributes(const vector<Attribute*>& attributes)
     m_attributes.insert(m_attributes.end(), attributes.begin(), attributes.end());\r
 }\r
 \r
-void RemotedSession::addAssertion(RootObject* assertion)\r
+void RemotedSession::addAssertion(Assertion* assertion)\r
 {\r
-    if (!assertion || !assertion->isAssertion())\r
+    if (!assertion)\r
         throw FatalProfileException("Unknown object type passed to session cache for storage.");\r
 \r
     DDF in("addAssertion::"REMOTED_SESSION_CACHE);\r
index 2487f98..142b77c 100644 (file)
@@ -120,8 +120,8 @@ namespace shibsp {
         }\r
         \r
         void addAttributes(const vector<Attribute*>& attributes);\r
-        const RootObject* getAssertion(const char* id) const;\r
-        void addAssertion(RootObject* assertion);\r
+        const Assertion* getAssertion(const char* id) const;\r
+        void addAssertion(Assertion* assertion);\r
 \r
     private:\r
         void unmarshallAttributes() const;\r
@@ -130,7 +130,7 @@ namespace shibsp {
         saml2::NameID* m_nameid;\r
         mutable map<string,const Attribute*> m_attributes;\r
         mutable vector<const char*> m_ids;\r
-        mutable map<string,RootObject*> m_tokens;\r
+        mutable map<string,Assertion*> m_tokens;\r
         SSCache* m_cache;\r
     };\r
     \r
@@ -152,7 +152,7 @@ namespace shibsp {
             const char* session_index=NULL,\r
             const char* authncontext_class=NULL,\r
             const char* authncontext_decl=NULL,\r
-            const vector<const RootObject*>* tokens=NULL,\r
+            const vector<const Assertion*>* tokens=NULL,\r
             const vector<Attribute*>* attributes=NULL\r
             );\r
         Session* find(const char* key, const Application& application, const char* client_addr=NULL, time_t timeout=0);\r
@@ -175,7 +175,7 @@ StoredSession::~StoredSession()
     m_obj.destroy();\r
     delete m_nameid;\r
     for_each(m_attributes.begin(), m_attributes.end(), cleanup_const_pair<string,Attribute>());\r
-    for_each(m_tokens.begin(), m_tokens.end(), cleanup_pair<string,RootObject>());\r
+    for_each(m_tokens.begin(), m_tokens.end(), cleanup_pair<string,Assertion>());\r
 }\r
 \r
 void StoredSession::unmarshallAttributes() const\r
@@ -288,9 +288,9 @@ void StoredSession::addAttributes(const vector<Attribute*>& attributes)
     for_each(attributes.begin(), attributes.end(), xmltooling::cleanup<Attribute>());\r
 }\r
 \r
-const RootObject* StoredSession::getAssertion(const char* id) const\r
+const Assertion* StoredSession::getAssertion(const char* id) const\r
 {\r
-    map<string,RootObject*>::const_iterator i = m_tokens.find(id);\r
+    map<string,Assertion*>::const_iterator i = m_tokens.find(id);\r
     if (i!=m_tokens.end())\r
         return i->second;\r
     \r
@@ -305,8 +305,8 @@ const RootObject* StoredSession::getAssertion(const char* id) const
     auto_ptr<XMLObject> xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true));\r
     janitor.release();\r
     \r
-    RootObject* token = dynamic_cast<RootObject*>(xmlObject.get());\r
-    if (!token || !token->isAssertion())\r
+    Assertion* token = dynamic_cast<Assertion*>(xmlObject.get());\r
+    if (!token)\r
         throw FatalProfileException("Request for cached assertion returned an unknown object type.");\r
 \r
     // Transfer ownership to us.\r
@@ -315,13 +315,13 @@ const RootObject* StoredSession::getAssertion(const char* id) const
     return token;\r
 }\r
 \r
-void StoredSession::addAssertion(RootObject* assertion)\r
+void StoredSession::addAssertion(Assertion* assertion)\r
 {\r
 #ifdef _DEBUG\r
     xmltooling::NDC ndc("addAssertion");\r
 #endif\r
     \r
-    if (!assertion || !assertion->isAssertion())\r
+    if (!assertion)\r
         throw FatalProfileException("Unknown object type passed to session for storage.");\r
 \r
     auto_ptr_char id(assertion->getID());\r
@@ -455,7 +455,7 @@ string SSCache::insert(
     const char* session_index,\r
     const char* authncontext_class,\r
     const char* authncontext_decl,\r
-    const vector<const RootObject*>* tokens,\r
+    const vector<const Assertion*>* tokens,\r
     const vector<Attribute*>* attributes\r
     )\r
 {\r
@@ -503,7 +503,7 @@ string SSCache::insert(
     \r
     if (tokens) {\r
         obj.addmember("assertions").list();\r
-        for (vector<const RootObject*>::const_iterator t = tokens->begin(); t!=tokens->end(); ++t) {\r
+        for (vector<const Assertion*>::const_iterator t = tokens->begin(); t!=tokens->end(); ++t) {\r
             auto_ptr_char tokenid((*t)->getID());\r
             DDF tokid = DDF(NULL).string(tokenid.get());\r
             obj["assertions"].add(tokid);\r
@@ -527,7 +527,7 @@ string SSCache::insert(
     m_storage->createText(key.get(), "session", record.str().c_str(), now + m_cacheTimeout);\r
     if (tokens) {\r
         try {\r
-            for (vector<const RootObject*>::const_iterator t = tokens->begin(); t!=tokens->end(); ++t) {\r
+            for (vector<const Assertion*>::const_iterator t = tokens->begin(); t!=tokens->end(); ++t) {\r
                 ostringstream tokenstr;\r
                 tokenstr << *(*t);\r
                 auto_ptr_char tokenid((*t)->getID());\r
index 33d540c..b419c2e 100644 (file)
@@ -122,7 +122,7 @@ namespace {
         const vector<const XMLCh*>& getAudiences() const {\r
             return (m_audiences.empty() && m_base) ? m_base->getAudiences() : m_audiences;\r
         }\r
-        Validator* getTokenValidator(time_t ts=0, const opensaml::saml2md::RoleDescriptor* role=NULL) const {\r
+        Validator* getTokenValidator(time_t ts=0, const saml2md::RoleDescriptor* role=NULL) const {\r
             return new TokenValidator(*this, ts, role);\r
         }\r
 \r
@@ -365,10 +365,10 @@ void TokenValidator::validate(const XMLObject* xmlObject) const
 #endif\r
     Category& log=Category::getInstance(SHIBSP_LOGCAT".Application");\r
 \r
-    const opensaml::RootObject* root = NULL;\r
-    const opensaml::saml2::Assertion* token2 = dynamic_cast<const opensaml::saml2::Assertion*>(xmlObject);\r
+    const opensaml::Assertion* root = NULL;\r
+    const saml2::Assertion* token2 = dynamic_cast<const saml2::Assertion*>(xmlObject);\r
     if (token2) {\r
-        const opensaml::saml2::Conditions* conds = token2->getConditions();\r
+        const saml2::Conditions* conds = token2->getConditions();\r
         // First verify the time conditions, using the specified timestamp, if non-zero.\r
         if (m_ts>0 && conds) {\r
             unsigned int skew = XMLToolingConfig::getConfig().clock_skew_secs;\r
@@ -381,9 +381,9 @@ void TokenValidator::validate(const XMLObject* xmlObject) const
         }\r
 \r
         // Now we process conditions. Only audience restrictions at the moment.\r
-        const vector<opensaml::saml2::Condition*>& convec = conds->getConditions();\r
-        for (vector<opensaml::saml2::Condition*>::const_iterator c = convec.begin(); c!=convec.end(); ++c) {\r
-            const opensaml::saml2::AudienceRestriction* ac=dynamic_cast<const opensaml::saml2::AudienceRestriction*>(*c);\r
+        const vector<saml2::Condition*>& convec = conds->getConditions();\r
+        for (vector<saml2::Condition*>::const_iterator c = convec.begin(); c!=convec.end(); ++c) {\r
+            const saml2::AudienceRestriction* ac=dynamic_cast<const saml2::AudienceRestriction*>(*c);\r
             if (!ac) {\r
                 log.error("unrecognized Condition in assertion (%s)",\r
                     (*c)->getSchemaType() ? (*c)->getSchemaType()->toString().c_str() : (*c)->getElementQName().toString().c_str());\r
@@ -391,9 +391,9 @@ void TokenValidator::validate(const XMLObject* xmlObject) const
             }\r
 \r
             bool found = false;\r
-            const vector<opensaml::saml2::Audience*>& auds1 = ac->getAudiences();\r
+            const vector<saml2::Audience*>& auds1 = ac->getAudiences();\r
             const vector<const XMLCh*>& auds2 = m_app.getAudiences();\r
-            for (vector<opensaml::saml2::Audience*>::const_iterator a = auds1.begin(); !found && a!=auds1.end(); ++a) {\r
+            for (vector<saml2::Audience*>::const_iterator a = auds1.begin(); !found && a!=auds1.end(); ++a) {\r
                 for (vector<const XMLCh*>::const_iterator a2 = auds2.begin(); !found && a2!=auds2.end(); ++a2) {\r
                     found = XMLString::equals((*a)->getAudienceURI(), *a2);\r
                 }\r
@@ -410,9 +410,9 @@ void TokenValidator::validate(const XMLObject* xmlObject) const
         root = token2;\r
     }\r
     else {\r
-        const opensaml::saml1::Assertion* token1 = dynamic_cast<const opensaml::saml1::Assertion*>(xmlObject);\r
+        const saml1::Assertion* token1 = dynamic_cast<const saml1::Assertion*>(xmlObject);\r
         if (token1) {\r
-            const opensaml::saml1::Conditions* conds = token1->getConditions();\r
+            const saml1::Conditions* conds = token1->getConditions();\r
             // First verify the time conditions, using the specified timestamp, if non-zero.\r
             if (m_ts>0 && conds) {\r
                 unsigned int skew = XMLToolingConfig::getConfig().clock_skew_secs;\r
@@ -425,9 +425,9 @@ void TokenValidator::validate(const XMLObject* xmlObject) const
             }\r
 \r
             // Now we process conditions. Only audience restrictions at the moment.\r
-            const vector<opensaml::saml1::Condition*>& convec = conds->getConditions();\r
-            for (vector<opensaml::saml1::Condition*>::const_iterator c = convec.begin(); c!=convec.end(); ++c) {\r
-                const opensaml::saml1::AudienceRestrictionCondition* ac=dynamic_cast<const opensaml::saml1::AudienceRestrictionCondition*>(*c);\r
+            const vector<saml1::Condition*>& convec = conds->getConditions();\r
+            for (vector<saml1::Condition*>::const_iterator c = convec.begin(); c!=convec.end(); ++c) {\r
+                const saml1::AudienceRestrictionCondition* ac=dynamic_cast<const saml1::AudienceRestrictionCondition*>(*c);\r
                 if (!ac) {\r
                     log.error("unrecognized Condition in assertion (%s)",\r
                         (*c)->getSchemaType() ? (*c)->getSchemaType()->toString().c_str() : (*c)->getElementQName().toString().c_str());\r
@@ -435,9 +435,9 @@ void TokenValidator::validate(const XMLObject* xmlObject) const
                 }\r
 \r
                 bool found = false;\r
-                const vector<opensaml::saml1::Audience*>& auds1 = ac->getAudiences();\r
+                const vector<saml1::Audience*>& auds1 = ac->getAudiences();\r
                 const vector<const XMLCh*>& auds2 = m_app.getAudiences();\r
-                for (vector<opensaml::saml1::Audience*>::const_iterator a = auds1.begin(); !found && a!=auds1.end(); ++a) {\r
+                for (vector<saml1::Audience*>::const_iterator a = auds1.begin(); !found && a!=auds1.end(); ++a) {\r
                     for (vector<const XMLCh*>::const_iterator a2 = auds2.begin(); !found && a2!=auds2.end(); ++a2) {\r
                         found = XMLString::equals((*a)->getAudienceURI(), *a2);\r
                     }\r
@@ -666,7 +666,7 @@ XMLApplication::XMLApplication(
             while (child) {\r
                 DOMPropertySet* rp=new DOMPropertySet();\r
                 rp->load(child,log,this);\r
-                m_credMap[child->getAttributeNS(NULL,opensaml::saml2::Attribute::NAME_ATTRIB_NAME)]=rp;\r
+                m_credMap[child->getAttributeNS(NULL,saml2::Attribute::NAME_ATTRIB_NAME)]=rp;\r
                 child = XMLHelper::getNextSiblingElement(child,RelyingParty);\r
             }\r
         }\r
@@ -706,7 +706,7 @@ void XMLApplication::cleanup()
 \r
 short XMLApplication::acceptNode(const DOMNode* node) const\r
 {\r
-    if (XMLHelper::isNodeNamed(node,samlconstants::SAML20_NS,opensaml::saml2::Attribute::LOCAL_NAME))\r
+    if (XMLHelper::isNodeNamed(node,samlconstants::SAML20_NS,saml2::Attribute::LOCAL_NAME))\r
         return FILTER_REJECT;\r
     else if (XMLHelper::isNodeNamed(node,samlconstants::SAML20_NS,Audience::LOCAL_NAME))\r
         return FILTER_REJECT;\r