Added logging of attribute names.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Mon, 25 Apr 2005 16:57:21 +0000 (16:57 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Mon, 25 Apr 2005 16:57:21 +0000 (16:57 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@1559 cb58f699-b61c-0410-a6fe-9272a202ed29

shib-target/shib-ccache.cpp

index 8ed6ee9..0d0eced 100644 (file)
@@ -855,6 +855,37 @@ SAMLResponse* InternalCCacheEntry::filter(SAMLResponse* r, const IApplication* a
             copy->removeAssertion(j);
         }
     }
+
+    // Audit the results.    
+    STConfig& stc=static_cast<STConfig&>(ShibTargetConfig::getConfig());
+    Category& tran=stc.getTransactionLog();
+    if (tran.isInfoEnabled()) {
+        tran.infoStream() <<
+            "Caching the following attributes after AAP applied for session (ID: " <<
+                m_id <<
+            ") on (applicationId: " <<
+                m_application_id <<
+            ") for principal from (IdP: " <<
+                m_provider_id <<
+            ") {";
+
+        Iterator<SAMLAssertion*> loggies=copy->getAssertions();
+        while (loggies.hasNext()) {
+            SAMLAssertion* logit=loggies.next();
+            Iterator<SAMLStatement*> states=logit->getStatements();
+            while (states.hasNext()) {
+                SAMLAttributeStatement* state=dynamic_cast<SAMLAttributeStatement*>(states.next());
+                Iterator<SAMLAttribute*> attrs=state ? state->getAttributes() : EMPTY(SAMLAttribute*);
+                while (attrs.hasNext()) {
+                    SAMLAttribute* attr=attrs.next();
+                    auto_ptr_char attrname(attr->getName());
+                    tran.infoStream() << "\t" << attrname.get() << " (" << attr->getValues().size() << " values)";
+                }
+            }
+        }
+        tran.info("}");
+    }
+    stc.releaseTransactionLog();
     
     return copy.release();
 }