2 * Copyright 2001-2006 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file saml/saml2/metadata/Metadata.h
20 * XMLObjects representing the SAML 2.0 Metadata schema
23 #ifndef __saml2_metadata_h__
24 #define __saml2_metadata_h__
26 #include <saml/saml2/core/Assertions.h>
27 #include <saml/util/SAMLConstants.h>
30 #include <xmltooling/AttributeExtensibleXMLObject.h>
31 #include <xmltooling/ElementProxy.h>
32 #include <xmltooling/SimpleElement.h>
33 #include <xmltooling/XMLObjectBuilder.h>
34 #include <xmltooling/encryption/Encryption.h>
35 #include <xmltooling/signature/KeyInfo.h>
36 #include <xmltooling/signature/Signature.h>
37 #include <xmltooling/util/DateTime.h>
39 #define DECL_SAML2MDOBJECTBUILDER(cname) \
40 DECL_XMLOBJECTBUILDER(SAML_API,cname,opensaml::SAMLConstants::SAML20MD_NS,opensaml::SAMLConstants::SAML20MD_PREFIX)
45 * @namespace opensaml::saml2md
46 * SAML 2.0 metadata namespace
51 * Base class for metadata objects that feature a cacheDuration attribute.
53 class SAML_API CacheableSAMLObject : public virtual xmltooling::XMLObject
56 CacheableSAMLObject() {}
58 ~CacheableSAMLObject() {}
59 DECL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION);
63 * Base class for metadata objects that feature a validUntil attribute.
65 class SAML_API TimeBoundSAMLObject : public virtual xmltooling::XMLObject
68 TimeBoundSAMLObject() {}
70 ~TimeBoundSAMLObject() {}
71 DECL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL);
72 /** Returns true iff the object is valid at the current time. */
73 bool isValid() const {
74 return time(NULL) <= getValidUntilEpoch();
78 DECL_XMLOBJECT_SIMPLE(SAML_API,AffiliateMember,ID,SAML 2.0 AffiliateMember element);
79 DECL_XMLOBJECT_SIMPLE(SAML_API,AttributeProfile,ProfileURI,SAML 2.0 AttributeProfile element);
80 DECL_XMLOBJECT_SIMPLE(SAML_API,Company,Name,SAML 2.0 Company element);
81 DECL_XMLOBJECT_SIMPLE(SAML_API,EmailAddress,Address,SAML 2.0 EmailAddress element);
82 DECL_XMLOBJECT_SIMPLE(SAML_API,GivenName,Name,SAML 2.0 GivenName element);
83 DECL_XMLOBJECT_SIMPLE(SAML_API,NameIDFormat,Format,SAML 2.0 NameIDFormat element);
84 DECL_XMLOBJECT_SIMPLE(SAML_API,SurName,Name,SAML 2.0 SurName element);
85 DECL_XMLOBJECT_SIMPLE(SAML_API,TelephoneNumber,Number,SAML 2.0 TelephoneNumber element);
87 DECL_XMLOBJECT_SIMPLE(SAML_API,ActionNamespace,Namespace,SAML 2.0 Metadata Extension ActionNamespace element);
88 DECL_XMLOBJECT_SIMPLE(SAML_API,SourceID,ID,SAML 1.x Metadata Profile SourceID element);
90 BEGIN_XMLOBJECT(SAML_API,localizedNameType,xmltooling::SimpleElement,SAML 2.0 localizedNameType type);
91 DECL_STRING_ATTRIB(Lang,LANG);
92 /** localizedNameType local name */
93 static const XMLCh TYPE_NAME[];
96 BEGIN_XMLOBJECT(SAML_API,localizedURIType,xmltooling::SimpleElement,SAML 2.0 localizedURIType type);
97 DECL_STRING_ATTRIB(Lang,LANG);
98 /** localizedURIType local name */
99 static const XMLCh TYPE_NAME[];
102 BEGIN_XMLOBJECT(SAML_API,OrganizationName,localizedNameType,SAML 2.0 OrganizationName element);
103 DECL_XMLOBJECT_CONTENT(Name);
106 BEGIN_XMLOBJECT(SAML_API,OrganizationDisplayName,localizedNameType,SAML 2.0 OrganizationDisplayName element);
107 DECL_XMLOBJECT_CONTENT(Name);
110 BEGIN_XMLOBJECT(SAML_API,OrganizationURL,localizedURIType,SAML 2.0 OrganizationURL element);
111 DECL_XMLOBJECT_CONTENT(URL);
114 BEGIN_XMLOBJECT(SAML_API,Extensions,xmltooling::ElementProxy,SAML 2.0 Extensions element);
115 /** ExtensionsType local name */
116 static const XMLCh TYPE_NAME[];
119 BEGIN_XMLOBJECT(SAML_API,Organization,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 Organization element);
120 DECL_TYPED_CHILD(Extensions);
121 DECL_TYPED_CHILDREN(OrganizationName);
122 DECL_TYPED_CHILDREN(OrganizationDisplayName);
123 DECL_TYPED_CHILDREN(OrganizationURL);
124 /** OrganizationType local name */
125 static const XMLCh TYPE_NAME[];
128 BEGIN_XMLOBJECT(SAML_API,ContactPerson,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 ContactPerson element);
129 DECL_STRING_ATTRIB(ContactType,CONTACTTYPE);
130 DECL_TYPED_CHILD(Extensions);
131 DECL_TYPED_CHILD(Company);
132 DECL_TYPED_CHILD(GivenName);
133 DECL_TYPED_CHILD(SurName);
134 DECL_TYPED_CHILDREN(EmailAddress);
135 DECL_TYPED_CHILDREN(TelephoneNumber);
136 /** ContactType local name */
137 static const XMLCh TYPE_NAME[];
138 /** technical Contact Type */
139 static const XMLCh CONTACT_TECHNICAL[];
140 /** support Contact Type */
141 static const XMLCh CONTACT_SUPPORT[];
142 /** administrative Contact Type */
143 static const XMLCh CONTACT_ADMINISTRATIVE[];
144 /** billing Contact Type */
145 static const XMLCh CONTACT_BILLING[];
146 /** other Contact Type */
147 static const XMLCh CONTACT_OTHER[];
150 BEGIN_XMLOBJECT(SAML_API,AdditionalMetadataLocation,xmltooling::SimpleElement,SAML 2.0 AdditionalMetadataLocation element);
151 DECL_STRING_ATTRIB(Namespace,NAMESPACE);
152 DECL_XMLOBJECT_CONTENT(Location);
153 /** AdditionalMetadataLocationType local name */
154 static const XMLCh TYPE_NAME[];
157 BEGIN_XMLOBJECT(SAML_API,KeyDescriptor,xmltooling::XMLObject,SAML 2.0 KeyDescriptor element);
158 DECL_STRING_ATTRIB(Use,USE);
159 DECL_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature);
160 DECL_TYPED_FOREIGN_CHILDREN(EncryptionMethod,xmlencryption);
161 /** KeyDescriptorType local name */
162 static const XMLCh TYPE_NAME[];
163 /** encryption Key Type */
164 static const XMLCh KEYTYPE_ENCRYPTION[];
165 /** signing Key Type */
166 static const XMLCh KEYTYPE_SIGNING[];
169 BEGIN_XMLOBJECT4(SAML_API,RoleDescriptor,xmltooling::AttributeExtensibleXMLObject,SignableObject,
170 CacheableSAMLObject,TimeBoundSAMLObject,SAML 2.0 RoleDescriptor abstract element);
171 DECL_STRING_ATTRIB(ID,ID);
172 DECL_STRING_ATTRIB(ProtocolSupportEnumeration,PROTOCOLSUPPORTENUMERATION);
173 /** Searches the ProtocolSupportEnumeration attribute for the indicated protocol. */
174 virtual bool hasSupport(const XMLCh* protocol) const=0;
175 DECL_STRING_ATTRIB(ErrorURL,ERRORURL);
176 DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature);
177 DECL_TYPED_CHILD(Extensions);
178 DECL_TYPED_CHILDREN(KeyDescriptor);
179 DECL_TYPED_CHILD(Organization);
180 DECL_TYPED_CHILDREN(ContactPerson);
183 BEGIN_XMLOBJECT2(SAML_API,EndpointType,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 EndpointType type);
184 DECL_STRING_ATTRIB(Binding,BINDING);
185 DECL_STRING_ATTRIB(Location,LOCATION);
186 DECL_STRING_ATTRIB(ResponseLocation,RESPONSELOCATION);
187 /** EndpointType local name */
188 static const XMLCh TYPE_NAME[];
191 BEGIN_XMLOBJECT(SAML_API,IndexedEndpointType,EndpointType,SAML 2.0 IndexedEndpointType type);
192 DECL_INTEGER_ATTRIB(Index,INDEX);
193 DECL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT);
194 /** IndexedEndpointType local name */
195 static const XMLCh TYPE_NAME[];
198 BEGIN_XMLOBJECT(SAML_API,ArtifactResolutionService,IndexedEndpointType,SAML 2.0 ArtifactResolutionService element);
201 BEGIN_XMLOBJECT(SAML_API,SingleLogoutService,EndpointType,SAML 2.0 SingleLogoutService element);
204 BEGIN_XMLOBJECT(SAML_API,ManageNameIDService,EndpointType,SAML 2.0 ManageNameIDService element);
207 BEGIN_XMLOBJECT(SAML_API,SSODescriptorType,RoleDescriptor,SAML 2.0 SSODescriptorType abstract type);
208 DECL_TYPED_CHILDREN(ArtifactResolutionService);
209 DECL_TYPED_CHILDREN(SingleLogoutService);
210 DECL_TYPED_CHILDREN(ManageNameIDService);
211 DECL_TYPED_CHILDREN(NameIDFormat);
212 /** SSODescriptorType local name */
213 static const XMLCh TYPE_NAME[];
216 BEGIN_XMLOBJECT(SAML_API,SingleSignOnService,EndpointType,SAML 2.0 SingleSignOnService element);
219 BEGIN_XMLOBJECT(SAML_API,NameIDMappingService,EndpointType,SAML 2.0 NameIDMappingService element);
222 BEGIN_XMLOBJECT(SAML_API,AssertionIDRequestService,EndpointType,SAML 2.0 AssertionIDRequestService element);
225 BEGIN_XMLOBJECT(SAML_API,IDPSSODescriptor,SSODescriptorType,SAML 2.0 IDPSSODescriptor element);
226 DECL_BOOLEAN_ATTRIB(WantAuthnRequestsSigned,WANTAUTHNREQUESTSSIGNED);
227 DECL_TYPED_CHILDREN(SingleSignOnService);
228 DECL_TYPED_CHILDREN(NameIDMappingService);
229 DECL_TYPED_CHILDREN(AssertionIDRequestService);
230 DECL_TYPED_CHILDREN(AttributeProfile);
231 DECL_TYPED_FOREIGN_CHILDREN(Attribute,saml2);
232 /** IDPSSODescriptorType local name */
233 static const XMLCh TYPE_NAME[];
236 BEGIN_XMLOBJECT(SAML_API,ServiceName,localizedNameType,SAML 2.0 ServiceName element);
237 DECL_XMLOBJECT_CONTENT(Name);
240 BEGIN_XMLOBJECT(SAML_API,ServiceDescription,localizedNameType,SAML 2.0 ServiceDescription element);
241 DECL_XMLOBJECT_CONTENT(Description);
244 BEGIN_XMLOBJECT(SAML_API,RequestedAttribute,saml2::Attribute,SAML 2.0 RequestedAttribute element);
245 DECL_BOOLEAN_ATTRIB(isRequired,ISREQUIRED);
246 /** RequestedAttributeType local name */
247 static const XMLCh TYPE_NAME[];
250 BEGIN_XMLOBJECT(SAML_API,AttributeConsumingService,xmltooling::XMLObject,SAML 2.0 AttributeConsumingService element);
251 DECL_INTEGER_ATTRIB(Index,INDEX);
252 DECL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT);
253 DECL_TYPED_CHILDREN(ServiceName);
254 DECL_TYPED_CHILDREN(ServiceDescription);
255 DECL_TYPED_CHILDREN(RequestedAttribute);
256 /** AttributeConsumingServiceType local name */
257 static const XMLCh TYPE_NAME[];
260 BEGIN_XMLOBJECT(SAML_API,AssertionConsumerService,IndexedEndpointType,SAML 2.0 AssertionConsumerService element);
263 BEGIN_XMLOBJECT(SAML_API,SPSSODescriptor,SSODescriptorType,SAML 2.0 SPSSODescriptor element);
264 DECL_BOOLEAN_ATTRIB(AuthnRequestsSigned,AUTHNREQUESTSSIGNED);
265 DECL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED);
266 DECL_TYPED_CHILDREN(AssertionConsumerService);
267 DECL_TYPED_CHILDREN(AttributeConsumingService);
268 /** SPSSODescriptorType local name */
269 static const XMLCh TYPE_NAME[];
272 BEGIN_XMLOBJECT(SAML_API,AuthnQueryService,EndpointType,SAML 2.0 AuthnQueryService element);
275 BEGIN_XMLOBJECT(SAML_API,AuthnAuthorityDescriptor,RoleDescriptor,SAML 2.0 AuthnAuthorityDescriptor element);
276 DECL_TYPED_CHILDREN(AuthnQueryService);
277 DECL_TYPED_CHILDREN(AssertionIDRequestService);
278 DECL_TYPED_CHILDREN(NameIDFormat);
279 /** AuthnAuthorityDescriptorType local name */
280 static const XMLCh TYPE_NAME[];
283 BEGIN_XMLOBJECT(SAML_API,AuthzService,EndpointType,SAML 2.0 AuthzService element);
286 BEGIN_XMLOBJECT(SAML_API,PDPDescriptor,RoleDescriptor,SAML 2.0 PDPDescriptor element);
287 DECL_TYPED_CHILDREN(AuthzService);
288 DECL_TYPED_CHILDREN(AssertionIDRequestService);
289 DECL_TYPED_CHILDREN(NameIDFormat);
290 /** PDPDescriptorType local name */
291 static const XMLCh TYPE_NAME[];
294 BEGIN_XMLOBJECT(SAML_API,AttributeService,EndpointType,SAML 2.0 AttributeService element);
297 BEGIN_XMLOBJECT(SAML_API,AttributeAuthorityDescriptor,RoleDescriptor,SAML 2.0 AttributeAuthorityDescriptor element);
298 DECL_TYPED_CHILDREN(AttributeService);
299 DECL_TYPED_CHILDREN(AssertionIDRequestService);
300 DECL_TYPED_CHILDREN(NameIDFormat);
301 DECL_TYPED_CHILDREN(AttributeProfile);
302 DECL_TYPED_FOREIGN_CHILDREN(Attribute,saml2);
303 /** AttributeAuthorityDescriptorType local name */
304 static const XMLCh TYPE_NAME[];
307 BEGIN_XMLOBJECT(SAML_API,QueryDescriptorType,RoleDescriptor,SAML 2.0 QueryDescriptorType abstract type);
308 DECL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED);
309 DECL_TYPED_CHILDREN(NameIDFormat);
310 /** QueryDescriptorType local name */
311 static const XMLCh TYPE_NAME[];
314 BEGIN_XMLOBJECT(SAML_API,AuthnQueryDescriptorType,QueryDescriptorType,SAML 2.0 AuthnQueryDescriptorType extension type);
315 /** AuthnQueryDescriptorType local name */
316 static const XMLCh TYPE_NAME[];
319 BEGIN_XMLOBJECT(SAML_API,AttributeQueryDescriptorType,QueryDescriptorType,SAML 2.0 AttributeQueryDescriptorType extension type);
320 DECL_TYPED_CHILDREN(AttributeConsumingService);
321 /** AttributeQueryDescriptorType local name */
322 static const XMLCh TYPE_NAME[];
325 BEGIN_XMLOBJECT(SAML_API,AuthzDecisionQueryDescriptorType,QueryDescriptorType,SAML 2.0 AuthzDecisionQueryDescriptorType extension type);
326 DECL_TYPED_CHILDREN(ActionNamespace);
327 /** AuthzDecisionQueryDescriptorType local name */
328 static const XMLCh TYPE_NAME[];
331 BEGIN_XMLOBJECT4(SAML_API,AffiliationDescriptor,xmltooling::AttributeExtensibleXMLObject,SignableObject,
332 CacheableSAMLObject,TimeBoundSAMLObject,SAML 2.0 AffiliationDescriptor element);
333 DECL_STRING_ATTRIB(ID,ID);
334 DECL_STRING_ATTRIB(AffiliationOwnerID,AFFILIATIONOWNERID);
335 DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature);
336 DECL_TYPED_CHILD(Extensions);
337 DECL_TYPED_CHILDREN(AffiliateMember);
338 DECL_TYPED_CHILDREN(KeyDescriptor);
339 /** AffiliationDescriptorType local name */
340 static const XMLCh TYPE_NAME[];
343 BEGIN_XMLOBJECT4(SAML_API,EntityDescriptor,xmltooling::AttributeExtensibleXMLObject,SignableObject,
344 CacheableSAMLObject,TimeBoundSAMLObject,SAML 2.0 EntityDescriptor element);
345 DECL_STRING_ATTRIB(ID,ID);
346 DECL_STRING_ATTRIB(EntityID,ENTITYID);
347 DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature);
348 DECL_TYPED_CHILD(Extensions);
349 DECL_TYPED_CHILD(AffiliationDescriptor);
350 DECL_TYPED_CHILDREN(RoleDescriptor);
351 DECL_TYPED_CHILDREN(IDPSSODescriptor);
352 DECL_TYPED_CHILDREN(SPSSODescriptor);
353 DECL_TYPED_CHILDREN(AuthnAuthorityDescriptor);
354 DECL_TYPED_CHILDREN(AttributeAuthorityDescriptor);
355 DECL_TYPED_CHILDREN(PDPDescriptor);
356 DECL_TYPED_CHILDREN(AuthnQueryDescriptorType);
357 DECL_TYPED_CHILDREN(AttributeQueryDescriptorType);
358 DECL_TYPED_CHILDREN(AuthzDecisionQueryDescriptorType);
359 /** Finds an IDP role supporting a given protocol. */
360 virtual const IDPSSODescriptor* getIDPSSODescriptor(const XMLCh* protocol) const=0;
361 /** Finds an SP role supporting a given protocol. */
362 virtual const SPSSODescriptor* getSPSSODescriptor(const XMLCh* protocol) const=0;
363 /** Finds an Authn Authority role supporting a given protocol. */
364 virtual const AuthnAuthorityDescriptor* getAuthnAuthorityDescriptor(const XMLCh* protocol) const=0;
365 /** Finds an Attribute Authority role supporting a given protocol. */
366 virtual const AttributeAuthorityDescriptor* getAttributeAuthorityDescriptor(const XMLCh* protocol) const=0;
367 /** Finds a PDP role supporting a given protocol. */
368 virtual const PDPDescriptor* getPDPDescriptor(const XMLCh* protocol) const=0;
369 /** Finds an AuthnQuery role supporting a given protocol. */
370 virtual const AuthnQueryDescriptorType* getAuthnQueryDescriptorType(const XMLCh* protocol) const=0;
371 /** Finds an AttributeQuery role supporting a given protocol. */
372 virtual const AttributeQueryDescriptorType* getAttributeQueryDescriptorType(const XMLCh* protocol) const=0;
373 /** Finds an AuthzDecisionQuery role supporting a given protocol. */
374 virtual const AuthzDecisionQueryDescriptorType* getAuthzDecisionQueryDescriptorType(const XMLCh* protocol) const=0;
375 /** Finds an extension role supporting a given protocol. */
376 virtual const RoleDescriptor* getRoleDescriptor(xmltooling::QName& qname, const XMLCh* protocol) const=0;
377 /** EntityDescriptorType local name */
378 static const XMLCh TYPE_NAME[];
381 BEGIN_XMLOBJECT3(SAML_API,EntitiesDescriptor,SignableObject,CacheableSAMLObject,
382 TimeBoundSAMLObject,SAML 2.0 EntitiesDescriptor element);
383 DECL_STRING_ATTRIB(ID,ID);
384 DECL_STRING_ATTRIB(Name,NAME);
385 DECL_TYPED_FOREIGN_CHILD(Signature,xmlsignature);
386 DECL_TYPED_CHILD(Extensions);
387 DECL_TYPED_CHILDREN(EntityDescriptor);
388 DECL_TYPED_CHILDREN(EntitiesDescriptor);
389 /** EntitiesDescriptorType local name */
390 static const XMLCh TYPE_NAME[];
393 DECL_SAML2MDOBJECTBUILDER(AdditionalMetadataLocation);
394 DECL_SAML2MDOBJECTBUILDER(AffiliateMember);
395 DECL_SAML2MDOBJECTBUILDER(AffiliationDescriptor);
396 DECL_SAML2MDOBJECTBUILDER(ArtifactResolutionService);
397 DECL_SAML2MDOBJECTBUILDER(AssertionConsumerService);
398 DECL_SAML2MDOBJECTBUILDER(AssertionIDRequestService);
399 DECL_SAML2MDOBJECTBUILDER(AttributeAuthorityDescriptor);
400 DECL_SAML2MDOBJECTBUILDER(AttributeConsumingService);
401 DECL_SAML2MDOBJECTBUILDER(AttributeProfile);
402 DECL_SAML2MDOBJECTBUILDER(AttributeService);
403 DECL_SAML2MDOBJECTBUILDER(AuthnAuthorityDescriptor);
404 DECL_SAML2MDOBJECTBUILDER(AuthnQueryService);
405 DECL_SAML2MDOBJECTBUILDER(AuthzService);
406 DECL_SAML2MDOBJECTBUILDER(Company);
407 DECL_SAML2MDOBJECTBUILDER(ContactPerson);
408 DECL_SAML2MDOBJECTBUILDER(EmailAddress);
409 DECL_SAML2MDOBJECTBUILDER(EntitiesDescriptor);
410 DECL_SAML2MDOBJECTBUILDER(EntityDescriptor);
411 DECL_SAML2MDOBJECTBUILDER(Extensions);
412 DECL_SAML2MDOBJECTBUILDER(GivenName);
413 DECL_SAML2MDOBJECTBUILDER(IDPSSODescriptor);
414 DECL_SAML2MDOBJECTBUILDER(KeyDescriptor);
415 DECL_SAML2MDOBJECTBUILDER(ManageNameIDService);
416 DECL_SAML2MDOBJECTBUILDER(NameIDFormat);
417 DECL_SAML2MDOBJECTBUILDER(NameIDMappingService);
418 DECL_SAML2MDOBJECTBUILDER(Organization);
419 DECL_SAML2MDOBJECTBUILDER(OrganizationName);
420 DECL_SAML2MDOBJECTBUILDER(OrganizationDisplayName);
421 DECL_SAML2MDOBJECTBUILDER(OrganizationURL);
422 DECL_SAML2MDOBJECTBUILDER(PDPDescriptor);
423 DECL_SAML2MDOBJECTBUILDER(RequestedAttribute);
424 DECL_SAML2MDOBJECTBUILDER(ServiceDescription);
425 DECL_SAML2MDOBJECTBUILDER(ServiceName);
426 DECL_SAML2MDOBJECTBUILDER(SingleLogoutService);
427 DECL_SAML2MDOBJECTBUILDER(SingleSignOnService);
428 DECL_SAML2MDOBJECTBUILDER(SPSSODescriptor);
429 DECL_SAML2MDOBJECTBUILDER(SurName);
430 DECL_SAML2MDOBJECTBUILDER(TelephoneNumber);
432 DECL_XMLOBJECTBUILDER(SAML_API,ActionNamespace,opensaml::SAMLConstants::SAML20MD_QUERY_EXT_NS,opensaml::SAMLConstants::SAML20MD_QUERY_EXT_PREFIX);
433 DECL_XMLOBJECTBUILDER(SAML_API,SourceID,opensaml::SAMLConstants::SAML1MD_NS,opensaml::SAMLConstants::SAML1MD_PREFIX);
436 * Builder for localizedNameType objects.
438 * This is customized to force the element name to be specified.
440 class SAML_API localizedNameTypeBuilder : public xmltooling::XMLObjectBuilder {
442 virtual ~localizedNameTypeBuilder() {}
443 /** Builder that allows element/type override. */
444 virtual localizedNameType* buildObject(
445 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
448 /** Singleton builder. */
449 static localizedNameType* buildlocalizedNameType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) {
450 const localizedNameTypeBuilder* b = dynamic_cast<const localizedNameTypeBuilder*>(
451 XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_NS,localizedNameType::TYPE_NAME))
454 xmltooling::QName schemaType(SAMLConstants::SAML20MD_NS,localizedNameType::TYPE_NAME,SAMLConstants::SAML20MD_PREFIX);
455 return b->buildObject(nsURI, localName, prefix, &schemaType);
457 throw xmltooling::XMLObjectException("Unable to obtain typed builder for localizedNameType.");
462 * Builder for localizedURIType objects.
464 * This is customized to force the element name to be specified.
466 class SAML_API localizedURITypeBuilder : public xmltooling::XMLObjectBuilder {
468 virtual ~localizedURITypeBuilder() {}
469 /** Builder that allows element/type override. */
470 virtual localizedURIType* buildObject(
471 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
474 /** Singleton builder. */
475 static localizedURIType* buildlocalizedURIType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) {
476 const localizedURITypeBuilder* b = dynamic_cast<const localizedURITypeBuilder*>(
477 XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_NS,localizedURIType::TYPE_NAME))
480 xmltooling::QName schemaType(SAMLConstants::SAML20MD_NS,localizedURIType::TYPE_NAME,SAMLConstants::SAML20MD_PREFIX);
481 return b->buildObject(nsURI, localName, prefix, &schemaType);
483 throw xmltooling::XMLObjectException("Unable to obtain typed builder for localizedURIType.");
488 * Builder for EndpointType objects.
490 * This is customized to force the element name to be specified.
492 class SAML_API EndpointTypeBuilder : public xmltooling::XMLObjectBuilder {
494 virtual ~EndpointTypeBuilder() {}
495 /** Builder that allows element/type override. */
496 virtual EndpointType* buildObject(
497 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
500 /** Singleton builder. */
501 static EndpointType* buildEndpointType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) {
502 const EndpointTypeBuilder* b = dynamic_cast<const EndpointTypeBuilder*>(
503 XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_NS,EndpointType::TYPE_NAME))
506 xmltooling::QName schemaType(SAMLConstants::SAML20MD_NS,EndpointType::TYPE_NAME,SAMLConstants::SAML20MD_PREFIX);
507 return b->buildObject(nsURI, localName, prefix, &schemaType);
509 throw xmltooling::XMLObjectException("Unable to obtain typed builder for EndpointType.");
514 * Builder for IndexedEndpointType objects.
516 * This is customized to force the element name to be specified.
518 class SAML_API IndexedEndpointTypeBuilder : public xmltooling::XMLObjectBuilder {
520 virtual ~IndexedEndpointTypeBuilder() {}
521 /** Builder that allows element/type override. */
522 virtual IndexedEndpointType* buildObject(
523 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
526 /** Singleton builder. */
527 static IndexedEndpointType* buildIndexedEndpointType(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL) {
528 const IndexedEndpointTypeBuilder* b = dynamic_cast<const IndexedEndpointTypeBuilder*>(
529 XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_NS,IndexedEndpointType::TYPE_NAME))
532 xmltooling::QName schemaType(SAMLConstants::SAML20MD_NS,IndexedEndpointType::TYPE_NAME,SAMLConstants::SAML20MD_PREFIX);
533 return b->buildObject(nsURI, localName, prefix, &schemaType);
535 throw xmltooling::XMLObjectException("Unable to obtain typed builder for IndexedEndpointType.");
540 * Builder for AuthnQueryDescriptorType objects.
542 * This is customized to return a RoleDescriptor element with an
543 * xsi:type of AuthnQueryDescriptorType.
545 class SAML_API AuthnQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder {
547 virtual ~AuthnQueryDescriptorTypeBuilder() {}
548 /** Default builder. */
549 virtual AuthnQueryDescriptorType* buildObject() const {
550 xmltooling::QName schemaType(
551 SAMLConstants::SAML20_NS,AuthnQueryDescriptorType::TYPE_NAME,SAMLConstants::SAML20MD_QUERY_EXT_PREFIX
554 SAMLConstants::SAML20_NS,AuthnQueryDescriptorType::LOCAL_NAME,SAMLConstants::SAML20_PREFIX,&schemaType
557 /** Builder that allows element/type override. */
558 virtual AuthnQueryDescriptorType* buildObject(
559 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
562 /** Singleton builder. */
563 static AuthnQueryDescriptorType* buildAuthnQueryDescriptorType() {
564 const AuthnQueryDescriptorTypeBuilder* b = dynamic_cast<const AuthnQueryDescriptorTypeBuilder*>(
565 XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AuthnQueryDescriptorType::TYPE_NAME))
568 return b->buildObject();
569 throw xmltooling::XMLObjectException("Unable to obtain typed builder for AuthnQueryDescriptorType.");
574 * Builder for AttributeQueryDescriptorType objects.
576 * This is customized to return a RoleDescriptor element with an
577 * xsi:type of AttributeQueryDescriptorType.
579 class SAML_API AttributeQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder {
581 virtual ~AttributeQueryDescriptorTypeBuilder() {}
582 /** Default builder. */
583 virtual AttributeQueryDescriptorType* buildObject() const {
584 xmltooling::QName schemaType(
585 SAMLConstants::SAML20_NS,AttributeQueryDescriptorType::TYPE_NAME,SAMLConstants::SAML20MD_QUERY_EXT_PREFIX
588 SAMLConstants::SAML20_NS,AttributeQueryDescriptorType::LOCAL_NAME,SAMLConstants::SAML20_PREFIX,&schemaType
591 /** Builder that allows element/type override. */
592 virtual AttributeQueryDescriptorType* buildObject(
593 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
596 /** Singleton builder. */
597 static AttributeQueryDescriptorType* buildAttributeQueryDescriptorType() {
598 const AttributeQueryDescriptorTypeBuilder* b = dynamic_cast<const AttributeQueryDescriptorTypeBuilder*>(
599 XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AttributeQueryDescriptorType::TYPE_NAME))
602 return b->buildObject();
603 throw xmltooling::XMLObjectException("Unable to obtain typed builder for AttributeQueryDescriptorType.");
608 * Builder for AuthzDecisionQueryDescriptorType objects.
610 * This is customized to return a RoleDescriptor element with an
611 * xsi:type of AuthzDecisionQueryDescriptorType.
613 class SAML_API AuthzDecisionQueryDescriptorTypeBuilder : public xmltooling::XMLObjectBuilder {
615 virtual ~AuthzDecisionQueryDescriptorTypeBuilder() {}
616 /** Default builder. */
617 virtual AuthzDecisionQueryDescriptorType* buildObject() const {
618 xmltooling::QName schemaType(
619 SAMLConstants::SAML20_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME,SAMLConstants::SAML20MD_QUERY_EXT_PREFIX
622 SAMLConstants::SAML20_NS,AuthzDecisionQueryDescriptorType::LOCAL_NAME,SAMLConstants::SAML20_PREFIX,&schemaType
625 /** Builder that allows element/type override. */
626 virtual AuthzDecisionQueryDescriptorType* buildObject(
627 const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL
630 /** Singleton builder. */
631 static AuthzDecisionQueryDescriptorType* buildAuthzDecisionQueryDescriptorType() {
632 const AuthzDecisionQueryDescriptorTypeBuilder* b = dynamic_cast<const AuthzDecisionQueryDescriptorTypeBuilder*>(
633 XMLObjectBuilder::getBuilder(xmltooling::QName(SAMLConstants::SAML20MD_QUERY_EXT_NS,AuthzDecisionQueryDescriptorType::TYPE_NAME))
636 return b->buildObject();
637 throw xmltooling::XMLObjectException("Unable to obtain typed builder for AuthzDecisionQueryDescriptorType.");
642 * Registers builders and validators for SAML 2.0 Metadata classes into the runtime.
644 void SAML_API registerMetadataClasses();
647 * Validator suite for SAML 2.0 Metadata schema validation.
649 extern SAML_API xmltooling::ValidatorSuite MetadataSchemaValidators;
653 #endif /* __saml2_metadata_h__ */