40232a41e95d463a48d7f073c34c1c20725c02e2
[shibboleth/cpp-sp.git] / shibsp / attribute / filtering / FilteringContext.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/FilteringContext.h
23  * 
24  * Context for attribute filtering operations.
25  */
26
27 #ifndef __shibsp_filtctx_h__
28 #define __shibsp_filtctx_h__
29
30 #include <shibsp/base.h>
31
32 #include <map>
33 #include <string>
34
35 namespace opensaml {
36     namespace saml2md {
37         class SAML_API RoleDescriptor;
38     };
39 };
40
41 namespace shibsp {
42
43     class SHIBSP_API Application;
44     class SHIBSP_API Attribute;
45
46     /**
47      * Context for attribute filtering operations.
48      */
49     class SHIBSP_API FilteringContext
50     {
51         MAKE_NONCOPYABLE(FilteringContext);
52     protected:
53         FilteringContext();
54     public:
55         virtual ~FilteringContext();
56
57         /**
58          * Gets the Application doing the filtering.
59          *
60          * @return  reference to an Application
61          */
62         virtual const Application& getApplication() const=0;
63
64         /**
65          * Returns a URI containing an AuthnContextClassRef associated with the subject.
66          * 
67          * <p>SAML 1.x AuthenticationMethods will be returned as class references.
68          * 
69          * @return  a URI identifying the authentication context class
70          */
71         virtual const XMLCh* getAuthnContextClassRef() const=0;
72
73         /**
74          * Returns a URI containing an AuthnContextDeclRef associated with the subject.
75          * 
76          * @return  a URI identifying the authentication context declaration
77          */
78         virtual const XMLCh* getAuthnContextDeclRef() const=0;
79
80         /**
81          * Gets the ID of the requester of the attributes, if known.
82          * 
83          * @return requester of the attributes, or nullptr
84          */
85         virtual const XMLCh* getAttributeRequester() const=0;
86         
87         /**
88          * Gets the ID of the issuer of the attributes, if known.
89          * 
90          * @return ID of the issuer of the attributes, or nullptr
91          */
92         virtual const XMLCh* getAttributeIssuer() const=0;
93
94         /**
95          * Gets the SAML metadata for the attribute requesting role, if available.
96          * 
97          * @return SAML metadata for the attribute requesting role, or nullptr
98          */
99         virtual const opensaml::saml2md::RoleDescriptor* getAttributeRequesterMetadata() const=0;
100         
101         /**
102          * Gets the SAML metadata for the attribute issuing role, if available.
103          * 
104          * @return SAML metadata for the attribute issuing role, or nullptr
105          */
106         virtual const opensaml::saml2md::RoleDescriptor* getAttributeIssuerMetadata() const=0;
107
108         /**
109          * Returns the set of Attributes being filtered.
110          * 
111          * <p>No modifications should be performed, access is provided only for use by
112          * MatchFunctors based on the presence of Attribute data.
113          * 
114          * @return  an immutable map of Attributes.
115          */
116         virtual const std::multimap<std::string,Attribute*>& getAttributes() const=0;
117
118     };
119 };
120
121 #endif /* __shibsp_filtctx_h__ */