Change license header.
[shibboleth/cpp-sp.git] / shibsp / attribute / filtering / BasicFilteringContext.h
1 /**
2  * Licensed to the University Corporation for Advanced Internet
3  * Development, Inc. (UCAID) under one or more contributor license
4  * agreements. See the NOTICE file distributed with this work for
5  * additional information regarding copyright ownership.
6  *
7  * UCAID licenses this file to you under the Apache License,
8  * Version 2.0 (the "License"); you may not use this file except
9  * in compliance with the License. You may obtain a copy of the
10  * License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17  * either express or implied. See the License for the specific
18  * language governing permissions and limitations under the License.
19  */
20
21 /**
22  * @file shibsp/attribute/filtering/BasicFilteringContext.h
23  * 
24  * A trivial FilteringContext implementation.
25  */
26
27 #ifndef __shibsp_basicfiltctx_h__
28 #define __shibsp_basicfiltctx_h__
29
30 #include <shibsp/attribute/filtering/FilteringContext.h>
31
32 namespace shibsp {
33
34     class SHIBSP_API Attribute;
35
36     /**
37      * A trivial FilteringContext implementation.
38      */
39     class SHIBSP_API BasicFilteringContext : public FilteringContext
40     {
41     public:
42         /**
43          * Constructor.
44          *
45          * @param app                   reference to Application
46          * @param attributes            attributes being filtered
47          * @param role                  metadata role of Attribute issuer, if any
48          * @param authncontext_class    method/category of authentication event, if known
49          * @param authncontext_decl     specifics of authentication event, if known
50          */
51         BasicFilteringContext(
52             const Application& app,
53             const std::vector<Attribute*>& attributes,
54             const opensaml::saml2md::RoleDescriptor* role=nullptr,
55             const XMLCh* authncontext_class=nullptr,
56             const XMLCh* authncontext_decl=nullptr
57             );
58
59         virtual ~BasicFilteringContext();
60
61         // Virtual function overrides.
62         const Application& getApplication() const;
63         const XMLCh* getAuthnContextClassRef() const;
64         const XMLCh* getAuthnContextDeclRef() const;
65         const XMLCh* getAttributeRequester() const;
66         const XMLCh* getAttributeIssuer() const;
67         const opensaml::saml2md::RoleDescriptor* getAttributeRequesterMetadata() const;
68         const opensaml::saml2md::RoleDescriptor* getAttributeIssuerMetadata() const;
69         const std::multimap<std::string,Attribute*>& getAttributes() const;
70
71     private:
72         const Application& m_app;
73         std::multimap<std::string,Attribute*> m_attributes;
74         const opensaml::saml2md::RoleDescriptor* m_role;
75         const XMLCh* m_issuer;
76         const XMLCh* m_class;
77         const XMLCh* m_decl;
78     };
79 };
80
81 #endif /* __shibsp_basicfiltctx_h__ */