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