Add a getType method to handlers to assist with documentation.
authorScott Cantor <cantor.2@osu.edu>
Mon, 8 Oct 2007 20:38:56 +0000 (20:38 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 8 Oct 2007 20:38:56 +0000 (20:38 +0000)
adfs/adfs.cpp
shibsp/handler/AssertionConsumerService.h
shibsp/handler/Handler.h
shibsp/handler/SessionInitiator.h
shibsp/handler/impl/ChainingLogoutInitiator.cpp
shibsp/handler/impl/LocalLogoutInitiator.cpp
shibsp/handler/impl/SAML2ArtifactResolution.cpp
shibsp/handler/impl/SAML2Logout.cpp
shibsp/handler/impl/SAML2LogoutInitiator.cpp
shibsp/handler/impl/SAML2NameIDMgmt.cpp

index 6403441..38359f8 100644 (file)
@@ -201,6 +201,12 @@ namespace {
         void receive(DDF& in, ostream& out);
         pair<bool,long> run(SPRequest& request, bool isHandler=true) const;
 
+#ifndef SHIBSP_LITE
+        const char* getType() const {
+            return "LogoutInitiator";
+        }
+#endif
+
     private:
         pair<bool,long> doRequest(
             const Application& application, const char* requestURL, const char* entityID, HTTPResponse& httpResponse
@@ -240,6 +246,10 @@ namespace {
             ep->setBinding(m_login.m_protocol.get());
             role.getSingleLogoutServices().push_back(ep);
         }
+
+        const char* getType() const {
+            return m_login.getType();
+        }
 #endif
 
     private:
index 9cf5f48..22a8d6e 100644 (file)
@@ -62,10 +62,21 @@ namespace shibsp {
          * @param log   a logging object to use
          */
         AssertionConsumerService(const xercesc::DOMElement* e, const char* appId, xmltooling::logging::Category& log);
+
+        /**
+         * Enforce address checking requirements.
+         * 
+         * @param application   reference to application receiving message
+         * @param httpRequest   client request that initiated session
+         * @param issuedTo      address for which security assertion was issued
+         */
+        void checkAddress(
+            const Application& application, const xmltooling::HTTPRequest& httpRequest, const char* issuedTo
+            ) const;
         
 #ifndef SHIBSP_LITE
         void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const;
-
+        
         /**
          * Implement protocol-specific handling of the incoming decoded message.
          * 
@@ -124,19 +135,13 @@ namespace shibsp {
             const XMLCh* authncontext_decl=NULL,
             const std::vector<const opensaml::Assertion*>* tokens=NULL
             ) const;
+
+    public:
+        const char* getType() const {
+            return "AssertionConsumerService";
+        }
+
 #endif
-        
-        /**
-         * Enforce address checking requirements.
-         * 
-         * @param application   reference to application receiving message
-         * @param httpRequest   client request that initiated session
-         * @param issuedTo      address for which security assertion was issued
-         */
-        void checkAddress(
-            const Application& application, const xmltooling::HTTPRequest& httpRequest, const char* issuedTo
-            ) const;
-        
     private:
         std::string processMessage(
             const Application& application,
index 7c92a53..f826882 100644 (file)
@@ -57,7 +57,7 @@ namespace shibsp {
 
 #ifndef SHIBSP_LITE
         /**
-         * Generates and/or modifies metadata reflecting the handler.
+         * Generates and/or modifies metadata reflecting the Handler.
          *
          * <p>The default implementation does nothing.
          *
@@ -66,6 +66,15 @@ namespace shibsp {
          */
         virtual void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const {
         }
+
+        /**
+         * Returns the "type" of the Handler plugin.
+         *
+         * @return  a Handler type
+         */
+        virtual const char* getType() const {
+            return getString("type").second;
+        }
 #endif
     };
     
index 518409e..bd939dc 100644 (file)
@@ -55,6 +55,12 @@ namespace shibsp {
         virtual std::pair<bool,long> run(SPRequest& request, const char* entityID=NULL, bool isHandler=true) const=0;
 
         std::pair<bool,long> run(SPRequest& request, bool isHandler=true) const;
+
+#ifndef SHIBSP_LITE
+        const char* getType() const {
+            return "SessionInitiator";
+        }
+#endif
     };
     
     /** Registers SessionInitiator implementations. */
index 29a5ce6..4d1e434 100644 (file)
@@ -50,6 +50,12 @@ namespace shibsp {
         
         pair<bool,long> run(SPRequest& request, bool isHandler=true) const;
 
+#ifndef SHIBSP_LITE
+        const char* getType() const {
+            return "LogoutInitiator";
+        }
+#endif
+
     private:
         vector<Handler*> m_handlers;
     };
index e541784..d9383a7 100644 (file)
@@ -47,6 +47,12 @@ namespace shibsp {
         void setParent(const PropertySet* parent);
         pair<bool,long> run(SPRequest& request, bool isHandler=true) const;
 
+#ifndef SHIBSP_LITE
+        const char* getType() const {
+            return "LogoutInitiator";
+        }
+#endif
+
     private:
         string m_appId;
     };
index 72ebae6..07fa66e 100644 (file)
@@ -69,6 +69,12 @@ namespace shibsp {
         pair<bool,long> run(SPRequest& request, bool isHandler=true) const;
         void receive(DDF& in, ostream& out);
 
+#ifndef SHIBSP_LITE
+        const char* getType() const {
+            return "ArtifactResolutionService";
+        }
+#endif
+
     private:
         pair<bool,long> processMessage(const Application& application, HTTPRequest& httpRequest, HTTPResponse& httpResponse) const;
 #ifndef SHIBSP_LITE
index ab2f67e..81ba862 100644 (file)
@@ -86,6 +86,10 @@ namespace shibsp {
             role.getSingleLogoutServices().push_back(ep);
             role.addSupport(samlconstants::SAML20P_NS);
         }
+
+        const char* getType() const {
+            return "SingleLogoutService";
+        }
 #endif
 
     private:
index 6d9274f..36141f5 100644 (file)
@@ -71,6 +71,12 @@ namespace shibsp {
         void receive(DDF& in, ostream& out);
         pair<bool,long> run(SPRequest& request, bool isHandler=true) const;
 
+#ifndef SHIBSP_LITE
+        const char* getType() const {
+            return "LogoutInitiator";
+        }
+#endif
+
     private:
         pair<bool,long> doRequest(const Application& application, const char* requestURL, Session* session, HTTPResponse& httpResponse) const;
 
index 2649e1f..0f90abb 100644 (file)
@@ -86,6 +86,10 @@ namespace shibsp {
             role.getManageNameIDServices().push_back(ep);
             role.addSupport(samlconstants::SAML20P_NS);
         }
+
+        const char* getType() const {
+            return "ManageNameIDService";
+        }
 #endif
 
     private: