From 5b4f12f4528d494f8f365ef99dcd4a1ec8c40efd Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Tue, 10 Jul 2012 02:47:12 +0000 Subject: [PATCH] https://issues.shibboleth.net/jira/browse/SSPCPP-469 --- saml/saml2/core/Protocols.h | 7 +++++++ saml/saml2/core/impl/Protocols20Impl.cpp | 25 ++++++++++++++++++++++++- saml/util/SAMLConstants.cpp | 11 +++++++++++ saml/util/SAMLConstants.h | 6 ++++++ schemas/saml-async-slo-v1.0.xsd | 13 +++++++++++++ schemas/saml20-catalog.xml.in | 1 + 6 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 schemas/saml-async-slo-v1.0.xsd diff --git a/saml/saml2/core/Protocols.h b/saml/saml2/core/Protocols.h index f487295..52e65a7 100644 --- a/saml/saml2/core/Protocols.h +++ b/saml/saml2/core/Protocols.h @@ -50,6 +50,11 @@ namespace opensaml { DECL_XMLOBJECT_SIMPLE(SAML_API,RespondTo,Name,SAML 2.0 third-party request RespondTo extension element); + BEGIN_XMLOBJECT(SAML_API,Asynchronous,xmltooling::XMLObject,SAML 2.0 Asynchronous logout extension element); + /** AsynchronousType local name */ + static const XMLCh TYPE_NAME[]; + END_XMLOBJECT; + BEGIN_XMLOBJECT(SAML_API,Extensions,xmltooling::ElementExtensibleXMLObject,SAML 2.0 protocol Extensions element); /** ExtensionsType local name */ static const XMLCh TYPE_NAME[]; @@ -393,6 +398,8 @@ namespace opensaml { DECL_XMLOBJECTBUILDER(SAML_API,RespondTo,samlconstants::SAML20P_THIRDPARTY_EXT_NS,samlconstants::SAML20P_THIRDPARTY_EXT_PREFIX); + DECL_XMLOBJECTBUILDER(SAML_API,Asynchronous,samlconstants::SAML20P_ASYNCSLO_EXT_NS,samlconstants::SAML20P_ASYNCSLO_EXT_PREFIX); + /** * Registers builders and validators for SAML 2.0 Protocol classes into the runtime. */ diff --git a/saml/saml2/core/impl/Protocols20Impl.cpp b/saml/saml2/core/impl/Protocols20Impl.cpp index bfd4d82..95e75cd 100644 --- a/saml/saml2/core/impl/Protocols20Impl.cpp +++ b/saml/saml2/core/impl/Protocols20Impl.cpp @@ -71,7 +71,27 @@ namespace opensaml { DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,RespondTo); - //TODO need unit test for this, using objects from another namespace + class SAML_DLLLOCAL AsynchronousImpl : public virtual Asynchronous, + public AbstractSimpleElement, + public AbstractDOMCachingXMLObject, + public AbstractXMLObjectMarshaller, + public AbstractXMLObjectUnmarshaller + { + public: + virtual ~AsynchronousImpl() {} + + AsynchronousImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) {} + + AsynchronousImpl(const AsynchronousImpl& src) + : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {} + + IMPL_XMLOBJECT_CLONE(Asynchronous); + + protected: + // has no attributes or children + }; + class SAML_DLLLOCAL ExtensionsImpl : public virtual Extensions, public AbstractComplexElement, public AbstractDOMCachingXMLObject, @@ -1559,6 +1579,7 @@ IMPL_XMLOBJECTBUILDER(StatusMessage); IMPL_XMLOBJECTBUILDER(Terminate); IMPL_XMLOBJECTBUILDER(RespondTo); +IMPL_XMLOBJECTBUILDER(Asynchronous); // Unicode literals const XMLCh Artifact::LOCAL_NAME[] = UNICODE_LITERAL_8(A,r,t,i,f,a,c,t); @@ -1568,6 +1589,8 @@ const XMLCh ArtifactResponse::LOCAL_NAME[] = UNICODE_LITERAL_16(A,r,t,i,f,a,c,t, const XMLCh ArtifactResponse::TYPE_NAME[] = UNICODE_LITERAL_20(A,r,t,i,f,a,c,t,R,e,s,p,o,n,s,e,T,y,p,e); const XMLCh AssertionIDRequest::LOCAL_NAME[] = UNICODE_LITERAL_18(A,s,s,e,r,t,i,o,n,I,D,R,e,q,u,e,s,t); const XMLCh AssertionIDRequest::TYPE_NAME[] = UNICODE_LITERAL_22(A,s,s,e,r,t,i,o,n,I,D,R,e,q,u,e,s,t,T,y,p,e); +const XMLCh Asynchronous::LOCAL_NAME[] = UNICODE_LITERAL_12(A,s,y,n,c,h,r,o,n,o,u,s); +const XMLCh Asynchronous::TYPE_NAME[] = UNICODE_LITERAL_16(A,s,y,n,c,h,r,o,n,o,u,s,T,y,p,e); const XMLCh AttributeQuery::LOCAL_NAME[] = UNICODE_LITERAL_14(A,t,t,r,i,b,u,t,e,Q,u,e,r,y); const XMLCh AttributeQuery::TYPE_NAME[] = UNICODE_LITERAL_18(A,t,t,r,i,b,u,t,e,Q,u,e,r,y,T,y,p,e); const XMLCh AuthnQuery::LOCAL_NAME[] = UNICODE_LITERAL_10(A,u,t,h,n,Q,u,e,r,y); diff --git a/saml/util/SAMLConstants.cpp b/saml/util/SAMLConstants.cpp index 731693f..0ed80f2 100644 --- a/saml/util/SAMLConstants.cpp +++ b/saml/util/SAMLConstants.cpp @@ -188,6 +188,17 @@ const XMLCh samlconstants::SAML20P_THIRDPARTY_EXT_NS[] = // urn:oasis:names:tc:S const XMLCh samlconstants::SAML20P_THIRDPARTY_EXT_PREFIX[] = UNICODE_LITERAL_6(t,h,r,p,t,y); +const XMLCh samlconstants::SAML20P_ASYNCSLO_EXT_NS[] = // urn:oasis:names:tc:SAML:2.0:protocol:ext:async-slo +{ 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, chDigit_0, 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_a, chLatin_s, chLatin_y, chLatin_n, chLatin_c, chDash, chLatin_s, chLatin_l, chLatin_o, chNull +}; + +const XMLCh samlconstants::SAML20P_ASYNCSLO_EXT_PREFIX[] = UNICODE_LITERAL_4(a,s,l,o); + const XMLCh samlconstants::SAML20_ATTRIBUTE_EXT_NS[] = // urn:oasis:names:tc:SAML:attribute:ext { 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, diff --git a/saml/util/SAMLConstants.h b/saml/util/SAMLConstants.h index 6a9d2a5..f74dfb6 100644 --- a/saml/util/SAMLConstants.h +++ b/saml/util/SAMLConstants.h @@ -128,6 +128,12 @@ namespace samlconstants { /** SAML Third-Party Request Protocol Extension QName prefix ("thrpty") */ extern SAML_API const XMLCh SAML20P_THIRDPARTY_EXT_PREFIX[]; + /** SAML Asynchronous Logout Protocol Extension XML Namespace ("urn:oasis:names:tc:SAML:2.0:protocol:ext:async-slo") */ + extern SAML_API const XMLCh SAML20P_ASYNCSLO_EXT_NS[]; + + /** SAML Asynchronous Logout Protocol Extension QName prefix ("aslo") */ + extern SAML_API const XMLCh SAML20P_ASYNCSLO_EXT_PREFIX[]; + /** SAML Attribute Extension XML Namespace ("urn:oasis:names:tc:SAML:attribute:ext") */ extern SAML_API const XMLCh SAML20_ATTRIBUTE_EXT_NS[]; diff --git a/schemas/saml-async-slo-v1.0.xsd b/schemas/saml-async-slo-v1.0.xsd new file mode 100644 index 0000000..2a64b89 --- /dev/null +++ b/schemas/saml-async-slo-v1.0.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/schemas/saml20-catalog.xml.in b/schemas/saml20-catalog.xml.in index b5ef6d3..e480f57 100644 --- a/schemas/saml20-catalog.xml.in +++ b/schemas/saml20-catalog.xml.in @@ -18,4 +18,5 @@ + -- 2.1.4