Add short name to encoders/decoders for endpoint generation.
authorcantor <cantor@fb386ef7-a10c-0410-8ebf-fd3f8e989ab0>
Wed, 11 Aug 2010 18:36:47 +0000 (18:36 +0000)
committercantor <cantor@fb386ef7-a10c-0410-8ebf-fd3f8e989ab0>
Wed, 11 Aug 2010 18:36:47 +0000 (18:36 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-opensaml2/branches/REL_2@565 fb386ef7-a10c-0410-8ebf-fd3f8e989ab0

20 files changed:
saml/binding/MessageDecoder.h
saml/binding/MessageEncoder.h
saml/binding/impl/MessageDecoder.cpp
saml/binding/impl/MessageEncoder.cpp
saml/saml1/binding/impl/SAML1ArtifactDecoder.cpp
saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp
saml/saml1/binding/impl/SAML1POSTDecoder.cpp
saml/saml1/binding/impl/SAML1POSTEncoder.cpp
saml/saml1/binding/impl/SAML1SOAPDecoder.cpp
saml/saml1/binding/impl/SAML1SOAPEncoder.cpp
saml/saml2/binding/impl/SAML2ArtifactDecoder.cpp
saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp
saml/saml2/binding/impl/SAML2ECPDecoder.cpp
saml/saml2/binding/impl/SAML2ECPEncoder.cpp
saml/saml2/binding/impl/SAML2POSTDecoder.cpp
saml/saml2/binding/impl/SAML2POSTEncoder.cpp
saml/saml2/binding/impl/SAML2RedirectDecoder.cpp
saml/saml2/binding/impl/SAML2RedirectEncoder.cpp
saml/saml2/binding/impl/SAML2SOAPDecoder.cpp
saml/saml2/binding/impl/SAML2SOAPEncoder.cpp

index bbe176e..ad7ad47 100644 (file)
@@ -68,6 +68,13 @@ namespace opensaml {
         virtual const XMLCh* getProtocolFamily() const;
 
         /**
+         * Returns a shorthand name for the binding/encoding supported by the decoder.
+         *
+         * @return  a short name for the binding/encoding, or nullptr
+         */
+        virtual const char* getShortName() const;
+
+        /**
          * Indicates whether a web browser or similar user agent delivered the message.
          *
          * @return true iff the message was delivered by a user agent
index 095a523..96c30b3 100644 (file)
@@ -72,6 +72,13 @@ namespace opensaml {
         virtual const XMLCh* getProtocolFamily() const;
 
         /**
+         * Returns a shorthand name for the binding/encoding supported by the encoder.
+         *
+         * @return  a short name for the binding/encoding, or nullptr
+         */
+        virtual const char* getShortName() const;
+
+        /**
          * Interface to caller-supplied artifact generation mechanism.
          * 
          * Generating an artifact for storage and retrieval requires knowledge of
index 4ff6c79..8c33780 100644 (file)
@@ -43,6 +43,7 @@ namespace opensaml {
     namespace saml2p {
         SAML_DLLLOCAL PluginManager< MessageDecoder,string,pair<const DOMElement*,const XMLCh*> >::Factory SAML2ArtifactDecoderFactory;
         SAML_DLLLOCAL PluginManager< MessageDecoder,string,pair<const DOMElement*,const XMLCh*> >::Factory SAML2POSTDecoderFactory;
+        SAML_DLLLOCAL PluginManager< MessageDecoder,string,pair<const DOMElement*,const XMLCh*> >::Factory SAML2POSTSimpleSignDecoderFactory;
         SAML_DLLLOCAL PluginManager< MessageDecoder,string,pair<const DOMElement*,const XMLCh*> >::Factory SAML2RedirectDecoderFactory;
         SAML_DLLLOCAL PluginManager< MessageDecoder,string,pair<const DOMElement*,const XMLCh*> >::Factory SAML2SOAPDecoderFactory;
         SAML_DLLLOCAL PluginManager< MessageDecoder,string,pair<const DOMElement*,const XMLCh*> >::Factory SAML2ECPDecoderFactory;
@@ -57,7 +58,7 @@ void SAML_API opensaml::registerMessageDecoders()
     conf.MessageDecoderManager.registerFactory(samlconstants::SAML1_BINDING_SOAP, saml1p::SAML1SOAPDecoderFactory);
     conf.MessageDecoderManager.registerFactory(samlconstants::SAML20_BINDING_HTTP_ARTIFACT, saml2p::SAML2ArtifactDecoderFactory);
     conf.MessageDecoderManager.registerFactory(samlconstants::SAML20_BINDING_HTTP_POST, saml2p::SAML2POSTDecoderFactory);
-    conf.MessageDecoderManager.registerFactory(samlconstants::SAML20_BINDING_HTTP_POST_SIMPLESIGN, saml2p::SAML2POSTDecoderFactory);
+    conf.MessageDecoderManager.registerFactory(samlconstants::SAML20_BINDING_HTTP_POST_SIMPLESIGN, saml2p::SAML2POSTSimpleSignDecoderFactory);
     conf.MessageDecoderManager.registerFactory(samlconstants::SAML20_BINDING_HTTP_REDIRECT, saml2p::SAML2RedirectDecoderFactory);
     conf.MessageDecoderManager.registerFactory(samlconstants::SAML20_BINDING_SOAP, saml2p::SAML2SOAPDecoderFactory);
     conf.MessageDecoderManager.registerFactory(samlconstants::SAML20_BINDING_PAOS, saml2p::SAML2ECPDecoderFactory);
@@ -79,6 +80,11 @@ const XMLCh* MessageDecoder::getProtocolFamily() const
     return nullptr;
 }
 
+const char* MessageDecoder::getShortName() const
+{
+    return nullptr;
+}
+
 bool MessageDecoder::isUserAgentPresent() const
 {
     return true;
index 035ad55..2665f04 100644 (file)
@@ -76,6 +76,11 @@ const XMLCh* MessageEncoder::getProtocolFamily() const
     return nullptr;
 }
 
+const char* MessageEncoder::getShortName() const
+{
+    return nullptr;
+}
+
 bool MessageEncoder::isCompact() const
 {
     return false;
index ad6e2d9..12552ad 100644 (file)
@@ -50,6 +50,10 @@ namespace opensaml {
             SAML1ArtifactDecoder() {}
             virtual ~SAML1ArtifactDecoder() {}
 
+            const char* getShortName() const {
+                return "Artifact";
+            }
+
             xmltooling::XMLObject* decode(
                 std::string& relayState,
                 const GenericRequest& genericRequest,
index 99c1432..4e38da3 100644 (file)
@@ -56,6 +56,10 @@ namespace opensaml {
                 return samlconstants::SAML11_PROTOCOL_ENUM;
             }
 
+            const char* getShortName() const {
+                return "Artifact";
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index 4c59745..2ae3d8d 100644 (file)
@@ -54,7 +54,11 @@ namespace opensaml {
         public:
             SAML1POSTDecoder() {}
             virtual ~SAML1POSTDecoder() {}
-            
+
+            const char* getShortName() const {
+                return "POST";
+            }
+
             xmltooling::XMLObject* decode(
                 std::string& relayState,
                 const GenericRequest& genericRequest,
index 73dc625..64a2511 100644 (file)
@@ -58,6 +58,10 @@ namespace opensaml {
                 return samlconstants::SAML11_PROTOCOL_ENUM;
             }
 
+            const char* getShortName() const {
+                return "POST";
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index 6a9e29c..12be2b4 100644 (file)
@@ -53,6 +53,10 @@ namespace opensaml {
                 return false;
             }
 
+            const char* getShortName() const {
+                return "SOAP";
+            }
+
             xmltooling::XMLObject* decode(
                 std::string& relayState,
                 const GenericRequest& genericRequest,
index 4aef15f..43c96c4 100644 (file)
@@ -54,6 +54,10 @@ namespace opensaml {
                 return false;
             }
 
+            const char* getShortName() const {
+                return "POST";
+            }
+
             const XMLCh* getProtocolFamily() const {
                 return samlconstants::SAML11_PROTOCOL_ENUM;
             }
index b58d356..32ca0f4 100644 (file)
@@ -51,6 +51,10 @@ namespace opensaml {
             SAML2ArtifactDecoder() {}
             virtual ~SAML2ArtifactDecoder() {}
 
+            const char* getShortName() const {
+                return "Artifact";
+            }
+
             xmltooling::XMLObject* decode(
                 std::string& relayState,
                 const GenericRequest& genericRequest,
index 138fbd2..b16e9c1 100644 (file)
@@ -60,6 +60,10 @@ namespace opensaml {
                 return samlconstants::SAML20P_NS;
             }
 
+            const char* getShortName() const {
+                return "Artifact";
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index 53f2210..620c802 100644 (file)
@@ -50,6 +50,10 @@ namespace opensaml {
             SAML2ECPDecoder() {}
             virtual ~SAML2ECPDecoder() {}
 
+            const char* getShortName() const {
+                return "ECP";
+            }
+
             xmltooling::XMLObject* decode(
                 std::string& relayState,
                 const GenericRequest& genericRequest,
index 36c0fce..103080c 100644 (file)
@@ -68,6 +68,10 @@ namespace opensaml {
                 return samlconstants::SAML20P_NS;
             }
 
+            const char* getShortName() const {
+                return "ECP";
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index 40565fa..64404ce 100644 (file)
@@ -51,19 +51,33 @@ namespace opensaml {
         class SAML_DLLLOCAL SAML2POSTDecoder : public SAML2MessageDecoder
         {
         public:
-            SAML2POSTDecoder() {}
+            SAML2POSTDecoder(const DOMElement* e, const XMLCh* ns, bool simple=false) {
+            }
+
             virtual ~SAML2POSTDecoder() {}
-            
+
+            const char* getShortName() const {
+                return m_simple ? "POST-SimpleSign" : "POST";
+            }
+
             xmltooling::XMLObject* decode(
                 std::string& relayState,
                 const GenericRequest& genericRequest,
                 SecurityPolicy& policy
                 ) const;
+
+        private:
+            bool m_simple;
         };                
 
         MessageDecoder* SAML_DLLLOCAL SAML2POSTDecoderFactory(const pair<const DOMElement*,const XMLCh*>& p)
         {
-            return new SAML2POSTDecoder();
+            return new SAML2POSTDecoder(p.first, p.second, false);
+        }
+
+        MessageDecoder* SAML_DLLLOCAL SAML2POSTSimpleSignDecoderFactory(const pair<const DOMElement*,const XMLCh*>& p)
+        {
+            return new SAML2POSTDecoder(p.first, p.second, true);
         }
     };
 };
index 53f08cf..8489888 100644 (file)
@@ -60,6 +60,10 @@ namespace opensaml {
                 return samlconstants::SAML20P_NS;
             }
 
+            const char* getShortName() const {
+                return m_simple ? "POST-SimpleSign" : "POST";
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index f81584f..d1ad87e 100644 (file)
@@ -54,6 +54,10 @@ namespace opensaml {
             SAML2RedirectDecoder() {}
             virtual ~SAML2RedirectDecoder() {}
 
+            const char* getShortName() const {
+                return "Redirect";
+            }
+
             xmltooling::XMLObject* decode(
                 std::string& relayState,
                 const GenericRequest& genericRequest,
index 616d98f..58c7a66 100644 (file)
@@ -62,6 +62,10 @@ namespace opensaml {
                 return samlconstants::SAML20P_NS;
             }
 
+            const char* getShortName() const {
+                return "Redirect";
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index 69848be..e4e81e6 100644 (file)
@@ -53,6 +53,10 @@ namespace opensaml {
                 return false;
             }
 
+            const char* getShortName() const {
+                return "SOAP";
+            }
+
             xmltooling::XMLObject* decode(
                 std::string& relayState,
                 const GenericRequest& genericRequest,
index f9a2e1c..a7b5b9c 100644 (file)
@@ -58,6 +58,10 @@ namespace opensaml {
                 return samlconstants::SAML20P_NS;
             }
 
+            const char* getShortName() const {
+                return "SOAP";
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,