New endpoint management and refactored profile methods.
[shibboleth/sp.git] / shib-target / XML.cpp
1 /*
2  * The Shibboleth License, Version 1.
3  * Copyright (c) 2002
4  * University Corporation for Advanced Internet Development, Inc.
5  * All rights reserved
6  *
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution, if any, must include
17  * the following acknowledgment: "This product includes software developed by
18  * the University Corporation for Advanced Internet Development
19  * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement
20  * may appear in the software itself, if and wherever such third-party
21  * acknowledgments normally appear.
22  *
23  * Neither the name of Shibboleth nor the names of its contributors, nor
24  * Internet2, nor the University Corporation for Advanced Internet Development,
25  * Inc., nor UCAID may be used to endorse or promote products derived from this
26  * software without specific prior written permission. For written permission,
27  * please contact shibboleth@shibboleth.org
28  *
29  * Products derived from this software may not be called Shibboleth, Internet2,
30  * UCAID, or the University Corporation for Advanced Internet Development, nor
31  * may Shibboleth appear in their name, without prior written permission of the
32  * University Corporation for Advanced Internet Development.
33  *
34  *
35  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
36  * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
38  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK
39  * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE.
40  * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
41  * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT,
42  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
43  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
44  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
46  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
47  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48  */
49
50
51 /* XML.cpp - XML constants
52
53    Scott Cantor
54    6/4/02
55
56    $History:$
57 */
58
59 #include "internal.h"
60
61 using namespace shibtarget;
62
63 const char XML::htaccessType[] =            "edu.internet2.middleware.shibboleth.sp.provider.htaccess";
64 const char XML::MemorySessionCacheType[] =  "edu.internet2.middleware.shibboleth.sp.provider.MemorySessionCacheProvider";
65 const char XML::MySQLSessionCacheType[] =   "edu.internet2.middleware.shibboleth.sp.provider.MySQLSessionCacheProvider";
66 const char XML::MySQLReplayCacheType[] =    "edu.internet2.middleware.shibboleth.sp.provider.MySQLReplayCacheProvider";
67 const char XML::LegacyRequestMapType[] =    "edu.internet2.middleware.shibboleth.target.provider.XMLRequestMap";
68 const char XML::RequestMapType[] =          "edu.internet2.middleware.shibboleth.sp.provider.XMLRequestMapProvider";
69 const char XML::TCPListenerType[] =         "edu.internet2.middleware.shibboleth.sp.provider.TCPListener";
70 const char XML::UnixListenerType[] =        "edu.internet2.middleware.shibboleth.sp.provider.UnixListener";
71
72 const XMLCh XML::SHIBTARGET_SCHEMA_ID[] = // shibboleth-targetconfig-1.0.xsd
73 { chLatin_s, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h, chDash,
74   chLatin_t, chLatin_a, chLatin_r, chLatin_g, chLatin_e, chLatin_t, chLatin_c, chLatin_o, chLatin_n, chLatin_f, chLatin_i, chLatin_g, chDash,
75   chDigit_1, chPeriod, chDigit_0, chPeriod, chLatin_x, chLatin_s, chLatin_d, chNull
76 };
77
78 const XMLCh XML::SAML2ASSERT_NS[] = // urn:oasis:names:tc:SAML:2.0:assertion
79 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
80   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
81   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
82   chLatin_a, chLatin_s, chLatin_s, chLatin_e, chLatin_r, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull
83 };
84
85 const XMLCh XML::SAML2ASSERT_SCHEMA_ID[] = // saml-schema-assertion-2.0.xsd
86 { chLatin_s, chLatin_a, chLatin_m, chLatin_l, chDash,
87   chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chDash,
88   chLatin_a, chLatin_s, chLatin_s, chLatin_e, chLatin_r, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chDash,
89   chDigit_2, chPeriod, chDigit_0, chPeriod, chLatin_x, chLatin_s, chLatin_d, chNull
90 };
91
92 const XMLCh XML::SAML2META_NS[] = // urn:oasis:names:tc:SAML:2.0:metadata
93 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
94   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
95   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
96   chLatin_m, chLatin_e, chLatin_t, chLatin_a, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chNull
97 };
98
99 const XMLCh XML::SAML2META_SCHEMA_ID[] = // saml-schema-metadata-2.0.xsd
100 { chLatin_s, chLatin_a, chLatin_m, chLatin_l, chDash,
101   chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chDash,
102   chLatin_m, chLatin_e, chLatin_t, chLatin_a, chLatin_d, chLatin_a, chLatin_t, chLatin_a, chDash,
103   chDigit_2, chPeriod, chDigit_0, chPeriod, chLatin_x, chLatin_s, chLatin_d, chNull
104 };
105
106 const XMLCh XML::XMLENC_NS[] = // http://www.w3.org/2001/04/xmlenc#
107 { chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash,
108   chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash,
109   chDigit_2, chDigit_0, chDigit_0, chDigit_1, chForwardSlash, chDigit_0, chDigit_4, chForwardSlash,
110   chLatin_x, chLatin_m, chLatin_l, chLatin_e, chLatin_n, chLatin_c, chPound, chNull
111 };
112
113 const XMLCh XML::XMLENC_SCHEMA_ID[] = // xenc-schema.xsd
114 { chLatin_x, chLatin_e, chLatin_n, chLatin_c, chDash,
115   chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chPeriod, chLatin_x, chLatin_s, chLatin_d, chNull
116 };
117
118 const XMLCh XML::Literals::AAPProvider[] =
119 { chLatin_A, chLatin_A, chLatin_P, chLatin_P, chLatin_r, chLatin_o, chLatin_v, chLatin_i, chLatin_d, chLatin_e, chLatin_r, chNull };
120
121 const XMLCh XML::Literals::AccessControlProvider[] =
122 { chLatin_A, chLatin_c, chLatin_c, chLatin_e, chLatin_s, chLatin_s,
123   chLatin_C, chLatin_o, chLatin_n, chLatin_t, chLatin_r, chLatin_o, chLatin_l,
124   chLatin_P, chLatin_r, chLatin_o, chLatin_v, chLatin_i, chLatin_d, chLatin_e, chLatin_r, chNull
125 };
126
127 const XMLCh XML::Literals::applicationId[] =
128 { chLatin_a, chLatin_p, chLatin_p, chLatin_l, chLatin_i, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n,
129   chLatin_I, chLatin_d, chNull
130 };
131
132 const XMLCh XML::Literals::Application[] =
133 { chLatin_A, chLatin_p, chLatin_p, chLatin_l, chLatin_i, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull };
134
135 const XMLCh XML::Literals::Applications[] =
136 { chLatin_A, chLatin_p, chLatin_p, chLatin_l, chLatin_i, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chNull };
137
138 const XMLCh XML::Literals::AssertionConsumerService[] =
139 { chLatin_A, chLatin_s, chLatin_s, chLatin_e, chLatin_r, chLatin_t, chLatin_i, chLatin_o, chLatin_n,
140   chLatin_C, chLatin_o, chLatin_n, chLatin_s, chLatin_u, chLatin_m, chLatin_e, chLatin_r,
141   chLatin_S, chLatin_e, chLatin_r, chLatin_v, chLatin_i, chLatin_c, chLatin_e, chNull
142 };
143
144 const XMLCh XML::Literals::CredentialsProvider[] =
145 { chLatin_C, chLatin_r, chLatin_e, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_a, chLatin_l, chLatin_s,
146   chLatin_P, chLatin_r, chLatin_o, chLatin_v, chLatin_i, chLatin_d, chLatin_e, chLatin_r, chNull
147 };
148
149 const XMLCh XML::Literals::CredentialUse[] =
150 { chLatin_C, chLatin_r, chLatin_e, chLatin_d, chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_a, chLatin_l,
151   chLatin_U, chLatin_s, chLatin_e, chNull
152 };
153
154 const XMLCh XML::Literals::Extensions[] =
155 { chLatin_E, chLatin_x, chLatin_t, chLatin_e, chLatin_n, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chLatin_s, chNull };
156
157 const XMLCh XML::Literals::fatal[]= { chLatin_f, chLatin_a, chLatin_t, chLatin_a, chLatin_l, chNull };
158
159 const XMLCh XML::Literals::FederationProvider[] =
160 { chLatin_F, chLatin_e, chLatin_d, chLatin_e, chLatin_r, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n,
161   chLatin_P, chLatin_r, chLatin_o, chLatin_v, chLatin_i, chLatin_d, chLatin_e, chLatin_r, chNull
162 };
163
164 const XMLCh XML::Literals::Global[] =
165 { chLatin_G, chLatin_l, chLatin_o, chLatin_b, chLatin_a, chLatin_l, chNull };
166
167 const XMLCh XML::Literals::Host[]= { chLatin_H, chLatin_o, chLatin_s, chLatin_t, chNull };
168
169 const XMLCh XML::Literals::htaccess[]=
170 { chLatin_h, chLatin_t, chLatin_a, chLatin_c, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chNull };
171
172 const XMLCh XML::Literals::Implementation[] =
173 { chLatin_I, chLatin_m, chLatin_p, chLatin_l, chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull };
174
175 const XMLCh XML::Literals::index[] =
176 { chLatin_i, chLatin_n, chLatin_d, chLatin_e, chLatin_x, chNull };
177
178 const XMLCh XML::Literals::isDefault[] =
179 { chLatin_i, chLatin_s, chLatin_D, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull };
180
181 const XMLCh XML::Literals::Library[] =
182 { chLatin_L, chLatin_i, chLatin_b, chLatin_r, chLatin_a, chLatin_r, chLatin_y, chNull };
183
184 const XMLCh XML::Literals::Listener[] =
185 { chLatin_L, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_e, chLatin_r, chNull };
186
187 const XMLCh XML::Literals::Local[] =
188 { chLatin_L, chLatin_o, chLatin_c, chLatin_a, chLatin_l, chNull };
189
190 const XMLCh XML::Literals::logger[] =
191 { chLatin_l, chLatin_o, chLatin_g, chLatin_g, chLatin_e, chLatin_r, chNull };
192
193 const XMLCh XML::Literals::MemorySessionCache[] =
194 { chLatin_M, chLatin_e, chLatin_m, chLatin_o, chLatin_r, chLatin_y,
195   chLatin_S, chLatin_e, chLatin_s, chLatin_s, chLatin_i, chLatin_o, chLatin_n,
196   chLatin_C, chLatin_a, chLatin_c, chLatin_h, chLatin_e, chNull
197 };
198
199 const XMLCh XML::Literals::MySQLReplayCache[] =
200 { chLatin_M, chLatin_y, chLatin_S, chLatin_Q, chLatin_L,
201   chLatin_R, chLatin_e, chLatin_p, chLatin_l, chLatin_a, chLatin_y,
202   chLatin_C, chLatin_a, chLatin_c, chLatin_h, chLatin_e, chNull
203 };
204
205 const XMLCh XML::Literals::MySQLSessionCache[] =
206 { chLatin_M, chLatin_y, chLatin_S, chLatin_Q, chLatin_L,
207   chLatin_S, chLatin_e, chLatin_s, chLatin_s, chLatin_i, chLatin_o, chLatin_n,
208   chLatin_C, chLatin_a, chLatin_c, chLatin_h, chLatin_e, chNull
209 };
210
211 const XMLCh XML::Literals::name[]= { chLatin_n, chLatin_a, chLatin_m, chLatin_e, chNull };
212
213 const XMLCh XML::Literals::Name[]= { chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull };
214
215 const XMLCh XML::Literals::Path[]= { chLatin_P, chLatin_a, chLatin_t, chLatin_h, chNull };
216
217 const XMLCh XML::Literals::path[]= { chLatin_p, chLatin_a, chLatin_t, chLatin_h, chNull };
218
219 const XMLCh XML::Literals::RelyingParty[] =
220 { chLatin_R, chLatin_e, chLatin_l, chLatin_y, chLatin_i, chLatin_n, chLatin_g, chLatin_P, chLatin_a, chLatin_r, chLatin_t, chLatin_y, chNull };
221
222 const XMLCh XML::Literals::ReplayCache[] =
223 { chLatin_R, chLatin_e, chLatin_p, chLatin_l, chLatin_a, chLatin_y, chLatin_C, chLatin_a, chLatin_c, chLatin_h, chLatin_e, chNull };
224
225 const XMLCh XML::Literals::RequestMap[] =
226 { chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chLatin_M, chLatin_a, chLatin_p, chNull };
227
228 const XMLCh XML::Literals::RequestMapProvider[] =
229 { chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chLatin_M, chLatin_a, chLatin_p,
230   chLatin_P, chLatin_r, chLatin_o, chLatin_v, chLatin_i, chLatin_d, chLatin_e, chLatin_r, chNull
231 };
232
233 const XMLCh XML::Literals::RevocationProvider[] =
234 { chLatin_R, chLatin_e, chLatin_v, chLatin_o, chLatin_c, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n,
235   chLatin_P, chLatin_r, chLatin_o, chLatin_v, chLatin_i, chLatin_d, chLatin_e, chLatin_r, chNull
236 };
237
238 const XMLCh XML::Literals::SessionCache[] =
239 { chLatin_S, chLatin_e, chLatin_s, chLatin_s, chLatin_i, chLatin_o, chLatin_n,
240   chLatin_C, chLatin_a, chLatin_c, chLatin_h, chLatin_e, chNull
241 };
242
243 const XMLCh XML::Literals::SessionInitiator[] =
244 { chLatin_S, chLatin_e, chLatin_s, chLatin_s, chLatin_i, chLatin_o, chLatin_n,
245   chLatin_I, chLatin_n, chLatin_i, chLatin_t, chLatin_i, chLatin_a, chLatin_t, chLatin_o, chLatin_r, chNull
246 };
247
248 const XMLCh XML::Literals::SHAR[]= { chLatin_S, chLatin_H, chLatin_A, chLatin_R, chNull };
249
250 const XMLCh XML::Literals::ShibbolethTargetConfig[] =
251 { chLatin_S, chLatin_h, chLatin_i, chLatin_b, chLatin_b, chLatin_o, chLatin_l, chLatin_e, chLatin_t, chLatin_h,
252   chLatin_T, chLatin_a, chLatin_r, chLatin_g, chLatin_e, chLatin_t,
253   chLatin_C, chLatin_o, chLatin_n, chLatin_f, chLatin_i, chLatin_g, chNull
254 };
255
256 const XMLCh XML::Literals::SHIRE[]= { chLatin_S, chLatin_H, chLatin_I, chLatin_R, chLatin_E, chNull };
257
258 const XMLCh XML::Literals::Signing[] = { chLatin_S, chLatin_i, chLatin_g, chLatin_n, chLatin_i, chLatin_n, chLatin_g, chNull };
259
260 const XMLCh XML::Literals::SingleLogoutService[] =
261 { chLatin_S, chLatin_i, chLatin_n, chLatin_g, chLatin_l, chLatin_e,
262   chLatin_L, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t,
263   chLatin_S, chLatin_e, chLatin_r, chLatin_v, chLatin_i, chLatin_c, chLatin_e, chNull
264 };
265
266 const XMLCh XML::Literals::SPConfig[] =
267 { chLatin_S, chLatin_P, chLatin_C, chLatin_o, chLatin_n, chLatin_f, chLatin_i, chLatin_g, chNull };
268
269 const XMLCh XML::Literals::TCPListener[] =
270 { chLatin_T, chLatin_C, chLatin_P, chLatin_L, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_e, chLatin_r, chNull };
271
272 const XMLCh XML::Literals::TLS[]= { chLatin_T, chLatin_L, chLatin_S, chNull };
273
274 const XMLCh XML::Literals::TrustProvider[] =
275 { chLatin_T, chLatin_r, chLatin_u, chLatin_s, chLatin_t,
276   chLatin_P, chLatin_r, chLatin_o, chLatin_v, chLatin_i, chLatin_d, chLatin_e, chLatin_r, chNull
277 };
278
279 const XMLCh XML::Literals::type[]= { chLatin_t, chLatin_y, chLatin_p, chLatin_e, chNull };
280
281 const XMLCh XML::Literals::UnixListener[] =
282 { chLatin_U, chLatin_n, chLatin_i, chLatin_x, chLatin_L, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_e, chLatin_r, chNull };