Add option to make attributes internal only.
authorScott Cantor <cantor.2@osu.edu>
Sat, 6 Jun 2009 21:00:33 +0000 (21:00 +0000)
committerScott Cantor <cantor.2@osu.edu>
Sat, 6 Jun 2009 21:00:33 +0000 (21:00 +0000)
14 files changed:
.cproject
.project
schemas/shibboleth-2.0-attribute-map.xsd
shibsp/ServiceProvider.cpp
shibsp/attribute/Attribute.cpp
shibsp/attribute/Attribute.h
shibsp/attribute/AttributeDecoder.h
shibsp/attribute/DOMAttributeDecoder.cpp
shibsp/attribute/ExtensibleAttribute.h
shibsp/attribute/KeyInfoAttributeDecoder.cpp
shibsp/attribute/NameIDAttributeDecoder.cpp
shibsp/attribute/NameIDFromScopedAttributeDecoder.cpp
shibsp/attribute/ScopedAttributeDecoder.cpp
shibsp/attribute/StringAttributeDecoder.cpp

index 6cfb24b..fbbebfe 100644 (file)
--- a/.cproject
+++ b/.cproject
 \r
 <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>\r
 \r
+<storageModule moduleId="scannerConfiguration">\r
+<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>\r
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
+<buildOutputProvider>\r
+<openAction enabled="true" filePath=""/>\r
+<parser enabled="true"/>\r
+</buildOutputProvider>\r
+<scannerInfoProvider id="specsFile">\r
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+<parser enabled="true"/>\r
+</scannerInfoProvider>\r
+</profile>\r
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
+<buildOutputProvider>\r
+<openAction enabled="true" filePath=""/>\r
+<parser enabled="true"/>\r
+</buildOutputProvider>\r
+<scannerInfoProvider id="makefileGenerator">\r
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
+<parser enabled="true"/>\r
+</scannerInfoProvider>\r
+</profile>\r
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
+<buildOutputProvider>\r
+<openAction enabled="true" filePath=""/>\r
+<parser enabled="true"/>\r
+</buildOutputProvider>\r
+<scannerInfoProvider id="specsFile">\r
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+<parser enabled="true"/>\r
+</scannerInfoProvider>\r
+</profile>\r
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
+<buildOutputProvider>\r
+<openAction enabled="true" filePath=""/>\r
+<parser enabled="true"/>\r
+</buildOutputProvider>\r
+<scannerInfoProvider id="specsFile">\r
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+<parser enabled="true"/>\r
+</scannerInfoProvider>\r
+</profile>\r
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
+<buildOutputProvider>\r
+<openAction enabled="true" filePath=""/>\r
+<parser enabled="true"/>\r
+</buildOutputProvider>\r
+<scannerInfoProvider id="specsFile">\r
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+<parser enabled="true"/>\r
+</scannerInfoProvider>\r
+</profile>\r
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
+<buildOutputProvider>\r
+<openAction enabled="true" filePath=""/>\r
+<parser enabled="true"/>\r
+</buildOutputProvider>\r
+<scannerInfoProvider id="specsFile">\r
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+<parser enabled="true"/>\r
+</scannerInfoProvider>\r
+</profile>\r
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
+<buildOutputProvider>\r
+<openAction enabled="true" filePath=""/>\r
+<parser enabled="true"/>\r
+</buildOutputProvider>\r
+<scannerInfoProvider id="specsFile">\r
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+<parser enabled="true"/>\r
+</scannerInfoProvider>\r
+</profile>\r
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
+<buildOutputProvider>\r
+<openAction enabled="true" filePath=""/>\r
+<parser enabled="true"/>\r
+</buildOutputProvider>\r
+<scannerInfoProvider id="specsFile">\r
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+<parser enabled="true"/>\r
+</scannerInfoProvider>\r
+</profile>\r
+</storageModule>\r
 <storageModule moduleId="org.eclipse.cdt.core.pathentry">\r
+<pathentry include="C:/Program Files/Microsoft Visual Studio 9.0/VC/include" kind="inc" path="" system="true"/>\r
 <pathentry include="C:/log4shib-1.0.2/include" kind="inc" path="" system="true"/>\r
 <pathentry include="C:/xerces-c-3.0.1-x86-windows-vc-9.0/include" kind="inc" path="" system="true"/>\r
 <pathentry base-path="cpp-xmltooling" include="" kind="inc" path="" system="true"/>\r
 <pathentry kind="src" path="util"/>\r
 <pathentry kind="src" path="adfs"/>\r
 <pathentry kind="src" path="fastcgi"/>\r
+<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>\r
 </storageModule>\r
 </cconfiguration>\r
 </storageModule>\r
index 404625c..4dea911 100644 (file)
--- a/.project
+++ b/.project
 <projectDescription>
        <name>cpp-sp</name>
        <comment></comment>
+       <projects>
+       </projects>
        <buildSpec>
                <buildCommand>
                        <name>org.eclipse.cdt.make.core.makeBuilder</name>
+                       <triggers></triggers>
                        <arguments>
                                <dictionary>
                                        <key>org.eclipse.cdt.core.errorOutputParser</key>
                                        <value>org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
                                </dictionary>
                                <dictionary>
-                                       <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-                                       <value>clean all</value>
+                                       <key>org.eclipse.cdt.make.core.append_environment</key>
+                                       <value>true</value>
                                </dictionary>
                                <dictionary>
-                                       <key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
+                                       <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
                                        <value>all</value>
                                </dictionary>
                                <dictionary>
-                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-                                       <value>false</value>
+                                       <key>org.eclipse.cdt.make.core.build.arguments</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.command</key>
+                                       <value>nmake</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.location</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.target.auto</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.target.clean</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.build.target.inc</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildArguments</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildCommand</key>
+                                       <value>nmake</value>
                                </dictionary>
                                <dictionary>
                                        <key>org.eclipse.cdt.make.core.buildLocation</key>
                                        <value></value>
                                </dictionary>
                                <dictionary>
-                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
                                        <value>false</value>
                                </dictionary>
                                <dictionary>
-                                       <key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+                                       <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
                                        <value>false</value>
                                </dictionary>
                                <dictionary>
-                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>
                                        <value>false</value>
                                </dictionary>
                                <dictionary>
-                                       <key>org.eclipse.cdt.make.core.buildArguments</key>
+                                       <key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
+                                       <value>false</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.environment</key>
                                        <value></value>
                                </dictionary>
                                <dictionary>
-                                       <key>org.eclipse.cdt.make.core.buildCommand</key>
-                                       <value>nmake</value>
+                                       <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+                                       <value>clean all</value>
                                </dictionary>
                                <dictionary>
-                                       <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+                                       <key>org.eclipse.cdt.make.core.incrementalBuildTarget</key>
                                        <value>all</value>
                                </dictionary>
                                <dictionary>
                                        <key>org.eclipse.cdt.make.core.stopOnError</key>
                                        <value>false</value>
                                </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+                                       <value>false</value>
+                               </dictionary>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
+                       <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
                <nature>org.eclipse.cdt.core.cnature</nature>
                <nature>org.eclipse.cdt.make.core.makeNature</nature>
                <nature>org.eclipse.cdt.core.ccnature</nature>
+               <nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
        </natures>
 </projectDescription>
index d5533f0..caf5e1e 100644 (file)
                 </documentation>
             </annotation>
         </attribute>
+        <attribute name="internal" type="boolean">
+            <annotation>
+                <documentation>Flag controlling whether the resulting attribute should be exported for CGI use.</documentation>
+            </annotation>
+        </attribute>
     </complexType>
     
     <complexType name="StringAttributeDecoder">
index 69afa28..552fc09 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -413,6 +413,8 @@ pair<bool,long> ServiceProvider::doExport(SPRequest& request, bool requireSessio
         // Export the attributes.
         const multimap<string,const Attribute*>& attributes = session->getIndexedAttributes();
         for (multimap<string,const Attribute*>::const_iterator a = attributes.begin(); a!=attributes.end(); ++a) {
+            if (a->second->isInternal())
+                continue;
             string header(app->getSecureHeader(request, a->first.c_str()));
             const vector<string>& vals = a->second->getSerializedValues();
             for (vector<string>::const_iterator v = vals.begin(); v!=vals.end(); ++v) {
index 4e9f674..82c7f6d 100644 (file)
@@ -71,6 +71,7 @@ namespace shibsp {
     static const XMLCh _DOMAttributeDecoder[] =    UNICODE_LITERAL_19(D,O,M,A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r);
 
     static const XMLCh caseSensitive[] =           UNICODE_LITERAL_13(c,a,s,e,S,e,n,s,i,t,i,v,e);
+    static const XMLCh internal[] =                UNICODE_LITERAL_8(i,n,t,e,r,n,a,l);
 #endif
 };
 
@@ -93,12 +94,16 @@ void shibsp::registerAttributeDecoders()
     conf.AttributeDecoderManager.registerFactory(DOMAttributeDecoderType, DOMAttributeDecoderFactory);
 }
 
-AttributeDecoder::AttributeDecoder(const DOMElement *e) : m_caseSensitive(true)
+AttributeDecoder::AttributeDecoder(const DOMElement *e) : m_caseSensitive(true), m_internal(false)
 {
     if (e) {
-        const XMLCh* flag = e->getAttributeNS(NULL,caseSensitive);
+        const XMLCh* flag = e->getAttributeNS(NULL, caseSensitive);
         if (flag && (*flag == chLatin_f || *flag == chDigit_0))
             m_caseSensitive = false;
+
+        flag = e->getAttributeNS(NULL, internal);
+        if (flag && (*flag == chLatin_t || *flag == chDigit_1))
+            m_internal = true;
     }
 }
 #endif
@@ -114,6 +119,42 @@ void shibsp::registerAttributeFactories()
 
 map<string,Attribute::AttributeFactory*> Attribute::m_factoryMap;
 
+Attribute::Attribute(DDF& in) : m_caseSensitive(in["case_insensitive"].isnull()), m_internal(!in["internal"].isnull())
+{
+    const char* id = in.first().name();
+    if (id && *id)
+        m_id.push_back(id);
+    else
+        throw AttributeException("No id found in marshalled attribute content.");
+    DDF aliases = in["aliases"];
+    if (aliases.islist()) {
+        DDF alias = aliases.first();
+        while (alias.isstring()) {
+            m_id.push_back(alias.string());
+            alias = aliases.next();
+        }
+    }
+}
+
+DDF Attribute::marshall() const
+{
+    DDF ddf(NULL);
+    ddf.structure().addmember(m_id.front().c_str()).list();
+    if (!m_caseSensitive)
+        ddf.addmember("case_insensitive");
+    if (m_internal)
+        ddf.addmember("internal");
+    if (m_id.size() > 1) {
+        DDF alias;
+        DDF aliases = ddf.addmember("aliases").list();
+        for (std::vector<std::string>::const_iterator a = m_id.begin() + 1; a != m_id.end(); ++a) {
+            alias = DDF(NULL).string(a->c_str());
+            aliases.add(alias);
+        }
+    }
+    return ddf;
+}
+
 Attribute* Attribute::unmarshall(DDF& in)
 {
     map<string,AttributeFactory*>::const_iterator i = m_factoryMap.find(in.name() ? in.name() : "");
index 1219681..37e1d39 100644 (file)
@@ -1,6 +1,6 @@
 /*
- *  Copyright 2001-2007 Internet2
- * 
+ *  Copyright 2001-2009 Internet2
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -16,7 +16,7 @@
 
 /**
  * @file shibsp/attribute/Attribute.h
- * 
+ *
  * A resolved attribute.
  */
 
@@ -39,16 +39,16 @@ namespace shibsp {
 
     /**
      * A resolved attribute.
-     * 
+     *
      * <p>Resolved attributes are a neutral construct that represent both simple and
      * complex attribute data structures that might be found in SAML assertions
      * or obtained from other sources.
-     * 
+     *
      * <p>Attributes consist of an id/name that is locally unique (that is, unique to a
      * configuration at any given point in time) and zero or more values. Values can
      * be of any type or structure, but will generally be made available to applications
      * only if a serialized string form exists. More complex values can be used with
-     * access control plugins that understand them, however. 
+     * access control plugins and other components that understand them, however.
      */
     class SHIBSP_API Attribute
     {
@@ -56,50 +56,36 @@ namespace shibsp {
     protected:
         /**
          * Constructor
-         * 
+         *
          * @param ids   array with primary identifier in first position, followed by any aliases
          */
-        Attribute(const std::vector<std::string>& ids) : m_id(ids), m_caseSensitive(true) {
+        Attribute(const std::vector<std::string>& ids) : m_id(ids), m_caseSensitive(true), m_internal(false) {
         }
 
         /**
          * Constructs based on a remoted Attribute.
-         * 
+         *
          * <p>This allows Attribute objects to be recreated after marshalling.
          * The DDF supplied must be a struct containing a single list member named
          * with the Attribute's "id" and containing the values.
-         * 
+         *
          * @param in    input object containing marshalled Attribute
          */
-        Attribute(DDF& in) : m_caseSensitive(in["case_insensitive"].isnull()) {
-            const char* id = in.first().name();
-            if (id && *id)
-                m_id.push_back(id);
-            else
-                throw AttributeException("No id found in marshalled attribute content.");
-            DDF aliases = in["aliases"];
-            if (aliases.islist()) {
-                DDF alias = aliases.first();
-                while (alias.isstring()) {
-                    m_id.push_back(alias.string());
-                    alias = aliases.next();
-                }
-            }
-        }
-        
+        Attribute(DDF& in);
+
         /**
          * Maintains a copy of serialized attribute values, when possible.
-         * 
+         *
          * <p>Implementations should maintain the array when values are added or removed.
          */
         mutable std::vector<std::string> m_serialized;
 
     public:
         virtual ~Attribute() {}
-        
+
         /**
          * Returns the Attribute identifier.
-         * 
+         *
          * @return the Attribute identifier
          */
         const char* getId() const {
@@ -134,6 +120,15 @@ namespace shibsp {
         }
 
         /**
+         * Sets whether the attribute should be exported for CGI use.
+         *
+         * @param export  true iff the attribute should <strong>NOT</strong> be exported
+         */
+        void setInternal(bool internal) {
+            m_internal = internal;
+        }
+
+        /**
          * Indicates whether case sensitivity should apply to basic value comparisons.
          *
          * @return  true iff value comparisons should be case sensitive
@@ -141,31 +136,40 @@ namespace shibsp {
         bool isCaseSensitive() const {
             return m_caseSensitive;
         }
-        
+
+        /**
+         * Indicates whether the attribute should be exported for CGI use.
+         *
+         * @return  true iff the attribute should <strong>NOT</strong> be exported
+         */
+        bool isInternal() const {
+            return m_internal;
+        }
+
         /**
          * Returns the number of values.
-         * 
+         *
          * @return  number of values
          */
         virtual size_t valueCount() const {
             return m_serialized.size();
         }
-        
+
         /**
          * Returns serialized Attribute values encoded as UTF-8 strings.
-         * 
+         *
          * @return  an immutable vector of values
          */
         virtual const std::vector<std::string>& getSerializedValues() const {
             return m_serialized;
         }
-        
+
         /**
          * Informs the Attribute that values have changed and any serializations
-         * must be cleared. 
+         * must be cleared.
          */
         virtual void clearSerializedValues()=0;
-        
+
         /**
          * Gets the string equivalent of the value at the specified position (starting from zero).
          *
@@ -198,54 +202,40 @@ namespace shibsp {
 
         /**
          * Marshalls an Attribute for remoting.
-         * 
+         *
          * <p>This allows Attribute objects to be communicated across process boundaries
          * without excess XML parsing. The DDF returned must be a struct containing
          * a single list member named with the Attribute's "id". The name of the struct
          * should contain the registered name of the Attribute implementation.
          */
-        virtual DDF marshall() const {
-            DDF ddf(NULL);
-            ddf.structure().addmember(m_id.front().c_str()).list();
-            if (!m_caseSensitive)
-                ddf.addmember("case_insensitive");
-            if (m_id.size() > 1) {
-                DDF alias;
-                DDF aliases = ddf.addmember("aliases").list();
-                for (std::vector<std::string>::const_iterator a = m_id.begin() + 1; a != m_id.end(); ++a) {
-                    alias = DDF(NULL).string(a->c_str());
-                    aliases.add(alias);
-                }
-            }
-            return ddf;
-        }
-        
+        virtual DDF marshall() const;
+
         /**
          * Unmarshalls a remoted Attribute.
-         * 
+         *
          * @param in    remoted Attribute data
-         * @return  a resolved Attribute of the proper subclass 
+         * @return  a resolved Attribute of the proper subclass
          */
         static Attribute* unmarshall(DDF& in);
-        
+
         /** A function that unmarshalls remoted data into the proper Attribute subclass. */
         typedef Attribute* AttributeFactory(DDF& in);
 
         /**
          * Registers an AttributeFactory function for a given attribute "type".
-         * 
+         *
          * @param type      string used at the root of remoted Attribute structures
          * @param factory   factory function
-         */        
+         */
         static void registerFactory(const char* type, AttributeFactory* factory) {
             m_factoryMap[type] = factory;
         }
 
         /**
          * Deregisters an AttributeFactory function for a given attribute "type".
-         * 
+         *
          * @param type      string used at the root of remoted Attribute structures
-         */        
+         */
         static void deregisterFactory(const char* type) {
             m_factoryMap.erase(type);
         }
@@ -256,11 +246,11 @@ namespace shibsp {
         static void deregisterFactories() {
             m_factoryMap.clear();
         }
-        
+
     private:
         static std::map<std::string,AttributeFactory*> m_factoryMap;
         std::vector<std::string> m_id;
-        bool m_caseSensitive;
+        bool m_caseSensitive,m_internal;
     };
 
 #if defined (_MSC_VER)
@@ -269,7 +259,7 @@ namespace shibsp {
 
     /** Registers built-in Attribute types into the runtime. */
     void registerAttributeFactories();
-    
+
 };
 
 #endif /* __shibsp_attribute_h__ */
index e0ad576..6a9ca7a 100644 (file)
@@ -45,6 +45,21 @@ namespace shibsp {
         /** Flag for case sensitivity of decoded attributes. */
         bool m_caseSensitive;
 
+        /** Flag for hiding attributes from CGI export. */
+        bool m_internal;
+
+        /**
+         * Helper method to handle base class decoding housekeeping.
+         *
+         * @param attr  the new Attribute object being created
+         * @return  the attr parameter
+         */
+        virtual Attribute* _decode(Attribute* attr) const {
+            attr->setCaseSensitive(m_caseSensitive);
+            attr->setInternal(m_internal);
+            return attr;
+        }
+
     public:
         virtual ~AttributeDecoder() {}
 
index 8501ebb..1549690 100644 (file)
@@ -144,7 +144,7 @@ Attribute* DOMAttributeDecoder::decode(
             log.warn("skipping AttributeValue without a backing DOM");\r
     }\r
 \r
-    return dest.integer() ? attr.release() : NULL;\r
+    return dest.integer() ? _decode(attr.release()) : NULL;\r
 }\r
 \r
 DDF DOMAttributeDecoder::convert(DOMElement* e, bool nameit) const\r
index f6eb446..8a12836 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Copyright 2009 Internet2
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -16,7 +16,7 @@
 
 /**
  * @file shibsp/attribute/ExtensibleAttribute.h
- * 
+ *
  * An Attribute whose values are arbitrary structures.
  */
 
@@ -41,7 +41,7 @@ namespace shibsp {
     public:
         /**
          * Constructor.
-         * 
+         *
          * @param ids       array with primary identifier in first position, followed by any aliases
          * @param formatter template for serialization of values
          */
@@ -53,29 +53,29 @@ namespace shibsp {
 
         /**
          * Constructs based on a remoted ExtensibleAttribute.
-         * 
+         *
          * @param in    input object containing marshalled ExtensibleAttribute
          */
         ExtensibleAttribute(DDF& in) : Attribute(in), m_obj(in.copy()) {
         }
-        
+
         virtual ~ExtensibleAttribute() {
             m_obj.destroy();
         }
-        
+
         /**
          * Returns the set of values in a DDF list.
-         * 
+         *
          * @return  a mutable list object containing the values
          */
         DDF getValues() {
             return m_obj.first();
         }
-        
+
         size_t valueCount() const {
             return m_obj.first().integer();
         }
-        
+
         void clearSerializedValues() {
             m_serialized.clear();
         }
@@ -96,11 +96,15 @@ namespace shibsp {
         }
 
         const std::vector<std::string>& getSerializedValues() const;
-    
+
         DDF marshall() const {
+            if (!isCaseSensitive())
+                m_obj.addmember("case_insensitive");
+            if (isInternal())
+                m_obj.addmember("internal");
             return m_obj.copy();
         }
-    
+
     private:
         mutable DDF m_obj;
     };
index 0bb9f3e..3ab80f2 100644 (file)
@@ -153,5 +153,5 @@ Attribute* KeyInfoAttributeDecoder::decode(
         }\r
     }\r
 \r
-    return dest.empty() ? NULL : attr.release();\r
+    return dest.empty() ? NULL : _decode(attr.release());\r
 }\r
index 38ad01c..903bc33 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- *  Copyright 2001-2007 Internet2\r
+ *  Copyright 2001-2009 Internet2\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -76,7 +76,6 @@ shibsp::Attribute* NameIDAttributeDecoder::decode(
     auto_ptr<NameIDAttribute> nameid(\r
         new NameIDAttribute(ids, (m_formatter.get() && *m_formatter.get()) ? m_formatter.get() : DEFAULT_NAMEID_FORMATTER)\r
         );\r
-    nameid->setCaseSensitive(m_caseSensitive);\r
     vector<NameIDAttribute::Value>& dest = nameid->getValues();\r
     vector<XMLObject*>::const_iterator v,stop;\r
 \r
@@ -138,7 +137,7 @@ shibsp::Attribute* NameIDAttributeDecoder::decode(
             }\r
         }\r
 \r
-        return dest.empty() ? NULL : nameid.release();\r
+        return dest.empty() ? NULL : _decode(nameid.release());\r
     }\r
 \r
     const NameIDType* saml2name = dynamic_cast<const NameIDType*>(xmlObject);\r
@@ -167,7 +166,7 @@ shibsp::Attribute* NameIDAttributeDecoder::decode(
         }\r
     }\r
 \r
-    return dest.empty() ? NULL : nameid.release();\r
+    return dest.empty() ? NULL : _decode(nameid.release());\r
 }\r
 \r
 void NameIDAttributeDecoder::extract(\r
index 611bd5f..ab72dfb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -88,7 +88,6 @@ shibsp::Attribute* NameIDFromScopedAttributeDecoder::decode(
     auto_ptr<NameIDAttribute> nameid(
         new NameIDAttribute(ids, (m_formatter.get() && *m_formatter.get()) ? m_formatter.get() : DEFAULT_NAMEID_FORMATTER)
         );
-    nameid->setCaseSensitive(m_caseSensitive);
     vector<NameIDAttribute::Value>& dest = nameid->getValues();
     vector<XMLObject*>::const_iterator v,stop;
 
@@ -159,7 +158,7 @@ shibsp::Attribute* NameIDFromScopedAttributeDecoder::decode(
             }
         }
 
-        return dest.empty() ? NULL : nameid.release();
+        return dest.empty() ? NULL : _decode(nameid.release());
     }
 
     log.warn("XMLObject type not recognized by NameIDFromScopedAttributeDecoder, no values returned");
index da112b0..c3054c8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -71,7 +71,6 @@ shibsp::Attribute* ScopedAttributeDecoder::decode(
     const XMLCh* xmlscope;
     xmltooling::QName scopeqname(NULL,Scope);
     auto_ptr<ScopedAttribute> scoped(new ScopedAttribute(ids, m_delimeter));
-    scoped->setCaseSensitive(m_caseSensitive);
     vector< pair<string,string> >& dest = scoped->getValues();
     vector<XMLObject*>::const_iterator v,stop;
 
@@ -146,7 +145,7 @@ shibsp::Attribute* ScopedAttributeDecoder::decode(
             }
         }
 
-        return dest.empty() ? NULL : scoped.release();
+        return dest.empty() ? NULL : _decode(scoped.release());
     }
 
     const NameID* saml2name = dynamic_cast<const NameID*>(xmlObject);
@@ -192,5 +191,5 @@ shibsp::Attribute* ScopedAttributeDecoder::decode(
         log.warn("ignoring empty NameID");
     }
     delete[] val;
-    return dest.empty() ? NULL : scoped.release();
+    return dest.empty() ? NULL : _decode(scoped.release());
 }
index ca86390..f2a9d6f 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- *  Copyright 2001-2007 Internet2\r
+ *  Copyright 2001-2009 Internet2\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -57,7 +57,6 @@ shibsp::Attribute* StringAttributeDecoder::decode(
 {\r
     char* val;\r
     auto_ptr<SimpleAttribute> simple(new SimpleAttribute(ids));\r
-    simple->setCaseSensitive(m_caseSensitive);\r
     vector<string>& dest = simple->getValues();\r
     vector<XMLObject*>::const_iterator v,stop;\r
 \r
@@ -111,7 +110,7 @@ shibsp::Attribute* StringAttributeDecoder::decode(
             }\r
         }\r
 \r
-        return dest.empty() ? NULL : simple.release();\r
+        return dest.empty() ? NULL : _decode(simple.release());\r
     }\r
 \r
     const NameID* saml2name = dynamic_cast<const NameID*>(xmlObject);\r
@@ -145,5 +144,5 @@ shibsp::Attribute* StringAttributeDecoder::decode(
     else\r
         log.warn("ignoring empty NameID");\r
     delete[] val;\r
-    return dest.empty() ? NULL : simple.release();\r
+    return dest.empty() ? NULL : _decode(simple.release());\r
 }\r