Imported Upstream version 2.2.1+dfsg
[shibboleth/sp.git] / shibsp / attribute / AttributeDecoder.h
index 4d0fe94..5b0ad48 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/AttributeDecoder.h
- * 
+ *
  * Decodes SAML NameID/Attribute objects into resolved Attributes.
  */
 
@@ -45,12 +45,27 @@ 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() {}
-        
+
         /**
          * Decodes an XMLObject into a resolved Attribute.
-         * 
+         *
          * @param ids               array containing primary identifier in first position, followed by any aliases
          * @param xmlObject         XMLObject to decode
          * @param assertingParty    name of the party asserting the attribute
@@ -68,13 +83,25 @@ namespace shibsp {
 
     /** Decodes into a SimpleAttribute. */
     extern SHIBSP_API xmltooling::QName StringAttributeDecoderType;
-    
-    /** Decodes into a ScopedAttribute. */
+
+    /** Decodes scoped and NameID attributes into a ScopedAttribute. */
     extern SHIBSP_API xmltooling::QName ScopedAttributeDecoderType;
 
-    /** Decodes into a NameIDAttribute. */
+    /** Decodes NameID information into a NameIDAttribute. */
     extern SHIBSP_API xmltooling::QName NameIDAttributeDecoderType;
 
+    /** Decodes scoped attributes into a NameIDAttribute. */
+    extern SHIBSP_API xmltooling::QName NameIDFromScopedAttributeDecoderType;
+
+    /** Decodes KeyInfo information into a SimpleAttribute. */
+    extern SHIBSP_API xmltooling::QName KeyInfoAttributeDecoderType;
+
+    /** Decodes arbitrary DOM information into an ExtensibleAttribute. */
+    extern SHIBSP_API xmltooling::QName DOMAttributeDecoderType;
+
+    /** Decodes arbitrary XML into an XMLAttribute. */
+    extern SHIBSP_API xmltooling::QName XMLAttributeDecoderType;
+
     /** Registers built-in AttributeDecoders into the runtime. */
     void registerAttributeDecoders();
 };