From 4581323633f83a9c3522326c31710daa01ba38f8 Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Wed, 3 May 2006 20:57:48 +0000 Subject: [PATCH] Initial check-in. --- saml/util/XMLConstants.cpp | 161 +++++++++++++++++++++++++++++++++++++++++++++ saml/util/XMLConstants.h | 116 ++++++++++++++++++++++++++++++++ 2 files changed, 277 insertions(+) create mode 100644 saml/util/XMLConstants.cpp create mode 100644 saml/util/XMLConstants.h diff --git a/saml/util/XMLConstants.cpp b/saml/util/XMLConstants.cpp new file mode 100644 index 0000000..5290bed --- /dev/null +++ b/saml/util/XMLConstants.cpp @@ -0,0 +1,161 @@ +/* + * Copyright 2001-2006 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * XMLConstants.cpp + * + * SAML XML namespace constants + */ + + +#include "internal.h" +#include "util/XMLConstants.h" +#include + +using namespace xercesc; +using namespace opensaml; + +const XMLCh XMLConstants::SOAP11ENV_NS[] = // http://schemas.xmlsoap.org/soap/envelope/ +{ chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash, + chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_s, chPeriod, + chLatin_x, chLatin_m, chLatin_l, chLatin_s, chLatin_o, chLatin_a, chLatin_p, chPeriod, + chLatin_o, chLatin_r, chLatin_g, chForwardSlash, + chLatin_s, chLatin_o, chLatin_a, chLatin_p, chForwardSlash, + chLatin_e, chLatin_n, chLatin_v, chLatin_e, chLatin_l, chLatin_o, chLatin_p, chLatin_e, chForwardSlash, chNull +}; + +const XMLCh XMLConstants::SOAP11ENV_PREFIX[] = UNICODE_LITERAL_1(S); + +const XMLCh XMLConstants::PAOS_NS[] = // urn:liberty:paos:2003-08 +{ chLatin_u, chLatin_r, chLatin_n, chColon, + chLatin_l, chLatin_i, chLatin_b, chLatin_e, chLatin_r, chLatin_t, chLatin_y, chColon, + chLatin_p, chLatin_a, chLatin_o, chLatin_s, chColon, + chDigit_2, chDigit_0, chDigit_0, chDigit_3, chDash, chDigit_0, chDigit_8, chNull +}; + +const XMLCh XMLConstants::PAOS_PREFIX[] = UNICODE_LITERAL_4(p,a,o,s); + +const XMLCh XMLConstants::SAML1_NS[] = // urn:oasis:names:tc:SAML:1.0:assertion +{ 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_s, chLatin_s, chLatin_e, chLatin_r, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull +}; + +const XMLCh XMLConstants::SAML1P_NS[] = // urn:oasis:names:tc:SAML:1.0: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_0, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chNull +}; + +const XMLCh XMLConstants::SAML1_PREFIX[] = UNICODE_LITERAL_4(s,a,m,l); + +const XMLCh XMLConstants::SAML1P_PREFIX[] = UNICODE_LITERAL_5(s,a,m,l,p); + +const XMLCh XMLConstants::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 XMLConstants::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 XMLConstants::SAML20_NS[] = // urn:oasis:names:tc:SAML:2.0:assertion +{ 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_s, chLatin_s, chLatin_e, chLatin_r, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull +}; + +const XMLCh XMLConstants::SAML20P_NS[] = // urn:oasis:names:tc:SAML:2.0: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_2, chPeriod, chDigit_0, chColon, + chLatin_p, chLatin_r, chLatin_o, chLatin_t, chLatin_o, chLatin_c, chLatin_o, chLatin_l, chNull +}; + +const XMLCh XMLConstants::SAML20MD_NS[] = // urn:oasis:names:tc:SAML:2.0:metadata +{ 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_m, chLatin_e, chLatin_t, chLatin_a, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chNull +}; + +const XMLCh XMLConstants::SAML20AC_NS[] = // urn:oasis:names:tc:SAML:2.0:ac +{ 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_c, chNull +}; + +const XMLCh XMLConstants::SAML20_PREFIX[] = UNICODE_LITERAL_4(s,a,m,l); + +const XMLCh XMLConstants::SAML20P_PREFIX[] = UNICODE_LITERAL_5(s,a,m,l,p); + +const XMLCh XMLConstants::SAML20MD_PREFIX[] = UNICODE_LITERAL_2(m,d); + +const XMLCh XMLConstants::SAML20AC_PREFIX[] = UNICODE_LITERAL_2(a,c); + +const XMLCh XMLConstants::SAML20ECP_NS[] = // urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp +{ 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_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_S, chLatin_S, chLatin_O, chColon, chLatin_e, chLatin_c, chLatin_p, chNull +}; + +const XMLCh XMLConstants::SAML20ECP_PREFIX[] = UNICODE_LITERAL_3(e,c,p); + +const XMLCh XMLConstants::SAML20DCE_NS[] = // urn:oasis:names:tc:SAML:2.0:profiles:attribute:DCE +{ 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_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chColon, + chLatin_D, chLatin_C, chLatin_E, chNull +}; + +const XMLCh XMLConstants::SAML20DCE_PREFIX[] = UNICODE_LITERAL_3(D,C,E); + +const XMLCh XMLConstants::SAML20X500_NS[] = // urn:oasis:names:tc:SAML:2.0:profiles:attribute:X500 +{ 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_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chColon, + chLatin_X, chDigit_5, chDigit_0, chDigit_0, chNull +}; + +const XMLCh XMLConstants::SAML20X500_PREFIX[] = { chLatin_x, chDigit_5, chDigit_0, chDigit_0 }; + +const XMLCh XMLConstants::SAML20XACML_NS[] = // urn:oasis:names:tc:SAML:2.0:profiles:attribute:XACML +{ 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_p, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chLatin_s, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_i, chLatin_b, chLatin_u, chLatin_t, chLatin_e, chColon, + chLatin_X, chLatin_A, chLatin_C, chLatin_M, chLatin_L, chNull +}; + +const XMLCh XMLConstants::SAML20XACML_PREFIX[] = UNICODE_LITERAL_9(x,a,c,m,l,p,r,o,f); diff --git a/saml/util/XMLConstants.h b/saml/util/XMLConstants.h new file mode 100644 index 0000000..af7d4ba --- /dev/null +++ b/saml/util/XMLConstants.h @@ -0,0 +1,116 @@ +/* + * Copyright 2001-2006 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file XMLConstants.h + * + * SAML XML namespace constants + */ + +#ifndef __saml_xmlconstants_h__ +#define __saml_xmlconstants_h__ + +#include + +namespace opensaml { + + /** + * SAML related constants. + */ + struct SAML_API XMLConstants : public xmltooling::XMLConstants + { + /** SOAP 1.1 Envelope XML namespace ("http://schemas.xmlsoap.org/soap/envelope/") */ + static const XMLCh SOAP11ENV_NS[]; + + /** SOAP 1.1 Envelope QName prefix ("S") */ + static const XMLCh SOAP11ENV_PREFIX[]; + + /** Liberty PAOS XML Namespace ("urn:liberty:paos:2003-08") */ + static const XMLCh PAOS_NS[]; + + /** Liberty PAOS QName prefix ("paos") */ + static const XMLCh PAOS_PREFIX[]; + + /** SAML 1.X Assertion XML namespace ("urn:oasis:names:tc:SAML:1.0:assertion") */ + static const XMLCh SAML1_NS[]; + + /** SAML 1.X Protocol XML namespace ("urn:oasis:names:tc:SAML:1.0:protocol") */ + static const XMLCh SAML1P_NS[]; + + /** SAML 1.X Assertion QName prefix ("saml") */ + static const XMLCh SAML1_PREFIX[]; + + /** 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 Assertion XML namespace ("urn:oasis:names:tc:SAML:2.0:assertion") */ + static const XMLCh SAML20_NS[]; + + /** SAML 2.0 Protocol XML namespace ("urn:oasis:names:tc:SAML:2.0:protocol") */ + static const XMLCh SAML20P_NS[]; + + /** SAML 2.0 Metadata XML namespace ("urn:oasis:names:tc:SAML:2.0:metadata") */ + static const XMLCh SAML20MD_NS[]; + + /** SAML 2.0 AuthnContext XML namespace ("urn:oasis:names:tc:SAML:2.0:ac") */ + static const XMLCh SAML20AC_NS[]; + + /** SAML 2.0 Assertion QName prefix ("saml") */ + static const XMLCh SAML20_PREFIX[]; + + /** SAML 2.0 Protocol QName prefix ("samlp") */ + static const XMLCh SAML20P_PREFIX[]; + + /** SAML 2.0 Metadata QName prefix ("md") */ + static const XMLCh SAML20MD_PREFIX[]; + + /** SAML 2.0 AuthnContext QName prefix ("ac") */ + static const XMLCh SAML20AC_PREFIX[]; + + /** SAML 2.0 Enhanced Client/Proxy SSO Profile XML Namespace ("urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp") */ + static const XMLCh SAML20ECP_NS[]; + + /** SAML 2.0 Enhanced Client/Proxy SSO Profile QName prefix ("ecp") */ + static const XMLCh SAML20ECP_PREFIX[]; + + /** SAML 2.0 DCE PAC Attribute Profile XML Namespace ("urn:oasis:names:tc:SAML:2.0:profiles:attribute:DCE") */ + static const XMLCh SAML20DCE_NS[]; + + /** SAML 2.0 DCE PAC Attribute Profile QName prefix ("DCE") */ + static const XMLCh SAML20DCE_PREFIX[]; + + /** SAML 2.0 X.500 Attribute Profile XML Namespace ("urn:oasis:names:tc:SAML:2.0:profiles:attribute:X500") */ + static const XMLCh SAML20X500_NS[]; + + /** SAML 2.0 X.500 Attribute Profile QName prefix ("x500") */ + static const XMLCh SAML20X500_PREFIX[]; + + /** SAML 2.0 XACML Attribute Profile XML Namespace ("urn:oasis:names:tc:SAML:2.0:profiles:attribute:XACML") */ + static const XMLCh SAML20XACML_NS[]; + + /** SAML 2.0 XACML Attribute Profile QName prefix ("xacmlprof") */ + static const XMLCh SAML20XACML_PREFIX[]; + }; + +}; + +#endif /* __saml_xmlconstants_h__ */ -- 2.1.4