X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml2%2Fcore%2Fimpl%2FAssertions20Impl.cpp;h=7535d782d05371367e1bf4c9e3fc84830fd0a1a5;hb=66136f386ddbdd855e1a078e13e19ddbf64a01e2;hp=532f6ad1db478009ab8f36fad7593ff9558b2924;hpb=0ba5816a876bed78a05d9ed77db97b809927f1c0;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/saml2/core/impl/Assertions20Impl.cpp b/saml/saml2/core/impl/Assertions20Impl.cpp index 532f6ad..7535d78 100644 --- a/saml/saml2/core/impl/Assertions20Impl.cpp +++ b/saml/saml2/core/impl/Assertions20Impl.cpp @@ -25,9 +25,7 @@ #include "saml/encryption/EncryptedKeyResolver.h" #include "saml2/core/Assertions.h" -#include #include -#include #include #include #include @@ -44,6 +42,9 @@ using namespace xmlencryption; using namespace xmlsignature; using namespace xmltooling; using namespace std; +using xmlconstants::XMLSIG_NS; +using xmlconstants::XMLENC_NS; +using samlconstants::SAML20_NS; #if defined (_MSC_VER) #pragma warning( push ) @@ -62,7 +63,6 @@ namespace opensaml { class SAML_DLLLOCAL NameIDTypeImpl : public virtual NameIDType, public AbstractSimpleElement, - public AbstractChildlessElement, public AbstractDOMCachingXMLObject, public AbstractXMLObjectMarshaller, public AbstractXMLObjectUnmarshaller @@ -103,7 +103,6 @@ namespace opensaml { IMPL_STRING_ATTRIB(SPNameQualifier); IMPL_STRING_ATTRIB(Format); IMPL_STRING_ATTRIB(SPProvidedID); - IMPL_XMLOBJECT_CONTENT; protected: void marshallAttributes(DOMElement* domElement) const { @@ -182,7 +181,7 @@ namespace opensaml { } EncryptedElementTypeImpl(const EncryptedElementTypeImpl& src) - : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); if (src.getEncryptedData()) setEncryptedData(src.getEncryptedData()->cloneEncryptedData()); @@ -218,8 +217,8 @@ namespace opensaml { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLConstants::XMLENC_NS,false); - PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLConstants::XMLENC_NS,false); + PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLENC_NS,false); + PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLENC_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -254,7 +253,8 @@ namespace opensaml { : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - AudienceRestrictionImpl(const AudienceRestrictionImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + AudienceRestrictionImpl(const AudienceRestrictionImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { VectorOf(Audience) v=getAudiences(); for (vector::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) { if (*i) { @@ -271,13 +271,13 @@ namespace opensaml { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(Audience,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(Audience,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; class SAML_DLLLOCAL OneTimeUseImpl : public virtual OneTimeUse, - public AbstractChildlessElement, + public AbstractSimpleElement, public AbstractDOMCachingXMLObject, public AbstractXMLObjectMarshaller, public AbstractXMLObjectUnmarshaller @@ -289,7 +289,8 @@ namespace opensaml { : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - OneTimeUseImpl(const OneTimeUseImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + OneTimeUseImpl(const OneTimeUseImpl& src) + : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) { } IMPL_XMLOBJECT_CLONE(OneTimeUse); @@ -314,7 +315,8 @@ namespace opensaml { m_Count=NULL; } - ProxyRestrictionImpl(const ProxyRestrictionImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + ProxyRestrictionImpl(const ProxyRestrictionImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { setCount(src.m_Count); VectorOf(Audience) v=getAudiences(); for (vector::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) { @@ -337,7 +339,7 @@ namespace opensaml { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(Audience,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(Audience,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } @@ -368,7 +370,8 @@ namespace opensaml { init(); } - ConditionsImpl(const ConditionsImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + ConditionsImpl(const ConditionsImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); setNotBefore(src.getNotBefore()); setNotOnOrAfter(src.getNotOnOrAfter()); @@ -417,10 +420,10 @@ namespace opensaml { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(AudienceRestriction,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(OneTimeUse,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(ProxyRestriction,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(Condition,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(AudienceRestriction,SAML20_NS,false); + PROC_TYPED_CHILDREN(OneTimeUse,SAML20_NS,false); + PROC_TYPED_CHILDREN(ProxyRestriction,SAML20_NS,false); + PROC_TYPED_CHILDREN(Condition,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } @@ -468,7 +471,7 @@ namespace opensaml { IMPL_STRING_ATTRIB(Address); public: - void setAttribute(QName& qualifiedName, const XMLCh* value) { + void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) { if (!qualifiedName.hasNamespaceURI()) { if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) { setNotBefore(value); @@ -491,7 +494,7 @@ namespace opensaml { return; } } - AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value); + AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID); } protected: @@ -533,7 +536,8 @@ namespace opensaml { } KeyInfoConfirmationDataTypeImpl(const KeyInfoConfirmationDataTypeImpl& src) - : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) { + : AbstractXMLObject(src), AbstractComplexElement(src), + AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) { init(); setNotBefore(src.getNotBefore()); setNotOnOrAfter(src.getNotOnOrAfter()); @@ -541,11 +545,8 @@ namespace opensaml { setInResponseTo(src.getInResponseTo()); setAddress(src.getAddress()); VectorOf(KeyInfo) v=getKeyInfos(); - for (vector::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); i++) { - if (*i) { - v.push_back((*i)->cloneKeyInfo()); - } - } + for (vector::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); ++i) + v.push_back((*i)->cloneKeyInfo()); } IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType); @@ -557,7 +558,7 @@ namespace opensaml { IMPL_TYPED_CHILDREN(KeyInfo,m_children.end()); public: - void setAttribute(QName& qualifiedName, const XMLCh* value) { + void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) { if (!qualifiedName.hasNamespaceURI()) { if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) { setNotBefore(value); @@ -580,7 +581,7 @@ namespace opensaml { return; } } - AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value); + AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID); } protected: @@ -590,25 +591,16 @@ namespace opensaml { MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL); MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL); MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL); - - // Take care of wildcard. - for (map::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) { - DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart()); - if (i->first.hasPrefix()) - attr->setPrefix(i->first.getPrefix()); - attr->setNodeValue(i->second); - domElement->setAttributeNode(attr); - } + marshallExtensionAttributes(domElement); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(KeyInfo,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILDREN(KeyInfo,XMLSIG_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } void processAttribute(const DOMAttr* attribute) { - QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix()); - setAttribute(q,attribute->getNodeValue()); + unmarshallExtensionAttribute(attribute); } }; @@ -647,7 +639,8 @@ namespace opensaml { init(); } - SubjectConfirmationImpl(const SubjectConfirmationImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + SubjectConfirmationImpl(const SubjectConfirmationImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); setMethod(src.getMethod()); if (src.getBaseID()) @@ -676,11 +669,11 @@ namespace opensaml { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(BaseID,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(NameID,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(EncryptedID,SAMLConstants::SAML20_NS,false); - PROC_XMLOBJECT_CHILD(SubjectConfirmationData,SAMLConstants::SAML20_NS); - PROC_TYPED_CHILD(KeyInfoConfirmationDataType,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(BaseID,SAML20_NS,false); + PROC_TYPED_CHILD(NameID,SAML20_NS,false); + PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false); + PROC_TYPED_CHILD(KeyInfoConfirmationDataType,SAML20_NS,false); + PROC_XMLOBJECT_CHILD(SubjectConfirmationData,SAML20_NS); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } @@ -717,7 +710,8 @@ namespace opensaml { init(); } - SubjectImpl(const SubjectImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + SubjectImpl(const SubjectImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); if (src.getBaseID()) setBaseID(src.getBaseID()->cloneBaseID()); @@ -741,16 +735,16 @@ namespace opensaml { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(BaseID,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(NameID,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(EncryptedID,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(SubjectConfirmation,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(BaseID,SAML20_NS,false); + PROC_TYPED_CHILD(NameID,SAML20_NS,false); + PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false); + PROC_TYPED_CHILDREN(SubjectConfirmation,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; class SAML_DLLLOCAL SubjectLocalityImpl : public virtual SubjectLocality, - public AbstractChildlessElement, + public AbstractSimpleElement, public AbstractDOMCachingXMLObject, public AbstractXMLObjectMarshaller, public AbstractXMLObjectUnmarshaller @@ -769,7 +763,8 @@ namespace opensaml { init(); } - SubjectLocalityImpl(const SubjectLocalityImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + SubjectLocalityImpl(const SubjectLocalityImpl& src) + : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) { init(); setAddress(src.getAddress()); setDNSName(src.getDNSName()); @@ -835,7 +830,8 @@ namespace opensaml { init(); } - AuthnContextImpl(const AuthnContextImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + AuthnContextImpl(const AuthnContextImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); if (src.getAuthnContextClassRef()) setAuthnContextClassRef(src.getAuthnContextClassRef()->cloneAuthnContextClassRef()); @@ -859,10 +855,10 @@ namespace opensaml { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(AuthnContextClassRef,SAMLConstants::SAML20_NS,false); - PROC_XMLOBJECT_CHILD(AuthnContextDecl,SAMLConstants::SAML20_NS); - PROC_TYPED_CHILD(AuthnContextDeclRef,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AuthenticatingAuthority,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(AuthnContextClassRef,SAML20_NS,false); + PROC_XMLOBJECT_CHILD(AuthnContextDecl,SAML20_NS); + PROC_TYPED_CHILD(AuthnContextDeclRef,SAML20_NS,false); + PROC_TYPED_CHILDREN(AuthenticatingAuthority,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -897,7 +893,8 @@ namespace opensaml { init(); } - AuthnStatementImpl(const AuthnStatementImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + AuthnStatementImpl(const AuthnStatementImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); setAuthnInstant(src.getAuthnInstant()); setSessionIndex(src.getSessionIndex()); @@ -926,8 +923,8 @@ namespace opensaml { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(SubjectLocality,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(AuthnContext,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(SubjectLocality,SAML20_NS,false); + PROC_TYPED_CHILD(AuthnContext,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } @@ -941,7 +938,6 @@ namespace opensaml { class SAML_DLLLOCAL ActionImpl : public virtual Action, public AbstractSimpleElement, - public AbstractChildlessElement, public AbstractDOMCachingXMLObject, public AbstractXMLObjectMarshaller, public AbstractXMLObjectUnmarshaller @@ -962,7 +958,6 @@ namespace opensaml { IMPL_XMLOBJECT_CLONE(Action); IMPL_STRING_ATTRIB(Namespace); - IMPL_XMLOBJECT_CONTENT; protected: void marshallAttributes(DOMElement* domElement) const { @@ -988,7 +983,8 @@ namespace opensaml { : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - EvidenceImpl(const EvidenceImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + EvidenceImpl(const EvidenceImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { for (list::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) { if (*i) { AssertionIDRef* ref=dynamic_cast(*i); @@ -1026,10 +1022,10 @@ namespace opensaml { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(AssertionIDRef,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AssertionURIRef,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(Assertion,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(EncryptedAssertion,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false); + PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false); + PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false); + PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -1059,7 +1055,7 @@ namespace opensaml { } AuthzDecisionStatementImpl(const AuthzDecisionStatementImpl& src) - : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); setResource(src.getResource()); setDecision(src.getDecision()); @@ -1089,8 +1085,8 @@ namespace opensaml { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(Evidence,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(Action,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(Evidence,SAML20_NS,false); + PROC_TYPED_CHILDREN(Action,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } @@ -1141,7 +1137,8 @@ namespace opensaml { } AttributeImpl(const AttributeImpl& src) - : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) { + : AbstractXMLObject(src), AbstractComplexElement(src), + AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) { init(); setName(src.getName()); setNameFormat(src.getNameFormat()); @@ -1160,7 +1157,7 @@ namespace opensaml { IMPL_STRING_ATTRIB(FriendlyName); IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end()); - void setAttribute(QName& qualifiedName, const XMLCh* value) { + void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) { if (!qualifiedName.hasNamespaceURI()) { if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) { setName(value); @@ -1175,7 +1172,7 @@ namespace opensaml { return; } } - AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value); + AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID); } protected: @@ -1183,15 +1180,7 @@ namespace opensaml { MARSHALL_STRING_ATTRIB(Name,NAME,NULL); MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,NULL); MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,NULL); - - // Take care of wildcard. - for (map::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) { - DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart()); - if (i->first.hasPrefix()) - attr->setPrefix(i->first.getPrefix()); - attr->setNodeValue(i->second); - domElement->setAttributeNode(attr); - } + marshallExtensionAttributes(domElement); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -1199,8 +1188,7 @@ namespace opensaml { } void processAttribute(const DOMAttr* attribute) { - QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix()); - setAttribute(q,attribute->getNodeValue()); + unmarshallExtensionAttribute(attribute); } }; @@ -1234,7 +1222,8 @@ namespace opensaml { : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - AttributeStatementImpl(const AttributeStatementImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + AttributeStatementImpl(const AttributeStatementImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { for (list::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) { if (*i) { Attribute* attribute=dynamic_cast(*i); @@ -1261,8 +1250,8 @@ namespace opensaml { protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(Attribute,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(EncryptedAttribute,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(Attribute,SAML20_NS,false); + PROC_TYPED_CHILDREN(EncryptedAttribute,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -1280,7 +1269,8 @@ namespace opensaml { : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - AdviceImpl(const AdviceImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + AdviceImpl(const AdviceImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { for (list::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) { if (*i) { AssertionIDRef* ref=dynamic_cast(*i); @@ -1307,7 +1297,7 @@ namespace opensaml { continue; } - getOthers().push_back((*i)->clone()); + getUnknownXMLObjects().push_back((*i)->clone()); } } } @@ -1317,19 +1307,19 @@ namespace opensaml { IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end()); IMPL_TYPED_CHILDREN(Assertion,m_children.end()); IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end()); - IMPL_XMLOBJECT_CHILDREN(Other,m_children.end()); + IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end()); protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(AssertionIDRef,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AssertionURIRef,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(Assertion,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(EncryptedAssertion,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false); + PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false); + PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false); + PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false); // Unknown child. const XMLCh* nsURI=root->getNamespaceURI(); - if (!XMLString::equals(nsURI,SAMLConstants::SAML20_NS) && nsURI && *nsURI) { - getOthers().push_back(childXMLObject); + if (!XMLString::equals(nsURI,SAML20_NS) && nsURI && *nsURI) { + getUnknownXMLObjects().push_back(childXMLObject); return; } @@ -1396,7 +1386,8 @@ namespace opensaml { init(); } - AssertionImpl(const AssertionImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + AssertionImpl(const AssertionImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); setVersion(src.getVersion()); setID(src.getID()); @@ -1440,10 +1431,6 @@ namespace opensaml { } } - const XMLCh* getId() const { - return getID(); - } - //IMPL_TYPED_CHILD(Signature); // Need customized setter. protected: @@ -1464,7 +1451,7 @@ namespace opensaml { IMPL_XMLOBJECT_CLONE(Assertion); IMPL_STRING_ATTRIB(Version); - IMPL_STRING_ATTRIB(ID); + IMPL_ID_ATTRIB(ID); IMPL_DATETIME_ATTRIB(IssueInstant,0); IMPL_TYPED_CHILD(Issuer); IMPL_TYPED_CHILD(Subject); @@ -1491,15 +1478,15 @@ namespace opensaml { } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(Issuer,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(Signature,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(Subject,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(Conditions,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(Advice,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AuthnStatement,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AttributeStatement,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AuthzDecisionStatement,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(Statement,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(Issuer,SAML20_NS,false); + PROC_TYPED_CHILD(Signature,XMLSIG_NS,false); + PROC_TYPED_CHILD(Subject,SAML20_NS,false); + PROC_TYPED_CHILD(Conditions,SAML20_NS,false); + PROC_TYPED_CHILD(Advice,SAML20_NS,false); + PROC_TYPED_CHILDREN(AuthnStatement,SAML20_NS,false); + PROC_TYPED_CHILDREN(AttributeStatement,SAML20_NS,false); + PROC_TYPED_CHILDREN(AuthzDecisionStatement,SAML20_NS,false); + PROC_TYPED_CHILDREN(Statement,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } @@ -1646,3 +1633,162 @@ const XMLCh SubjectLocality::LOCAL_NAME[] = UNICODE_LITERAL_15(S,u,b,j,e const XMLCh SubjectLocality::TYPE_NAME[] = UNICODE_LITERAL_19(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y,T,y,p,e); const XMLCh SubjectLocality::ADDRESS_ATTRIB_NAME[] =UNICODE_LITERAL_7(A,d,d,r,e,s,s); const XMLCh SubjectLocality::DNSNAME_ATTRIB_NAME[] =UNICODE_LITERAL_7(D,N,S,N,a,m,e); + +const XMLCh NameIDType::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_d, chNull +}; + +const XMLCh NameIDType::EMAIL[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_e, chLatin_m, chLatin_a, chLatin_i, chLatin_l, chLatin_A, chLatin_d, chLatin_d, chLatin_r, chLatin_e, chLatin_s, chLatin_s, chNull +}; + +const XMLCh NameIDType::X509_SUBJECT[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_X, chDigit_5, chDigit_0, chDigit_9, chLatin_S, chLatin_u, chLatin_b, chLatin_j, chLatin_e, chLatin_c, chLatin_t, + chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull +}; + +const XMLCh NameIDType::WIN_DOMAIN_QUALIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_W, chLatin_i, chLatin_n, chLatin_d, chLatin_o, chLatin_w, chLatin_s, + chLatin_D, chLatin_o, chLatin_m, chLatin_a, chLatin_i, chLatin_n, + chLatin_Q, chLatin_u, chLatin_a, chLatin_l, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, + chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull +}; + +const XMLCh NameIDType::KERBEROS[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_k, chLatin_e, chLatin_r, chLatin_b, chLatin_e, chLatin_r, chLatin_o, chLatin_s, chNull +}; + +const XMLCh NameIDType::ENTITY[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:entity +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chNull +}; + +const XMLCh NameIDType::PERSISTENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:persistent +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_p, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull +}; + +const XMLCh NameIDType::TRANSIENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:transient +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_t, chLatin_r, chLatin_a, chLatin_n, chLatin_s, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chNull +}; + +const XMLCh SubjectConfirmation::BEARER[] = // urn:oasis:names:tc:SAML:2.0:cm:bearer +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_c, chLatin_m, chColon, chLatin_b, chLatin_e, chLatin_a, chLatin_r, chLatin_e, chLatin_r, chNull +}; + +const XMLCh SubjectConfirmation::HOLDER_KEY[] = // urn:oasis:names:tc:SAML:2.0:cm:holder-of-key +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_c, chLatin_m, chColon, chLatin_h, chLatin_o, chLatin_l, chLatin_d, chLatin_e, chLatin_r, chDash, + chLatin_o, chLatin_f, chDash, chLatin_k, chLatin_e, chLatin_y, chNull +}; + +const XMLCh SubjectConfirmation::SENDER_VOUCHES[] = // urn:oasis:names:tc:SAML:2.0:cm:sender-vouches +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_c, chLatin_m, chColon, chLatin_s, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chDash, + chLatin_v, chLatin_o, chLatin_u, chLatin_c, chLatin_h, chLatin_e, chLatin_s, chNull +}; + +const XMLCh Action::RWEDC_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon, + chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chNull +}; + +const XMLCh Action::RWEDC_NEG_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc-negation +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon, + chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chDash, + chLatin_n, chLatin_e, chLatin_g, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull +}; + +const XMLCh Action::GHPP_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:ghpp +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon, + chLatin_g, chLatin_h, chLatin_p, chLatin_p, chNull +}; + +const XMLCh Action::UNIX_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:unix +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon, + chLatin_u, chLatin_n, chLatin_i, chLatin_x, chNull +}; + +const XMLCh Attribute::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_d, chNull +}; + +const XMLCh Attribute::URI_REFERENCE[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:uri +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_u, chLatin_r, chLatin_i, chNull +}; + +const XMLCh Attribute::BASIC[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:basic +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_b, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chNull +};