From 0935fa885920689f19747229d5665ce8050a595b Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Mon, 31 Jul 2006 02:11:27 +0000 Subject: [PATCH] Implement various extension profiles. --- saml/saml2/core/Protocols.h | 4 + saml/saml2/core/impl/Assertions20Impl.cpp | 2 +- saml/saml2/core/impl/Protocols20Impl.cpp | 3 + .../core/impl/Protocols20SchemaValidators.cpp | 6 + saml/saml2/metadata/Metadata.h | 141 +++++++++++++ saml/saml2/metadata/impl/MetadataImpl.cpp | 219 ++++++++++++++++++++- .../metadata/impl/MetadataSchemaValidators.cpp | 22 +++ saml/util/SAMLConstants.cpp | 54 +++-- saml/util/SAMLConstants.h | 30 ++- 9 files changed, 458 insertions(+), 23 deletions(-) diff --git a/saml/saml2/core/Protocols.h b/saml/saml2/core/Protocols.h index b520903..f43149d 100644 --- a/saml/saml2/core/Protocols.h +++ b/saml/saml2/core/Protocols.h @@ -46,6 +46,8 @@ namespace opensaml { DECL_XMLOBJECT_SIMPLE(SAML_API,SessionIndex,SessionIndex,SAML 2.0 SessionIndex element); DECL_XMLOBJECT_SIMPLE(SAML_API,StatusMessage,Message,SAML 2.0 StatusMessage element); + DECL_XMLOBJECT_SIMPLE(SAML_API,RespondTo,Name,SAML 2.0 third-party request RespondTo extension element); + BEGIN_XMLOBJECT(SAML_API,Extensions,xmltooling::ElementProxy,SAML 2.0 protocol Extensions element); /** ExtensionsType local name */ static const XMLCh TYPE_NAME[]; @@ -388,6 +390,8 @@ namespace opensaml { DECL_SAML2POBJECTBUILDER(StatusDetail); DECL_SAML2POBJECTBUILDER(StatusMessage); DECL_SAML2POBJECTBUILDER(Terminate); + + DECL_XMLOBJECTBUILDER(SAML_API,RespondTo,opensaml::SAMLConstants::SAML20P_THIRDPARTY_EXT_NS,opensaml::SAMLConstants::SAML20P_THIRDPARTY_EXT_PREFIX); // // Custom builders diff --git a/saml/saml2/core/impl/Assertions20Impl.cpp b/saml/saml2/core/impl/Assertions20Impl.cpp index 532f6ad..39d28ad 100644 --- a/saml/saml2/core/impl/Assertions20Impl.cpp +++ b/saml/saml2/core/impl/Assertions20Impl.cpp @@ -679,8 +679,8 @@ namespace opensaml { 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_XMLOBJECT_CHILD(SubjectConfirmationData,SAMLConstants::SAML20_NS); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } diff --git a/saml/saml2/core/impl/Protocols20Impl.cpp b/saml/saml2/core/impl/Protocols20Impl.cpp index 1054ec6..6cf699a 100644 --- a/saml/saml2/core/impl/Protocols20Impl.cpp +++ b/saml/saml2/core/impl/Protocols20Impl.cpp @@ -61,6 +61,7 @@ namespace opensaml { DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,SessionIndex); DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,StatusMessage); + DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,RespondTo); //TODO need unit test for this, using objects from another namespace class SAML_DLLLOCAL ExtensionsImpl : public virtual Extensions, @@ -1639,6 +1640,7 @@ IMPL_XMLOBJECTBUILDER(StatusMessage); IMPL_XMLOBJECTBUILDER(StatusResponse); IMPL_XMLOBJECTBUILDER(Terminate); +IMPL_XMLOBJECTBUILDER(RespondTo); // Unicode literals const XMLCh Artifact::LOCAL_NAME[] = UNICODE_LITERAL_8(A,r,t,i,f,a,c,t); @@ -1709,6 +1711,7 @@ const XMLCh Request::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n); const XMLCh Request::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t); const XMLCh Request::DESTINATION_ATTRIB_NAME[] = UNICODE_LITERAL_11(D,e,s,t,i,n,a,t,i,o,n); const XMLCh Request::CONSENT_ATTRIB_NAME[] = UNICODE_LITERAL_7(C,o,n,s,e,n,t); +const XMLCh RespondTo::LOCAL_NAME[] = UNICODE_LITERAL_9(R,e,s,p,o,n,d,T,o); const XMLCh Response::LOCAL_NAME[] = UNICODE_LITERAL_8(R,e,s,p,o,n,s,e); const XMLCh Response::TYPE_NAME[] = UNICODE_LITERAL_12(R,e,s,p,o,n,s,e,T,y,p,e); const XMLCh Scoping::LOCAL_NAME[] = UNICODE_LITERAL_7(S,c,o,p,i,n,g); diff --git a/saml/saml2/core/impl/Protocols20SchemaValidators.cpp b/saml/saml2/core/impl/Protocols20SchemaValidators.cpp index 916035e..4282bef 100644 --- a/saml/saml2/core/impl/Protocols20SchemaValidators.cpp +++ b/saml/saml2/core/impl/Protocols20SchemaValidators.cpp @@ -39,6 +39,8 @@ namespace opensaml { XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,RequesterID); XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,SessionIndex); XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,StatusMessage); + + XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,RespondTo); //TODO wildcard NS ##other - spec says must be a "non-SAML defined" namespace, // not just other than the target namespace @@ -295,4 +297,8 @@ void opensaml::saml2p::registerProtocolClasses() { REGISTER_TYPE(StatusResponse); REGISTER_TYPE_NOVAL(StatusDetail); REGISTER_TYPE_NOVAL(Terminate); + + q=QName(SAMLConstants::SAML20P_THIRDPARTY_EXT_NS,RespondTo::LOCAL_NAME); + XMLObjectBuilder::registerBuilder(q,new RespondToBuilder()); + ProtocolSchemaValidators.registerValidator(q,new RespondToSchemaValidator()); } diff --git a/saml/saml2/metadata/Metadata.h b/saml/saml2/metadata/Metadata.h index 2fc3e8c..dd1b88e 100644 --- a/saml/saml2/metadata/Metadata.h +++ b/saml/saml2/metadata/Metadata.h @@ -83,6 +83,9 @@ namespace opensaml { DECL_XMLOBJECT_SIMPLE(SAML_API,NameIDFormat,Format,SAML 2.0 NameIDFormat element); DECL_XMLOBJECT_SIMPLE(SAML_API,SurName,Name,SAML 2.0 SurName element); DECL_XMLOBJECT_SIMPLE(SAML_API,TelephoneNumber,Number,SAML 2.0 TelephoneNumber element); + + DECL_XMLOBJECT_SIMPLE(SAML_API,ActionNamespace,Namespace,SAML 2.0 Metadata Extension ActionNamespace element); + DECL_XMLOBJECT_SIMPLE(SAML_API,SourceID,ID,SAML 1.x Metadata Profile SourceID element); BEGIN_XMLOBJECT(SAML_API,localizedNameType,xmltooling::SimpleElement,SAML 2.0 localizedNameType type); DECL_STRING_ATTRIB(Lang,LANG); @@ -301,6 +304,30 @@ namespace opensaml { static const XMLCh TYPE_NAME[]; END_XMLOBJECT; + BEGIN_XMLOBJECT(SAML_API,QueryDescriptorType,RoleDescriptor,SAML 2.0 QueryDescriptorType abstract type); + DECL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED); + DECL_TYPED_CHILDREN(NameIDFormat); + /** QueryDescriptorType local name */ + static const XMLCh TYPE_NAME[]; + END_XMLOBJECT; + + BEGIN_XMLOBJECT(SAML_API,AuthnQueryDescriptorType,QueryDescriptorType,SAML 2.0 AuthnQueryDescriptorType extension type); + /** AuthnQueryDescriptorType local name */ + static const XMLCh TYPE_NAME[]; + END_XMLOBJECT; + + BEGIN_XMLOBJECT(SAML_API,AttributeQueryDescriptorType,QueryDescriptorType,SAML 2.0 AttributeQueryDescriptorType extension type); + DECL_TYPED_CHILDREN(AttributeConsumingService); + /** AttributeQueryDescriptorType local name */ + static const XMLCh TYPE_NAME[]; + END_XMLOBJECT; + + BEGIN_XMLOBJECT(SAML_API,AuthzDecisionQueryDescriptorType,QueryDescriptorType,SAML 2.0 AuthzDecisionQueryDescriptorType extension type); + DECL_TYPED_CHILDREN(ActionNamespace); + /** AuthzDecisionQueryDescriptorType local name */ + static const XMLCh TYPE_NAME[]; + END_XMLOBJECT; + BEGIN_XMLOBJECT4(SAML_API,AffiliationDescriptor,xmltooling::AttributeExtensibleXMLObject,SignableObject, CacheableSAMLObject,TimeBoundSAMLObject,SAML 2.0 AffiliationDescriptor element); DECL_STRING_ATTRIB(ID,ID); @@ -326,6 +353,9 @@ namespace opensaml { DECL_TYPED_CHILDREN(AuthnAuthorityDescriptor); DECL_TYPED_CHILDREN(AttributeAuthorityDescriptor); DECL_TYPED_CHILDREN(PDPDescriptor); + DECL_TYPED_CHILDREN(AuthnQueryDescriptorType); + DECL_TYPED_CHILDREN(AttributeQueryDescriptorType); + DECL_TYPED_CHILDREN(AuthzDecisionQueryDescriptorType); /** Finds an IDP role supporting a given protocol. */ virtual const IDPSSODescriptor* getIDPSSODescriptor(const XMLCh* protocol) const=0; /** Finds an SP role supporting a given protocol. */ @@ -336,6 +366,12 @@ namespace opensaml { virtual const AttributeAuthorityDescriptor* getAttributeAuthorityDescriptor(const XMLCh* protocol) const=0; /** Finds a PDP role supporting a given protocol. */ virtual const PDPDescriptor* getPDPDescriptor(const XMLCh* protocol) const=0; + /** Finds an AuthnQuery role supporting a given protocol. */ + virtual const AuthnQueryDescriptorType* getAuthnQueryDescriptorType(const XMLCh* protocol) const=0; + /** Finds an AttributeQuery role supporting a given protocol. */ + virtual const AttributeQueryDescriptorType* getAttributeQueryDescriptorType(const XMLCh* protocol) const=0; + /** Finds an AuthzDecisionQuery role supporting a given protocol. */ + virtual const AuthzDecisionQueryDescriptorType* getAuthzDecisionQueryDescriptorType(const XMLCh* protocol) const=0; /** Finds an extension role supporting a given protocol. */ virtual const RoleDescriptor* getRoleDescriptor(xmltooling::QName& qname, const XMLCh* protocol) const=0; /** EntityDescriptorType local name */ @@ -392,6 +428,9 @@ namespace opensaml { DECL_SAML2MDOBJECTBUILDER(SPSSODescriptor); DECL_SAML2MDOBJECTBUILDER(SurName); DECL_SAML2MDOBJECTBUILDER(TelephoneNumber); + + DECL_XMLOBJECTBUILDER(SAML_API,ActionNamespace,opensaml::SAMLConstants::SAML20MD_QUERY_EXT_NS,opensaml::SAMLConstants::SAML20MD_QUERY_EXT_PREFIX); + DECL_XMLOBJECTBUILDER(SAML_API,SourceID,opensaml::SAMLConstants::SAML1MD_NS,opensaml::SAMLConstants::SAML1MD_PREFIX); /** * Builder for localizedNameType objects. @@ -498,6 +537,108 @@ namespace opensaml { }; /** + * Builder for AuthnQueryDescriptorType objects. + * + * This is customized to return a RoleDescriptor element with an + * xsi:type of AuthnQueryDescriptorType. + */ + class SAML_API AuthnQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder { + public: + virtual ~AuthnQueryDescriptorTypeBuilder() {} + /** Default builder. */ + virtual AuthnQueryDescriptorType* buildObject() const { + xmltooling::QName schemaType( + SAMLConstants::SAML20_NS,AuthnQueryDescriptorType::TYPE_NAME,SAMLConstants::SAML20MD_QUERY_EXT_PREFIX + ); + return buildObject( + SAMLConstants::SAML20_NS,AuthnQueryDescriptorType::LOCAL_NAME,SAMLConstants::SAML20_PREFIX,&schemaType + ); + } + /** Builder that allows element/type override. */ + virtual AuthnQueryDescriptorType* buildObject( + const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL + ) const; + + /** Singleton builder. */ + static AuthnQueryDescriptorType* buildAuthnQueryDescriptorType() { + const AuthnQueryDescriptorTypeBuilder* b = dynamic_cast( + XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AuthnQueryDescriptorType::TYPE_NAME)) + ); + if (b) + return b->buildObject(); + throw xmltooling::XMLObjectException("Unable to obtain typed builder for AuthnQueryDescriptorType."); + } + }; + + /** + * Builder for AttributeQueryDescriptorType objects. + * + * This is customized to return a RoleDescriptor element with an + * xsi:type of AttributeQueryDescriptorType. + */ + class SAML_API AttributeQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder { + public: + virtual ~AttributeQueryDescriptorTypeBuilder() {} + /** Default builder. */ + virtual AttributeQueryDescriptorType* buildObject() const { + xmltooling::QName schemaType( + SAMLConstants::SAML20_NS,AttributeQueryDescriptorType::TYPE_NAME,SAMLConstants::SAML20MD_QUERY_EXT_PREFIX + ); + return buildObject( + SAMLConstants::SAML20_NS,AttributeQueryDescriptorType::LOCAL_NAME,SAMLConstants::SAML20_PREFIX,&schemaType + ); + } + /** Builder that allows element/type override. */ + virtual AttributeQueryDescriptorType* buildObject( + const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL + ) const; + + /** Singleton builder. */ + static AttributeQueryDescriptorType* buildAttributeQueryDescriptorType() { + const AttributeQueryDescriptorTypeBuilder* b = dynamic_cast( + XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AttributeQueryDescriptorType::TYPE_NAME)) + ); + if (b) + return b->buildObject(); + throw xmltooling::XMLObjectException("Unable to obtain typed builder for AttributeQueryDescriptorType."); + } + }; + + /** + * Builder for AuthzDecisionQueryDescriptorType objects. + * + * This is customized to return a RoleDescriptor element with an + * xsi:type of AuthzDecisionQueryDescriptorType. + */ + class SAML_API AuthzDecisionQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder { + public: + virtual ~AuthzDecisionQueryDescriptorTypeBuilder() {} + /** Default builder. */ + virtual AuthzDecisionQueryDescriptorType* buildObject() const { + xmltooling::QName schemaType( + SAMLConstants::SAML20_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME,SAMLConstants::SAML20MD_QUERY_EXT_PREFIX + ); + return buildObject( + SAMLConstants::SAML20_NS,AuthzDecisionQueryDescriptorType::LOCAL_NAME,SAMLConstants::SAML20_PREFIX,&schemaType + ); + } + /** Builder that allows element/type override. */ + virtual AuthzDecisionQueryDescriptorType* buildObject( + const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL + ) const; + + /** Singleton builder. */ + static AuthzDecisionQueryDescriptorType* buildAuthzDecisionQueryDescriptorType() { + const AuthzDecisionQueryDescriptorTypeBuilder* b = dynamic_cast( + XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME)) + ); + if (b) + return b->buildObject(); + throw xmltooling::XMLObjectException("Unable to obtain typed builder for AuthzDecisionQueryDescriptorType."); + } + }; + + /** * Registers builders and validators for SAML 2.0 Metadata classes into the runtime. */ void SAML_API registerMetadataClasses(); diff --git a/saml/saml2/metadata/impl/MetadataImpl.cpp b/saml/saml2/metadata/impl/MetadataImpl.cpp index a88ae51..a9393ac 100644 --- a/saml/saml2/metadata/impl/MetadataImpl.cpp +++ b/saml/saml2/metadata/impl/MetadataImpl.cpp @@ -61,6 +61,9 @@ namespace opensaml { DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,SurName); DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,TelephoneNumber); + DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,ActionNamespace); + DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,SourceID); + class SAML_DLLLOCAL localizedNameTypeImpl : public virtual localizedNameType, public AbstractSimpleElement, public AbstractChildlessElement, @@ -1738,6 +1741,155 @@ namespace opensaml { } }; + class SAML_DLLLOCAL QueryDescriptorTypeImpl : public virtual QueryDescriptorType, public RoleDescriptorImpl + { + void init() { + m_WantAssertionsSigned=XMLConstants::XML_BOOL_NULL; + m_children.push_back(NULL); + m_pos_NameIDFormat=m_pos_ContactPerson; + ++m_pos_NameIDFormat; + } + + protected: + list::iterator m_pos_NameIDFormat; + + QueryDescriptorTypeImpl() { + init(); + } + + public: + virtual ~QueryDescriptorTypeImpl() {} + + QueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) { + init(); + } + + QueryDescriptorTypeImpl(const QueryDescriptorTypeImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) { + init(); + WantAssertionsSigned(src.m_WantAssertionsSigned); + VectorOf(NameIDFormat) y=getNameIDFormats(); + for (vector::const_iterator m=src.m_NameIDFormats.begin(); m!=src.m_NameIDFormats.end(); m++) { + if (*m) { + y.push_back((*m)->cloneNameIDFormat()); + } + } + } + + IMPL_BOOLEAN_ATTRIB(WantAssertionsSigned); + IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat); + + void setAttribute(QName& qualifiedName, const XMLCh* value) { + if (!qualifiedName.hasNamespaceURI()) { + if (XMLString::equals(qualifiedName.getLocalPart(),WANTASSERTIONSSIGNED_ATTRIB_NAME)) { + setWantAssertionsSigned(value); + return; + } + } + RoleDescriptorImpl::setAttribute(qualifiedName, value); + } + + protected: + void marshallAttributes(DOMElement* domElement) const { + MARSHALL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED,NULL); + RoleDescriptorImpl::marshallAttributes(domElement); + } + + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { + PROC_TYPED_CHILDREN(NameIDFormat,SAMLConstants::SAML20MD_NS,false); + RoleDescriptorImpl::processChildElement(childXMLObject,root); + } + }; + + class SAML_DLLLOCAL AuthnQueryDescriptorTypeImpl : public virtual AuthnQueryDescriptorType, public QueryDescriptorTypeImpl + { + public: + virtual ~AuthnQueryDescriptorTypeImpl() {} + + AuthnQueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) {} + + AuthnQueryDescriptorTypeImpl(const AuthnQueryDescriptorTypeImpl& src) : AbstractXMLObject(src), QueryDescriptorTypeImpl(src) {} + + IMPL_XMLOBJECT_CLONE(AuthnQueryDescriptorType); + QueryDescriptorType* cloneQueryDescriptorType() const { + return new AuthnQueryDescriptorTypeImpl(*this); + } + RoleDescriptor* cloneRoleDescriptor() const { + return new AuthnQueryDescriptorTypeImpl(*this); + } + }; + + class SAML_DLLLOCAL AttributeQueryDescriptorTypeImpl : public virtual AttributeQueryDescriptorType, public QueryDescriptorTypeImpl + { + public: + virtual ~AttributeQueryDescriptorTypeImpl() {} + + AttributeQueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) {} + + AttributeQueryDescriptorTypeImpl(const AttributeQueryDescriptorTypeImpl& src) + : AbstractXMLObject(src), QueryDescriptorTypeImpl(src) { + VectorOf(AttributeConsumingService) w=getAttributeConsumingServices(); + for (vector::const_iterator j=src.m_AttributeConsumingServices.begin(); j!=src.m_AttributeConsumingServices.end(); j++) { + if (*j) { + w.push_back((*j)->cloneAttributeConsumingService()); + } + } + } + + IMPL_XMLOBJECT_CLONE(AttributeQueryDescriptorType); + QueryDescriptorType* cloneQueryDescriptorType() const { + return new AttributeQueryDescriptorTypeImpl(*this); + } + RoleDescriptor* cloneRoleDescriptor() const { + return new AttributeQueryDescriptorTypeImpl(*this); + } + + IMPL_TYPED_CHILDREN(AttributeConsumingService,m_children.end()); + + protected: + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { + PROC_TYPED_CHILDREN(AttributeConsumingService,SAMLConstants::SAML20MD_NS,false); + QueryDescriptorTypeImpl::processChildElement(childXMLObject,root); + } + }; + + class SAML_DLLLOCAL AuthzDecisionQueryDescriptorTypeImpl : public virtual AuthzDecisionQueryDescriptorType, public QueryDescriptorTypeImpl + { + public: + virtual ~AuthzDecisionQueryDescriptorTypeImpl() {} + + AuthzDecisionQueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) {} + + AuthzDecisionQueryDescriptorTypeImpl(const AuthzDecisionQueryDescriptorTypeImpl& src) + : AbstractXMLObject(src), QueryDescriptorTypeImpl(src) { + VectorOf(ActionNamespace) w=getActionNamespaces(); + for (vector::const_iterator j=src.m_ActionNamespaces.begin(); j!=src.m_ActionNamespaces.end(); j++) { + if (*j) { + w.push_back((*j)->cloneActionNamespace()); + } + } + } + + IMPL_XMLOBJECT_CLONE(AuthzDecisionQueryDescriptorType); + QueryDescriptorType* cloneQueryDescriptorType() const { + return new AuthzDecisionQueryDescriptorTypeImpl(*this); + } + RoleDescriptor* cloneRoleDescriptor() const { + return new AuthzDecisionQueryDescriptorTypeImpl(*this); + } + + IMPL_TYPED_CHILDREN(ActionNamespace,m_children.end()); + + protected: + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { + PROC_TYPED_CHILDREN(ActionNamespace,SAMLConstants::SAML20MD_QUERY_EXT_NS,false); + QueryDescriptorTypeImpl::processChildElement(childXMLObject,root); + } + }; + class SAML_DLLLOCAL AffiliationDescriptorImpl : public virtual AffiliationDescriptor, public virtual SignableObject, public AbstractComplexElement, @@ -1982,6 +2134,24 @@ namespace opensaml { continue; } + AuthnQueryDescriptorType* authnq=dynamic_cast(*i); + if (authnq) { + getAuthnQueryDescriptorTypes().push_back(authnq->cloneAuthnQueryDescriptorType()); + continue; + } + + AttributeQueryDescriptorType* attrq=dynamic_cast(*i); + if (attrq) { + getAttributeQueryDescriptorTypes().push_back(attrq->cloneAttributeQueryDescriptorType()); + continue; + } + + AuthzDecisionQueryDescriptorType* authzq=dynamic_cast(*i); + if (authzq) { + getAuthzDecisionQueryDescriptorTypes().push_back(authzq->cloneAuthzDecisionQueryDescriptorType()); + continue; + } + RoleDescriptor* role=dynamic_cast(*i); if (role) { getRoleDescriptors().push_back(role->cloneRoleDescriptor()); @@ -2039,6 +2209,9 @@ namespace opensaml { IMPL_TYPED_CHILDREN(AuthnAuthorityDescriptor,m_pos_AffiliationDescriptor); IMPL_TYPED_CHILDREN(AttributeAuthorityDescriptor,m_pos_AffiliationDescriptor); IMPL_TYPED_CHILDREN(PDPDescriptor,m_pos_AffiliationDescriptor); + IMPL_TYPED_CHILDREN(AuthnQueryDescriptorType,m_pos_AffiliationDescriptor); + IMPL_TYPED_CHILDREN(AttributeQueryDescriptorType,m_pos_AffiliationDescriptor); + IMPL_TYPED_CHILDREN(AuthzDecisionQueryDescriptorType,m_pos_AffiliationDescriptor); IMPL_TYPED_CHILD(AffiliationDescriptor); IMPL_TYPED_CHILD(Organization); IMPL_TYPED_CHILDREN(ContactPerson,m_pos_ContactPerson); @@ -2105,7 +2278,31 @@ namespace opensaml { } return NULL; } + + const AuthnQueryDescriptorType* getAuthnQueryDescriptorType(const XMLCh* protocol) const { + for (vector::const_iterator i=m_AuthnQueryDescriptorTypes.begin(); i!=m_AuthnQueryDescriptorTypes.end(); i++) { + if ((*i)->hasSupport(protocol) && (*i)->isValid()) + return (*i); + } + return NULL; + } + + const AttributeQueryDescriptorType* getAttributeQueryDescriptorType(const XMLCh* protocol) const { + for (vector::const_iterator i=m_AttributeQueryDescriptorTypes.begin(); i!=m_AttributeQueryDescriptorTypes.end(); i++) { + if ((*i)->hasSupport(protocol) && (*i)->isValid()) + return (*i); + } + return NULL; + } + const AuthzDecisionQueryDescriptorType* getAuthzDecisionQueryDescriptorType(const XMLCh* protocol) const { + for (vector::const_iterator i=m_AuthzDecisionQueryDescriptorTypes.begin(); i!=m_AuthzDecisionQueryDescriptorTypes.end(); i++) { + if ((*i)->hasSupport(protocol) && (*i)->isValid()) + return (*i); + } + return NULL; + } + const RoleDescriptor* getRoleDescriptor(xmltooling::QName& qname, const XMLCh* protocol) const { for (vector::const_iterator i=m_RoleDescriptors.begin(); i!=m_RoleDescriptors.end(); i++) { if ((*i)->getSchemaType() && qname==(*((*i)->getSchemaType())) && (*i)->hasSupport(protocol) && (*i)->isValid()) @@ -2134,12 +2331,15 @@ namespace opensaml { void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false); PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20MD_NS,false); - PROC_TYPED_CHILDREN(RoleDescriptor,SAMLConstants::SAML20MD_NS,false); PROC_TYPED_CHILDREN(IDPSSODescriptor,SAMLConstants::SAML20MD_NS,false); PROC_TYPED_CHILDREN(SPSSODescriptor,SAMLConstants::SAML20MD_NS,false); PROC_TYPED_CHILDREN(AuthnAuthorityDescriptor,SAMLConstants::SAML20MD_NS,false); PROC_TYPED_CHILDREN(AttributeAuthorityDescriptor,SAMLConstants::SAML20MD_NS,false); PROC_TYPED_CHILDREN(PDPDescriptor,SAMLConstants::SAML20MD_NS,false); + PROC_TYPED_CHILDREN(AuthnQueryDescriptorType,SAMLConstants::SAML20MD_QUERY_EXT_NS,false); + PROC_TYPED_CHILDREN(AttributeQueryDescriptorType,SAMLConstants::SAML20MD_QUERY_EXT_NS,false); + PROC_TYPED_CHILDREN(AuthzDecisionQueryDescriptorType,SAMLConstants::SAML20MD_QUERY_EXT_NS,false); + PROC_TYPED_CHILDREN(RoleDescriptor,SAMLConstants::SAML20MD_NS,false); PROC_TYPED_CHILD(AffiliationDescriptor,SAMLConstants::SAML20MD_NS,false); PROC_TYPED_CHILD(Organization,SAMLConstants::SAML20MD_NS,false); PROC_TYPED_CHILDREN(ContactPerson,SAMLConstants::SAML20MD_NS,false); @@ -2288,9 +2488,12 @@ IMPL_XMLOBJECTBUILDER(AssertionIDRequestService); IMPL_XMLOBJECTBUILDER(AttributeAuthorityDescriptor); IMPL_XMLOBJECTBUILDER(AttributeConsumingService); IMPL_XMLOBJECTBUILDER(AttributeProfile); +IMPL_XMLOBJECTBUILDER(AttributeQueryDescriptorType); IMPL_XMLOBJECTBUILDER(AttributeService); IMPL_XMLOBJECTBUILDER(AuthnAuthorityDescriptor); +IMPL_XMLOBJECTBUILDER(AuthnQueryDescriptorType); IMPL_XMLOBJECTBUILDER(AuthnQueryService); +IMPL_XMLOBJECTBUILDER(AuthzDecisionQueryDescriptorType); IMPL_XMLOBJECTBUILDER(AuthzService); IMPL_XMLOBJECTBUILDER(Company); IMPL_XMLOBJECTBUILDER(ContactPerson); @@ -2322,6 +2525,10 @@ IMPL_XMLOBJECTBUILDER(SPSSODescriptor); IMPL_XMLOBJECTBUILDER(SurName); IMPL_XMLOBJECTBUILDER(TelephoneNumber); +IMPL_XMLOBJECTBUILDER(ActionNamespace); +IMPL_XMLOBJECTBUILDER(SourceID); + +const XMLCh ActionNamespace::LOCAL_NAME[] = UNICODE_LITERAL_15(A,c,t,i,o,n,N,a,m,e,s,p,a,c,e); const XMLCh AdditionalMetadataLocation::LOCAL_NAME[] = UNICODE_LITERAL_26(A,d,d,i,t,i,o,n,a,l,M,e,t,a,d,a,t,a,L,o,c,a,t,i,o,n); const XMLCh AdditionalMetadataLocation::TYPE_NAME[] = UNICODE_LITERAL_30(A,d,d,i,t,i,o,n,a,l,M,e,t,a,d,a,t,a,L,o,c,a,t,i,o,n,T,y,p,e); const XMLCh AdditionalMetadataLocation::NAMESPACE_ATTRIB_NAME[] = UNICODE_LITERAL_9(n,a,m,e,s,p,a,c,e); @@ -2340,10 +2547,16 @@ const XMLCh AttributeConsumingService::TYPE_NAME[] = UNICODE_LITERAL_29(A,t,t const XMLCh AttributeConsumingService::INDEX_ATTRIB_NAME[] = UNICODE_LITERAL_5(i,n,d,e,x); const XMLCh AttributeConsumingService::ISDEFAULT_ATTRIB_NAME[] = UNICODE_LITERAL_9(i,s,D,e,f,a,u,l,t); const XMLCh AttributeProfile::LOCAL_NAME[] = UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,P,r,o,f,i,l,e); +const XMLCh AttributeQueryDescriptorType::LOCAL_NAME[] =UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r); +const XMLCh AttributeQueryDescriptorType::TYPE_NAME[] = UNICODE_LITERAL_28(A,t,t,r,i,b,u,t,e,Q,u,e,r,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e); const XMLCh AttributeService::LOCAL_NAME[] = UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,S,e,r,v,i,c,e); const XMLCh AuthnAuthorityDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_24(A,u,t,h,n,A,u,t,h,o,r,i,t,y,D,e,s,c,r,i,p,t,o,r); const XMLCh AuthnAuthorityDescriptor::TYPE_NAME[] = UNICODE_LITERAL_28(A,u,t,h,n,A,u,t,h,o,r,i,t,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e); +const XMLCh AuthnQueryDescriptorType::LOCAL_NAME[] = UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r); +const XMLCh AuthnQueryDescriptorType::TYPE_NAME[] = UNICODE_LITERAL_24(A,u,t,h,n,Q,u,e,r,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e); const XMLCh AuthnQueryService::LOCAL_NAME[] = UNICODE_LITERAL_17(A,u,t,h,n,Q,u,e,r,y,S,e,r,v,i,c,e); +const XMLCh AuthzDecisionQueryDescriptorType::LOCAL_NAME[] = UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r); +const XMLCh AuthzDecisionQueryDescriptorType::TYPE_NAME[] = UNICODE_LITERAL_32(A,u,t,h,z,D,e,c,i,s,i,o,n,Q,u,e,r,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e); const XMLCh AuthzService::LOCAL_NAME[] = UNICODE_LITERAL_12(A,u,t,h,z,S,e,r,v,i,c,e); const XMLCh CacheableSAMLObject::CACHEDURATION_ATTRIB_NAME[] = UNICODE_LITERAL_13(c,a,c,h,e,D,u,r,a,t,i,o,n); const XMLCh Company::LOCAL_NAME[] = UNICODE_LITERAL_7(C,o,m,p,a,n,y); @@ -2400,6 +2613,9 @@ const XMLCh OrganizationDisplayName::LOCAL_NAME[] = UNICODE_LITERAL_23(O,r,g const XMLCh OrganizationURL::LOCAL_NAME[] = UNICODE_LITERAL_15(O,r,g,a,n,i,z,a,t,i,o,n,U,R,L); const XMLCh PDPDescriptor::LOCAL_NAME[] = UNICODE_LITERAL_13(P,D,P,D,e,s,c,r,i,p,t,o,r); const XMLCh PDPDescriptor::TYPE_NAME[] = UNICODE_LITERAL_17(P,D,P,D,e,s,c,r,i,p,t,o,r,T,y,p,e); +const XMLCh QueryDescriptorType::LOCAL_NAME[] = {chNull}; +const XMLCh QueryDescriptorType::TYPE_NAME[] = UNICODE_LITERAL_19(Q,u,e,r,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e); +const XMLCh QueryDescriptorType::WANTASSERTIONSSIGNED_ATTRIB_NAME[] = UNICODE_LITERAL_20(W,a,n,t,A,s,s,e,r,t,i,o,n,s,S,i,g,n,e,d); const XMLCh RequestedAttribute::LOCAL_NAME[] = UNICODE_LITERAL_18(R,e,q,u,e,s,t,e,d,A,t,t,r,i,b,u,t,e); const XMLCh RequestedAttribute::TYPE_NAME[] = UNICODE_LITERAL_22(R,e,q,u,e,s,t,e,d,A,t,t,r,i,b,u,t,e,T,y,p,e); const XMLCh RequestedAttribute::ISREQUIRED_ATTRIB_NAME[] = UNICODE_LITERAL_10(i,s,R,e,q,u,i,r,e,d); @@ -2411,6 +2627,7 @@ const XMLCh ServiceDescription::LOCAL_NAME[] = UNICODE_LITERAL_18(S,e,r const XMLCh ServiceName::LOCAL_NAME[] = UNICODE_LITERAL_11(S,e,r,v,i,c,e,N,a,m,e); const XMLCh SingleLogoutService::LOCAL_NAME[] = UNICODE_LITERAL_19(S,i,n,g,l,e,L,o,g,o,u,t,S,e,r,v,i,c,e); const XMLCh SingleSignOnService::LOCAL_NAME[] = UNICODE_LITERAL_19(S,i,n,g,l,e,S,i,g,n,O,n,S,e,r,v,i,c,e); +const XMLCh SourceID::LOCAL_NAME[] = UNICODE_LITERAL_8(S,o,u,r,c,e,I,D); const XMLCh SPSSODescriptor::LOCAL_NAME[] = UNICODE_LITERAL_15(S,P,S,S,O,D,e,s,c,r,i,p,t,o,r); const XMLCh SPSSODescriptor::TYPE_NAME[] = UNICODE_LITERAL_19(S,P,S,S,O,D,e,s,c,r,i,p,t,o,r,T,y,p,e); const XMLCh SPSSODescriptor::AUTHNREQUESTSSIGNED_ATTRIB_NAME[] = UNICODE_LITERAL_19(A,u,t,h,n,R,e,q,u,e,s,t,s,S,i,g,n,e,d); diff --git a/saml/saml2/metadata/impl/MetadataSchemaValidators.cpp b/saml/saml2/metadata/impl/MetadataSchemaValidators.cpp index 707ac67..58316f6 100644 --- a/saml/saml2/metadata/impl/MetadataSchemaValidators.cpp +++ b/saml/saml2/metadata/impl/MetadataSchemaValidators.cpp @@ -33,12 +33,14 @@ using namespace std; namespace opensaml { namespace saml2md { + XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,ActionNamespace); XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,AffiliateMember); XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,AttributeProfile); XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,Company); XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,EmailAddress); XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,GivenName); XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,NameIDFormat); + XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,SourceID); XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,SurName); XMLOBJECTVALIDATOR_SIMPLE(SAML_DLLLOCAL,TelephoneNumber); @@ -321,4 +323,24 @@ void opensaml::saml2md::registerMetadataClasses() { REGISTER_TYPE(PDPDescriptor); REGISTER_TYPE(RequestedAttribute); REGISTER_TYPE(SPSSODescriptor); + + q=QName(SAMLConstants::SAML1MD_NS,SourceID::LOCAL_NAME); + XMLObjectBuilder::registerBuilder(q,new SourceIDBuilder()); + MetadataSchemaValidators.registerValidator(q,new SourceIDSchemaValidator()); + + q=QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,ActionNamespace::LOCAL_NAME); + XMLObjectBuilder::registerBuilder(q,new ActionNamespaceBuilder()); + MetadataSchemaValidators.registerValidator(q,new ActionNamespaceSchemaValidator()); + + q=QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AuthnQueryDescriptorType::TYPE_NAME); + XMLObjectBuilder::registerBuilder(q,new AuthnQueryDescriptorTypeBuilder()); + MetadataSchemaValidators.registerValidator(q,new RoleDescriptorSchemaValidator()); + + q=QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AttributeQueryDescriptorType::TYPE_NAME); + XMLObjectBuilder::registerBuilder(q,new AttributeQueryDescriptorTypeBuilder()); + MetadataSchemaValidators.registerValidator(q,new RoleDescriptorSchemaValidator()); + + q=QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME); + XMLObjectBuilder::registerBuilder(q,new AuthzDecisionQueryDescriptorTypeBuilder()); + MetadataSchemaValidators.registerValidator(q,new RoleDescriptorSchemaValidator()); } diff --git a/saml/util/SAMLConstants.cpp b/saml/util/SAMLConstants.cpp index d8c5270..d1915ff 100644 --- a/saml/util/SAMLConstants.cpp +++ b/saml/util/SAMLConstants.cpp @@ -66,21 +66,6 @@ const XMLCh SAMLConstants::SAML1_PREFIX[] = UNICODE_LITERAL_4(s,a,m,l); const XMLCh SAMLConstants::SAML1P_PREFIX[] = UNICODE_LITERAL_5(s,a,m,l,p); -const XMLCh SAMLConstants::SAML11_PROTOCOL_ENUM[] = // urn:oasis:names:tc:SAML:1.1:protocol -{ 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_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chNull -}; - -const XMLCh SAMLConstants::SAML1_METADATA_PROFILE[] = // urn:oasis:names:tc:SAML:profiles:v1metadata -{ 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, - chLatin_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, - chLatin_v, chDigit_1, chLatin_m, chLatin_e, chLatin_t, chLatin_a, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chNull -}; - const XMLCh SAMLConstants::SAML20_VERSION[] = // 2.0 { chDigit_2, chPeriod, chDigit_0, chNull }; @@ -163,3 +148,42 @@ const XMLCh SAMLConstants::SAML20XACML_NS[] = // urn:oasis:names:tc:SAML:2.0:pro }; const XMLCh SAMLConstants::SAML20XACML_PREFIX[] = UNICODE_LITERAL_9(x,a,c,m,l,p,r,o,f); + +const XMLCh SAMLConstants::SAML1MD_NS[] = // urn:oasis:names:tc:SAML:profiles:v1metadata +{ 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, + chLatin_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_v, chDigit_1, chLatin_m, chLatin_e, chLatin_t, chLatin_a, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chNull +}; + +const XMLCh SAMLConstants::SAML1MD_PREFIX[] = +{ chLatin_s, chLatin_a, chLatin_m, chLatin_l, chDigit_1, chLatin_m, chLatin_d, chNull }; + +const XMLCh SAMLConstants::SAML11_PROTOCOL_ENUM[] = // urn:oasis:names:tc:SAML:1.1:protocol +{ 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_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chNull +}; + +const XMLCh SAMLConstants::SAML20MD_QUERY_EXT_NS[] = // urn:oasis:names:tc:SAML:metadata:ext:query +{ 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, + chLatin_m, chLatin_e, chLatin_t, chLatin_a, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chColon, + chLatin_e, chLatin_x, chLatin_t, chColon, chLatin_q, chLatin_u, chLatin_e, chLatin_r, chLatin_y, chNull +}; + +const XMLCh SAMLConstants::SAML20MD_QUERY_EXT_PREFIX[] = UNICODE_LITERAL_5(q,u,e,r,y); + +const XMLCh SAMLConstants::SAML20P_THIRDPARTY_EXT_NS[] = // urn:oasis:names:tc:SAML:protocol:ext:third-party +{ 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, + chLatin_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chColon, + chLatin_e, chLatin_x, chLatin_t, chColon, + chLatin_t, chLatin_h, chLatin_i, chLatin_r, chLatin_d, chDash, chLatin_p, chLatin_a, chLatin_r, chLatin_t, chLatin_y, chNull +}; + +const XMLCh SAMLConstants::SAML20P_THIRDPARTY_EXT_PREFIX[] = UNICODE_LITERAL_6(t,h,r,p,t,y); diff --git a/saml/util/SAMLConstants.h b/saml/util/SAMLConstants.h index f40f1ce..ebb6d28 100644 --- a/saml/util/SAMLConstants.h +++ b/saml/util/SAMLConstants.h @@ -56,12 +56,6 @@ namespace opensaml { /** SAML 1.X Protocol QName prefix ("samlp") */ static const XMLCh SAML1P_PREFIX[]; - /** SAML 1.1 Protocol Enumeration constant ("urn:oasis:names:tc:SAML:1.0:protocol") */ - static const XMLCh SAML11_PROTOCOL_ENUM[]; - - /** SAML 1.x Metadata Profile ID ("urn:oasis:names:tc:SAML:profiles:v1metadata") */ - static const XMLCh SAML1_METADATA_PROFILE[]; - /** SAML 2.0 Version ("2.0") */ static const XMLCh SAML20_VERSION[]; @@ -112,6 +106,30 @@ namespace opensaml { /** SAML 2.0 XACML Attribute Profile QName prefix ("xacmlprof") */ static const XMLCh SAML20XACML_PREFIX[]; + + /** SAML 1.x Metadata Profile XML Namespace ("urn:oasis:names:tc:SAML:profiles:v1metadata") */ + static const XMLCh SAML1MD_NS[]; + + /** SAML 1.x Metadata Profile QName prefix ("saml1md") */ + static const XMLCh SAML1MD_PREFIX[]; + + /** SAML 1.0 Protocol Enumeration constant ("urn:oasis:names:tc:SAML:1.0:protocol") */ + #define SAML10_PROTOCOL_ENUM SAML1P_NS + + /** SAML 1.1 Protocol Enumeration constant ("urn:oasis:names:tc:SAML:1.1:protocol") */ + static const XMLCh SAML11_PROTOCOL_ENUM[]; + + /** SAML Query Requester Metadata Extension XML Namespace ("urn:oasis:names:tc:SAML:metadata:ext:query") */ + static const XMLCh SAML20MD_QUERY_EXT_NS[]; + + /** SAML Query Requester Metadata Extension QName prefix ("query") */ + static const XMLCh SAML20MD_QUERY_EXT_PREFIX[]; + + /** SAML Third-Party Request Protocol Extension XML Namespace ("urn:oasis:names:tc:SAML:protocol:ext:third-party") */ + static const XMLCh SAML20P_THIRDPARTY_EXT_NS[]; + + /** SAML Third-Party Request Protocol Extension QName prefix ("query") */ + static const XMLCh SAML20P_THIRDPARTY_EXT_PREFIX[]; }; }; -- 2.1.4