2 * Copyright 2001-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 * BasicFilteringContext.cpp
20 * A trivial FilteringContext implementation.
24 #include "Application.h"
25 #include "attribute/Attribute.h"
26 #include "attribute/filtering/BasicFilteringContext.h"
28 #include <saml/saml2/metadata/Metadata.h>
30 using namespace shibsp;
31 using namespace opensaml::saml2md;
34 FilteringContext::FilteringContext()
38 FilteringContext::~FilteringContext()
42 BasicFilteringContext::BasicFilteringContext(
43 const Application& app,
44 const vector<Attribute*>& attributes,
45 const RoleDescriptor* role,
46 const XMLCh* authncontext_class,
47 const XMLCh* authncontext_decl
48 ) : m_app(app), m_role(role), m_issuer(nullptr), m_class(authncontext_class), m_decl(authncontext_decl)
51 m_issuer = dynamic_cast<EntityDescriptor*>(role->getParent())->getEntityID();
52 for (vector<Attribute*>::const_iterator a = attributes.begin(); a != attributes.end(); ++a)
53 m_attributes.insert(multimap<string,Attribute*>::value_type((*a)->getId(), *a));
56 BasicFilteringContext::~BasicFilteringContext()
60 const Application& BasicFilteringContext::getApplication() const
65 const XMLCh* BasicFilteringContext::getAuthnContextClassRef() const
70 const XMLCh* BasicFilteringContext::getAuthnContextDeclRef() const
75 const XMLCh* BasicFilteringContext::getAttributeRequester() const
77 return m_app.getXMLString("entityID").second;
80 const XMLCh* BasicFilteringContext::getAttributeIssuer() const
85 const RoleDescriptor* BasicFilteringContext::getAttributeRequesterMetadata() const
90 const RoleDescriptor* BasicFilteringContext::getAttributeIssuerMetadata() const
95 const multimap<string,Attribute*>& BasicFilteringContext::getAttributes() const