2 * Copyright 2010 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/DiscoverableMetadataProvider.h
20 * A metadata provider that provides a JSON feed of IdP discovery information.
23 #ifndef __saml2_discometadataprov_h__
24 #define __saml2_discometadataprov_h__
26 #include <saml/saml2/metadata/MetadataProvider.h>
32 #if defined (_MSC_VER)
33 #pragma warning( push )
34 #pragma warning( disable : 4251 )
37 * A metadata provider that provides a JSON feed of IdP discovery information.
39 class SAML_API DiscoverableMetadataProvider : public virtual MetadataProvider
45 * If a DOM is supplied, the following XML content is supported:
48 * <dt>legacyOrgNames</dt>
49 * <dd>true iff IdPs without a UIInfo extension should
50 * be identified using <md:OrganizationDisplayName></dd>
53 * @param e DOM to supply configuration for provider
55 DiscoverableMetadataProvider(const xercesc::DOMElement* e=nullptr);
58 * Generates a JSON feed of IdP discovery information for the current metadata.
59 * <p>The provider <strong>MUST</strong> be write-locked.
61 virtual void generateFeed();
64 virtual ~DiscoverableMetadataProvider();
67 * Returns the ETag associated with the cached feed.
68 * <p>The provider <strong>MUST</strong> be locked.
70 * @return the ETag value for the current feed state
72 virtual std::string getCacheTag() const;
75 * Outputs the cached feed.
76 * <p>The provider <strong>MUST</strong> be locked.
78 * @param os stream to output feed into
79 * @return a reference to the output stream
81 virtual std::ostream& outputFeed(std::ostream& os) const;
84 /** Storage for feed. */
88 mutable std::string m_feedTag;
91 void disco(std::string& s, const EntityDescriptor* entity, bool& first) const;
92 void disco(std::string& s, const EntitiesDescriptor* group, bool& first) const;
94 bool m_legacyOrgNames;
97 #if defined (_MSC_VER)
98 #pragma warning( pop )
104 #endif /* __saml2_discometadataprov_h__ */