[cpp-sp COMMIT] in /branches/REL_2: schemas/shibboleth-2.0-attribute-map.xsd shibsp/attribute/Attribute.cpp shibsp/at...

noreply at shibboleth.net noreply at shibboleth.net
Fri Mar 30 23:19:11 BST 2012


Author: scantor
Date: Fri Mar 30 23:19:11 2012
New Revision: 3604

URL: http://svn.shibboleth.net/view/cpp-sp?rev=3604&view=rev
Log:
Schema and metadata attribute handling fixes for langAware decoding

Modified:
    branches/REL_2/schemas/shibboleth-2.0-attribute-map.xsd
    branches/REL_2/shibsp/attribute/Attribute.cpp
    branches/REL_2/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp

Modified: branches/REL_2/schemas/shibboleth-2.0-attribute-map.xsd
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/schemas/shibboleth-2.0-attribute-map.xsd?rev=3604&r1=3603&r2=3604&view=diff
==============================================================================
--- branches/REL_2/schemas/shibboleth-2.0-attribute-map.xsd (original)
+++ branches/REL_2/schemas/shibboleth-2.0-attribute-map.xsd Fri Mar 30 23:19:11 2012
@@ -65,6 +65,7 @@
                 </choice>
                 <element ref="ds:Signature" minOccurs="0"/>
             </sequence>
+            <attribute name="metadataAttributeCaching" type="boolean"/>
             <attribute name="metadataPolicyId" type="am:string"/>
         </complexType>
     </element>
@@ -161,7 +162,16 @@
         </attribute>
         <attribute name="internal" type="boolean">
             <annotation>
-                <documentation>Flag controlling whether the resulting attribute should be exported for CGI use.</documentation>
+                <documentation>
+                    Flag controlling whether the resulting attribute should be exported for CGI use.
+                </documentation>
+            </annotation>
+        </attribute>
+        <attribute name="langAware" type="boolean">
+            <annotation>
+                <documentation>
+                    Flag controlling whether the decoder should select only the best matching value by language.
+                </documentation>
             </annotation>
         </attribute>
         <attribute name="hashAlg" type="am:string">

Modified: branches/REL_2/shibsp/attribute/Attribute.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/shibsp/attribute/Attribute.cpp?rev=3604&r1=3603&r2=3604&view=diff
==============================================================================
--- branches/REL_2/shibsp/attribute/Attribute.cpp (original)
+++ branches/REL_2/shibsp/attribute/Attribute.cpp Fri Mar 30 23:19:11 2012
@@ -168,8 +168,9 @@
     const GenericRequest* request, const vector<XMLObject*>& objects
     ) const
 {
-    if (!m_langAware || !request)
+    if (!m_langAware || !request || objects.empty()) {
         return make_pair(objects.begin(), objects.end());
+    }
     else if (request && request->startLangMatching()) {
         do {
             for (vector<XMLObject*>::const_iterator i = objects.begin(); i != objects.end(); ++i) {
@@ -180,7 +181,7 @@
         } while (request->continueLangMatching());
     }
 
-    return make_pair(objects.begin(), objects.end());
+    return make_pair(objects.begin(), objects.begin() + 1);
 }
 #endif
 

Modified: branches/REL_2/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp?rev=3604&r1=3603&r2=3604&view=diff
==============================================================================
--- branches/REL_2/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp (original)
+++ branches/REL_2/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp Fri Mar 30 23:19:11 2012
@@ -131,7 +131,7 @@
         scoped_ptr<AttributeFilter> m_filter;
         scoped_ptr<MetadataProvider> m_metadata;
         scoped_ptr<TrustEngine> m_trust;
-        bool m_entityAssertions;
+        bool m_entityAssertions,m_metaAttrCaching;
 
         // manages caching of decoded Attributes
         scoped_ptr<RWLock> m_attrLock;
@@ -186,25 +186,27 @@
         return new XMLExtractor(e);
     }
 
-    static const XMLCh _aliases[] =             UNICODE_LITERAL_7(a,l,i,a,s,e,s);
-    static const XMLCh _AttributeDecoder[] =    UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r);
-    static const XMLCh _AttributeFilter[] =     UNICODE_LITERAL_15(A,t,t,r,i,b,u,t,e,F,i,l,t,e,r);
-    static const XMLCh Attributes[] =           UNICODE_LITERAL_10(A,t,t,r,i,b,u,t,e,s);
-    static const XMLCh _id[] =                  UNICODE_LITERAL_2(i,d);
-    static const XMLCh isRequested[] =          UNICODE_LITERAL_11(i,s,R,e,q,u,e,s,t,e,d);
-    static const XMLCh _MetadataProvider[] =    UNICODE_LITERAL_16(M,e,t,a,d,a,t,a,P,r,o,v,i,d,e,r);
-    static const XMLCh _name[] =                UNICODE_LITERAL_4(n,a,m,e);
-    static const XMLCh nameFormat[] =           UNICODE_LITERAL_10(n,a,m,e,F,o,r,m,a,t);
-    static const XMLCh metadataPolicyId[] =     UNICODE_LITERAL_16(m,e,t,a,d,a,t,a,P,o,l,i,c,y,I,d);
-    static const XMLCh _TrustEngine[] =         UNICODE_LITERAL_11(T,r,u,s,t,E,n,g,i,n,e);
-    static const XMLCh _type[] =                UNICODE_LITERAL_4(t,y,p,e);
+    static const XMLCh _aliases[] =                 UNICODE_LITERAL_7(a,l,i,a,s,e,s);

[... 44 lines stripped ...]


More information about the commits mailing list