2 * Copyright 2001-2007 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 * @file shibsp/attribute/resolver/ResolutionContext.h
20 * A context for a resolution request.
23 #ifndef __shibsp_resctx_h__
24 #define __shibsp_resctx_h__
26 #include <shibsp/base.h>
28 #include <saml/Assertion.h>
29 #include <saml/saml2/metadata/Metadata.h>
33 class SHIBSP_API Application;
34 class SHIBSP_API Session;
35 class SHIBSP_API Attribute;
38 * A context for a resolution request.
40 class SHIBSP_API ResolutionContext
42 MAKE_NONCOPYABLE(ResolutionContext);
44 ResolutionContext() {}
46 virtual ~ResolutionContext() {}
49 * Returns the application resolving the attributes.
51 * @return the resolving application
53 virtual const Application& getApplication() const=0;
56 * Returns the address of the client associated with the subject.
58 * @return the client's network address
60 virtual const char* getClientAddress() const=0;
63 * Returns the metadata for the IdP associated with the subject, if any.
65 * @return the IdP's metadata, or NULL
67 virtual const opensaml::saml2md::EntityDescriptor* getEntityDescriptor() const=0;
70 * Returns the NameID associated with the subject
72 * <p>SAML 1.x identifiers will be promoted to the 2.0 type.
74 * @return a SAML 2.0 NameID associated with the subject, if any
76 virtual const opensaml::saml2::NameID* getNameID() const=0;
79 * Returns unresolved tokens associated with the subject, if any.
81 * @return pointer to an array of tokens, or NULL
83 virtual const std::vector<const opensaml::Assertion*>* getTokens() const=0;
86 * Returns the active session associated with the subject, if any.
88 * @return the active, locked session, or NULL
90 virtual const Session* getSession() const=0;
93 * Returns the set of Attributes resolved and added to the context.
95 * <p>Any Attributes left in the returned container will be freed by the
96 * context, so the caller should modify/clear the container after copying
97 * objects for its own use.
99 * @return a mutable array of Attributes.
101 virtual std::vector<Attribute*>& getResolvedAttributes()=0;
104 * Returns the set of assertions resolved and added to the context.
106 * <p>Any assertions left in the returned container will be freed by the
107 * context, so the caller should modify/clear the container after copying
108 * objects for its own use.
110 * @return a mutable array of Assertions
112 virtual std::vector<opensaml::Assertion*>& getResolvedAssertions()=0;
116 #endif /* __shibsp_resctx_h__ */