Attribute filtering code.
[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          * Gets the ID of the requester of the attributes, if known.
55          * 
56          * @return requester of the attributes, or NULL
57          */
58         virtual const XMLCh* getAttributeRequester() const=0;
59         
60         /**
61          * Gets the ID of the issuer of the attributes, if known.
62          * 
63          * @return ID of the issuer of the attributes, or NULL
64          */
65         virtual const XMLCh* getAttributeIssuer() const=0;
66
67         /**
68          * Gets the SAML metadata for the attribute requesting role, if available.
69          * 
70          * @return SAML metadata for the attribute requesting role, or NULL
71          */
72         virtual const opensaml::saml2md::RoleDescriptor* getAttributeRequesterMetadata() const=0;
73         
74         /**
75          * Gets the SAML metadata for the attribute issuing role, if available.
76          * 
77          * @return SAML metadata for the attribute issuing role, or NULL
78          */
79         virtual const opensaml::saml2md::RoleDescriptor* getAttributeIssuerMetadata() const=0;
80     };
81 };
82
83 #endif /* __shibsp_filtctx_h__ */