Moved handler accessors up to base.
authorScott Cantor <cantor.2@osu.edu>
Tue, 16 Jan 2007 02:34:57 +0000 (02:34 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 16 Jan 2007 02:34:57 +0000 (02:34 +0000)
shib-target/shib-ini.cpp
shib-target/shib-target.h
shibsp/Application.h

index b09d090..af40e95 100644 (file)
@@ -50,6 +50,8 @@ using xmlsignature::CredentialResolver;
 
 namespace {
 
+    vector<const Handler*> g_noHandlers;
+
     // Application configuration wrapper
     class XMLApplication : public virtual IApplication, public DOMPropertySet, public DOMNodeFilter
     {
@@ -89,7 +91,7 @@ namespace {
         const Handler* getSessionInitiatorById(const char* id) const;
         const Handler* getDefaultAssertionConsumerService() const;
         const Handler* getAssertionConsumerServiceByIndex(unsigned short index) const;
-        Iterator<const Handler*> getAssertionConsumerServicesByBinding(const XMLCh* binding) const;
+        const vector<const Handler*>& getAssertionConsumerServicesByBinding(const XMLCh* binding) const;
         const Handler* getHandler(const char* path) const;
         
         // Provides filter to exclude special config elements.
@@ -801,7 +803,7 @@ const Handler* XMLApplication::getAssertionConsumerServiceByIndex(unsigned short
     return m_base ? m_base->getAssertionConsumerServiceByIndex(index) : NULL;
 }
 
-Iterator<const Handler*> XMLApplication::getAssertionConsumerServicesByBinding(const XMLCh* binding) const
+const vector<const Handler*>& XMLApplication::getAssertionConsumerServicesByBinding(const XMLCh* binding) const
 {
 #ifdef HAVE_GOOD_STL
     ACSBindingMap::const_iterator i=m_acsBindingMap.find(binding);
@@ -811,7 +813,7 @@ Iterator<const Handler*> XMLApplication::getAssertionConsumerServicesByBinding(c
 #endif
     if (i!=m_acsBindingMap.end())
         return i->second;
-    return m_base ? m_base->getAssertionConsumerServicesByBinding(binding) : EMPTY(const Handler*);
+    return m_base ? m_base->getAssertionConsumerServicesByBinding(binding) : g_noHandlers;
 }
 
 const Handler* XMLApplication::getHandler(const char* path) const
index 76c5ca6..cb0649a 100644 (file)
@@ -85,18 +85,6 @@ namespace shibtarget {
             const xmltooling::TrustEngine* trust=NULL
             ) const=0;
 
-        // Used to locate a default or designated session initiator for automatic sessions
-        virtual const shibsp::Handler* getDefaultSessionInitiator() const=0;
-        virtual const shibsp::Handler* getSessionInitiatorById(const char* id) const=0;
-        
-        // Used by session initiators to get endpoint to forward to IdP/WAYF
-        virtual const shibsp::Handler* getDefaultAssertionConsumerService() const=0;
-        virtual const shibsp::Handler* getAssertionConsumerServiceByIndex(unsigned short index) const=0;
-        virtual saml::Iterator<const shibsp::Handler*> getAssertionConsumerServicesByBinding(const XMLCh* binding) const=0;
-        
-        // Used by dispatcher to locate the handler for a request
-        virtual const shibsp::Handler* getHandler(const char* path) const=0;
-
         virtual ~IApplication() {}
     };
 
index fa10141..b1cfe57 100644 (file)
@@ -28,6 +28,8 @@
 #include <xmltooling/security/TrustEngine.h>
 
 namespace shibsp {
+    
+    class SHIBSP_API Handler;
 
     /**
      * Interface to a Shibboleth Application instance.
@@ -85,7 +87,60 @@ namespace shibsp {
          * @param provider  a peer entity's metadata
          * @return  the applicable PropertySet
          */
-        virtual const shibsp::PropertySet* getCredentialUse(const opensaml::saml2md::EntityDescriptor* provider) const=0;
+        virtual const PropertySet* getCredentialUse(const opensaml::saml2md::EntityDescriptor* provider) const=0;
+
+        /**
+         * Returns the default SessionInitiator Handler when automatically
+         * requesting a session.
+         * 
+         * @return the default SessionInitiator, or NULL
+         */
+        virtual const Handler* getDefaultSessionInitiator() const=0;
+        
+        /**
+         * Returns a SessionInitiator Handler with a particular ID when automatically
+         * requesting a session.
+         * 
+         * @param id    an identifier unique to an application
+         * @return the designated SessionInitiator, or NULL
+         */
+        virtual const Handler* getSessionInitiatorById(const char* id) const=0;
+        
+        /**
+         * Returns the default AssertionConsumerService Handler
+         * for use in AuthnRequest messages.
+         * 
+         * @return the default AssertionConsumerService, or NULL
+         */
+        virtual const Handler* getDefaultAssertionConsumerService() const=0;
+
+        /**
+         * Returns an AssertionConsumerService Handler with a particular index
+         * for use in AuthnRequest messages.
+         * 
+         * @param index an index unique to an application
+         * @return the designated AssertionConsumerService, or NULL
+         */
+        virtual const Handler* getAssertionConsumerServiceByIndex(unsigned short index) const=0;
+
+        /**
+         * Returns one or more AssertionConsumerService Handlers that support
+         * a particular protocol binding.
+         * 
+         * @param binding   a protocol binding identifier
+         * @return a set of qualifying AssertionConsumerServices
+         */
+        virtual const std::vector<const Handler*>& getAssertionConsumerServicesByBinding(const XMLCh* binding) const=0;
+        
+        /**
+         * Returns the Handler associated with a particular path/location.
+         * 
+         * @param path  the PATH_INFO appended to the end of a base Handler location
+         *              that invokes the Handler
+         * @return the mapped Handler, or NULL 
+         */
+        virtual const Handler* getHandler(const char* path) const=0;
+
     };
 };