2 * Copyright 2010 JANET(UK)
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.
20 * An embeddable component interface to Shibboleth SP attribute processing.
25 #include <shibsp/ServiceProvider.h>
26 #include <shibsp/attribute/Attribute.h>
27 #include <shibsp/remoting/ListenerService.h>
29 using namespace shibresolver;
30 using namespace shibsp;
32 using namespace opensaml;
34 using namespace xmltooling;
37 namespace shibresolver {
38 class SHIBRESOLVER_DLLLOCAL ResolverImpl : public ShibbolethResolver, public Remoted {
44 void receive(DDF& in, ostream& out);
48 ShibbolethResolver* ShibbolethResolver::create()
50 return new ResolverImpl();
53 ShibbolethResolver::ShibbolethResolver()
57 ShibbolethResolver::~ShibbolethResolver()
59 for_each(m_resolvedAttributes.begin(), m_resolvedAttributes.end(), xmltooling::cleanup<Attribute>());
66 void ShibbolethResolver::setServiceURI(const char* uri)
73 void ShibbolethResolver::setApplicationID(const char* appID)
80 void ShibbolethResolver::setIssuer(const char* issuer)
87 void ShibbolethResolver::addToken(
89 const XMLObject* token
91 const saml2::Assertion* token
96 m_tokens.push_back(token);
99 void ShibbolethResolver::addAttribute(Attribute* attr)
102 m_inputAttributes.push_back(attr);
105 vector<Attribute*>& ShibbolethResolver::getResolvedAttributes()
107 return m_resolvedAttributes;
110 RequestMapper::Settings ShibbolethResolver::getSettings() const
115 void ResolverImpl::resolve()
119 void ResolverImpl::receive(DDF& in, ostream& out)
123 extern "C" int SHIBRESOLVER_EXPORTS xmltooling_extension_init(void*)
125 // Register factory functions with appropriate plugin managers in the XMLTooling/SAML/SPConfig objects.
126 return 0; // signal success
129 extern "C" void SHIBRESOLVER_EXPORTS xmltooling_extension_term()
131 // Factories normally get unregistered during library shutdown, so no work usually required here.