[cpp-sp COMMIT] in /branches/REL_2/plugins: Makefile.am TransformAttributeResolver.cpp plugins.cpp plugins.vcxproj pl...

noreply at shibboleth.net noreply at shibboleth.net
Tue Apr 10 16:23:07 BST 2012


Author: scantor
Date: Tue Apr 10 16:23:07 2012
New Revision: 3616

URL: http://svn.shibboleth.net/view/cpp-sp?rev=3616&view=rev
Log:
SSPCPP-341 - Template resolver plugin

Modified:
    branches/REL_2/plugins/Makefile.am
    branches/REL_2/plugins/TransformAttributeResolver.cpp
    branches/REL_2/plugins/plugins.cpp
    branches/REL_2/plugins/plugins.vcxproj
    branches/REL_2/plugins/plugins.vcxproj.filters

Modified: branches/REL_2/plugins/Makefile.am
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/plugins/Makefile.am?rev=3616&r1=3615&r2=3616&view=diff
==============================================================================
--- branches/REL_2/plugins/Makefile.am (original)
+++ branches/REL_2/plugins/Makefile.am Tue Apr 10 16:23:07 2012
@@ -12,6 +12,7 @@
 plugins_la_SOURCES = \
 	${common_sources} \
 	GSSAPIAttributeExtractor.cpp \
+    TemplateAttributeResolver.cpp \
     TransformAttributeResolver.cpp
 
 #plugins_lite_la_SOURCES = \

Modified: branches/REL_2/plugins/TransformAttributeResolver.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/plugins/TransformAttributeResolver.cpp?rev=3616&r1=3615&r2=3616&view=diff
==============================================================================
--- branches/REL_2/plugins/TransformAttributeResolver.cpp (original)
+++ branches/REL_2/plugins/TransformAttributeResolver.cpp Tue Apr 10 16:23:07 2012
@@ -50,20 +50,17 @@
     class SHIBSP_DLLLOCAL TransformContext : public ResolutionContext
     {
     public:
-        TransformContext(const Session& session) : m_inputAttributes(&session.getAttributes()) {
-        }
-
-        TransformContext(const vector<shibsp::Attribute*>* attributes) : m_inputAttributes(attributes) {
+        TransformContext(const vector<Attribute*>* attributes) : m_inputAttributes(attributes) {
         }
 
         ~TransformContext() {
-            for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<shibsp::Attribute>());
-        }
-
-        const vector<shibsp::Attribute*>* getInputAttributes() const {
+            for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<Attribute>());
+        }
+
+        const vector<Attribute*>* getInputAttributes() const {
             return m_inputAttributes;
         }
-        vector<shibsp::Attribute*>& getResolvedAttributes() {
+        vector<Attribute*>& getResolvedAttributes() {
             return m_attributes;
         }
         vector<opensaml::Assertion*>& getResolvedAssertions() {
@@ -71,8 +68,8 @@
         }
 
     private:
-        const vector<shibsp::Attribute*>* m_inputAttributes;
-        vector<shibsp::Attribute*> m_attributes;
+        const vector<Attribute*>* m_inputAttributes;
+        vector<Attribute*> m_attributes;
         static vector<opensaml::Assertion*> m_assertions;   // empty dummy
     };
 
@@ -97,7 +94,7 @@
             const XMLCh* authncontext_class=nullptr,
             const XMLCh* authncontext_decl=nullptr,
             const vector<const opensaml::Assertion*>* tokens=nullptr,
-            const vector<shibsp::Attribute*>* attributes=nullptr
+            const vector<Attribute*>* attributes=nullptr
             ) const {
             // Make sure new method gets run.
             return createResolutionContext(application, nullptr, issuer, protocol, nameid, authncontext_class, authncontext_decl, tokens, attributes);
@@ -112,13 +109,13 @@
             const XMLCh* authncontext_class=nullptr,
             const XMLCh* authncontext_decl=nullptr,
             const vector<const opensaml::Assertion*>* tokens=nullptr,
-            const vector<shibsp::Attribute*>* attributes=nullptr
+            const vector<Attribute*>* attributes=nullptr
             ) const {
             return new TransformContext(attributes);
         }
 
         ResolutionContext* createResolutionContext(const Application& application, const Session& session) const {
-            return new TransformContext(session);
+            return new TransformContext(&session.getAttributes());
         }
 
         void resolveAttributes(ResolutionContext& ctx) const;

Modified: branches/REL_2/plugins/plugins.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/plugins/plugins.cpp?rev=3616&r1=3615&r2=3616&view=diff
==============================================================================
--- branches/REL_2/plugins/plugins.cpp (original)
+++ branches/REL_2/plugins/plugins.cpp Tue Apr 10 16:23:07 2012
@@ -44,19 +44,22 @@
 #ifdef HAVE_GSSAPI_NAMINGEXTS
     PluginManager<AttributeExtractor,string,const DOMElement*>::Factory GSSAPIExtractorFactory;
 #endif
+    PluginManager<AttributeResolver,string,const DOMElement*>::Factory TemplateAttributeResolverFactory;
     PluginManager<AttributeResolver,string,const DOMElement*>::Factory TransformAttributeResolverFactory;
 };
 
 extern "C" int PLUGINS_EXPORTS xmltooling_extension_init(void*)
 {
+    SPConfig& conf = SPConfig::getConfig();
 #ifdef HAVE_GSSAPI_NAMINGEXTS
-    SPConfig::getConfig().AttributeExtractorManager.registerFactory("GSSAPI", GSSAPIExtractorFactory);

[... 41 lines stripped ...]


More information about the commits mailing list