[cpp-sp] branch main updated: Remove more TransactionLog code.

Scott Cantor cantor.2 at osu.edu
Fri Nov 1 19:04:43 UTC 2024


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=0a70ec808e044c9dbcbe0f33470ea2d1d308a1d9

The following commit(s) were added to refs/heads/main by this push:
     new 0a70ec80 Remove more TransactionLog code.
0a70ec80 is described below

commit 0a70ec808e044c9dbcbe0f33470ea2d1d308a1d9
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Nov 1 15:04:38 2024 -0400

    Remove more TransactionLog code.
---
 shibsp/ServiceProvider.h                         | 35 -------------
 shibsp/handler/impl/AdminLogoutInitiator.cpp     | 44 ----------------
 shibsp/handler/impl/AssertionConsumerService.cpp | 26 ----------
 shibsp/handler/impl/LocalLogoutInitiator.cpp     |  7 ---
 shibsp/handler/impl/SAML2Consumer.cpp            | 23 ---------
 shibsp/handler/impl/SAML2Logout.cpp              | 60 +---------------------
 shibsp/handler/impl/SAML2LogoutInitiator.cpp     | 46 -----------------
 shibsp/handler/impl/SAML2SessionInitiator.cpp    | 11 ----
 shibsp/handler/impl/SAMLDSSessionInitiator.cpp   |  6 ---
 shibsp/impl/StorageServiceSessionCache.cpp       | 65 +-----------------------
 10 files changed, 2 insertions(+), 321 deletions(-)

diff --git a/shibsp/ServiceProvider.h b/shibsp/ServiceProvider.h
index 2aca228f..f9672379 100644
--- a/shibsp/ServiceProvider.h
+++ b/shibsp/ServiceProvider.h
@@ -95,23 +95,6 @@ namespace shibsp {
          */
         virtual const XMLCh* getConfigurationNamespace() const=0;
 
-#ifndef SHIBSP_LITE
-        /**
-         * Returns a TransactionLog instance.
-         * 
-         * @return  a TransactionLog instance
-         */
-        virtual TransactionLog* getTransactionLog() const=0;
-
-        /**
-         * Returns a StorageService instance based on an ID.
-         * 
-         * @param id    a nullptr-terminated key identifying the StorageService to the configuration 
-         * @return  a StorageService if available, or nullptr
-         */
-        virtual xmltooling::StorageService* getStorageService(const char* id) const=0;
-#endif
-
         /**
          * Returns a SessionCache instance.
          * 
@@ -128,24 +111,6 @@ namespace shibsp {
          */
         virtual ListenerService* getListenerService(bool required=true) const=0;
         
-#ifndef SHIBSP_LITE
-        /**
-         * Returns a SecurityPolicyProvider instance.
-         *
-         * @param required true iff an exception should be thrown if no SecurityPolicyProvider is available
-         * @return  a SecurityPolicyProvider
-         */
-        virtual SecurityPolicyProvider* getSecurityPolicyProvider(bool required=true) const=0;
-
-        /**
-         * Sets implementation-specific transport options.
-         *
-         * @param transport a SOAPTransport object
-         * @return  true iff all options were successfully set
-         */
-        virtual bool setTransportOptions(xmltooling::SOAPTransport& transport) const=0;
-#endif
-
         /**
          * Returns a RequestMapper instance.
          * 
diff --git a/shibsp/handler/impl/AdminLogoutInitiator.cpp b/shibsp/handler/impl/AdminLogoutInitiator.cpp
index 7a1c5bac..19e1aa25 100644
--- a/shibsp/handler/impl/AdminLogoutInitiator.cpp
+++ b/shibsp/handler/impl/AdminLogoutInitiator.cpp
@@ -216,9 +216,6 @@ pair<bool,long> AdminLogoutInitiator::doRequest(const Application& application,
     time_t revocationExp = session->getExpiration();
 
     Locker sessionLocker(session, false);
-#ifndef SHIBSP_LITE
-    scoped_ptr<LogoutEvent> logout_event(newLogoutEvent(application, &httpRequest, session));
-#endif
 
     bool doSAML = false;
 
@@ -239,12 +236,6 @@ pair<bool,long> AdminLogoutInitiator::doRequest(const Application& application,
     // Do back channel notification.
     vector<string> sessions(1, session->getID());
     if (!notifyBackChannel(application, httpRequest.getRequestURL(), sessions, true)) {
-#ifndef SHIBSP_LITE
-        if (logout_event) {
-            logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_PARTIAL;
-            application.getServiceProvider().getTransactionLog()->write(*logout_event);
-        }
-#endif
         sessionLocker.assign();
         session = nullptr;
         application.getServiceProvider().getSessionCache()->remove(application, sessionId, revocationExp);
@@ -254,12 +245,6 @@ pair<bool,long> AdminLogoutInitiator::doRequest(const Application& application,
     }
 
     if (!doSAML) {
-#ifndef SHIBSP_LITE
-        if (logout_event) {
-            logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_LOCAL;
-            application.getServiceProvider().getTransactionLog()->write(*logout_event);
-        }
-#endif
         sessionLocker.assign();
         session = nullptr;
         application.getServiceProvider().getSessionCache()->remove(application, sessionId, revocationExp);
@@ -312,14 +297,6 @@ pair<bool,long> AdminLogoutInitiator::doRequest(const Application& application,
                 requestSent = true;
                 auto_ptr<LogoutRequest> msg(buildRequest(application, *session, *role, epit->getLocation()));
 
-                // Log the request.
-                if (logout_event) {
-                    logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_UNKNOWN;
-                    logout_event->m_saml2Request = msg.get();
-                    application.getServiceProvider().getTransactionLog()->write(*logout_event);
-                    logout_event->m_saml2Request = nullptr;
-                }
-
                 SAML2SOAPClient client(soaper, false);
                 auto_ptr_char dest(epit->getLocation());
                 client.sendSAML(msg.release(), application.getId(), mcc, dest.get());
@@ -338,12 +315,6 @@ pair<bool,long> AdminLogoutInitiator::doRequest(const Application& application,
         if (!logoutResponse) {
             if (!requestSent)
                 m_log.info("IdP (%s) doesn't support SOAP-based single logout protocol", session->getEntityID());
-
-            // Log the end result.
-            if (logout_event) {
-                logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_PARTIAL;
-                application.getServiceProvider().getTransactionLog()->write(*logout_event);
-            }
         }
         else {
             // Check the status, looking for non-success or a partial logout code.
@@ -354,13 +325,6 @@ pair<bool,long> AdminLogoutInitiator::doRequest(const Application& application,
                 partial = XMLString::equals(sc->getStatusCode()->getValue(), StatusCode::PARTIAL_LOGOUT);
             }
 
-            // Log the end result.
-            if (logout_event) {
-                logout_event->m_logoutType = partial ? LogoutEvent::LOGOUT_EVENT_PARTIAL : LogoutEvent::LOGOUT_EVENT_GLOBAL;
-                logout_event->m_saml2Response = logoutResponse;
-                application.getServiceProvider().getTransactionLog()->write(*logout_event);
-            }
-
             if (!partial) {
                 sessionLocker.assign();
                 session = nullptr;
@@ -373,17 +337,9 @@ pair<bool,long> AdminLogoutInitiator::doRequest(const Application& application,
     catch (const MetadataException& mex) {
         // Less noise for IdPs that don't support logout (i.e. most)
         m_log.info("unable to attempt SAML 2.0 logout: %s", mex.what());
-        if (logout_event) {
-            logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_PARTIAL;
-            application.getServiceProvider().getTransactionLog()->write(*logout_event);
-        }
     }
     catch (const std::exception& ex) {
         m_log.error("error issuing SAML 2.0 logout request: %s", ex.what());
-        if (logout_event) {
-            logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_PARTIAL;
-            application.getServiceProvider().getTransactionLog()->write(*logout_event);
-        }
     }
 
     if (session) {
diff --git a/shibsp/handler/impl/AssertionConsumerService.cpp b/shibsp/handler/impl/AssertionConsumerService.cpp
index 976ccc28..6c87c576 100644
--- a/shibsp/handler/impl/AssertionConsumerService.cpp
+++ b/shibsp/handler/impl/AssertionConsumerService.cpp
@@ -254,32 +254,6 @@ pair<bool,long> AssertionConsumerService::processMessage(
             ex.addProperty("RelayState", relayState.c_str());
         }
 
-        // Log the error.
-        try {
-            scoped_ptr<TransactionLog::Event> event(SPConfig::getConfig().EventManager.newPlugin(LOGIN_EVENT, nullptr, false));
-            LoginEvent* error_event = dynamic_cast<LoginEvent*>(event.get());
-            if (error_event) {
-                error_event->m_exception = &ex;
-                error_event->m_request = &httpRequest;
-                error_event->m_app = &application;
-                if (policy->getIssuerMetadata())
-                    error_event->m_peer = dynamic_cast<const EntityDescriptor*>(policy->getIssuerMetadata()->getParent());
-                auto_ptr_char prot(getProtocolFamily());
-                error_event->m_protocol = prot.get();
-                error_event->m_binding = getString("Binding").second;
-                error_event->m_saml2Response = dynamic_cast<const saml2p::StatusResponseType*>(msg.get());
-                if (!error_event->m_saml2Response)
-                    error_event->m_saml1Response = dynamic_cast<const saml1p::Response*>(msg.get());
-                application.getServiceProvider().getTransactionLog()->write(*error_event);
-            }
-            else {
-                m_log.warn("unable to audit event, log event object was of an incorrect type");
-            }
-        }
-        catch (const std::exception& ex2) {
-            m_log.warn("exception auditing event: %s", ex2.what());
-        }
-
         // If no sign of annotation, try to annotate it now.
         if (!ex.getProperty("statusCode")) {
             annotateException(&ex, policy->getIssuerMetadata(), nullptr, false);    // wait to throw it
diff --git a/shibsp/handler/impl/LocalLogoutInitiator.cpp b/shibsp/handler/impl/LocalLogoutInitiator.cpp
index 0eda6320..1d3f08ff 100644
--- a/shibsp/handler/impl/LocalLogoutInitiator.cpp
+++ b/shibsp/handler/impl/LocalLogoutInitiator.cpp
@@ -181,13 +181,6 @@ pair<bool,long> LocalLogoutInitiator::doRequest(
         bool result;
         vector<string> sessions(1, session->getID());
         result = notifyBackChannel(application, httpRequest.getRequestURL(), sessions, true);
-#ifndef SHIBSP_LITE
-        scoped_ptr<LogoutEvent> logout_event(newLogoutEvent(application, &httpRequest, session));
-        if (logout_event) {
-            logout_event->m_logoutType = result ? LogoutEvent::LOGOUT_EVENT_LOCAL : LogoutEvent::LOGOUT_EVENT_PARTIAL;
-            application.getServiceProvider().getTransactionLog()->write(*logout_event);
-        }
-#endif
         time_t revocationExp = session->getExpiration();
         locker.assign();    // unlock the session
         application.getServiceProvider().getSessionCache()->remove(application, httpRequest, &httpResponse, revocationExp);
diff --git a/shibsp/handler/impl/SAML2Consumer.cpp b/shibsp/handler/impl/SAML2Consumer.cpp
index 077d53ba..2b877492 100644
--- a/shibsp/handler/impl/SAML2Consumer.cpp
+++ b/shibsp/handler/impl/SAML2Consumer.cpp
@@ -473,29 +473,6 @@ void SAML2Consumer::implementProtocol(
         &tokens,
         ctx ? &ctx->getResolvedAttributes() : nullptr
         );
-
-    try {
-        scoped_ptr<TransactionLog::Event> event(newLoginEvent(application, httpRequest));
-        LoginEvent* login_event = dynamic_cast<LoginEvent*>(event.get());
-        if (login_event) {
-            login_event->m_sessionID = session_id.c_str();
-            login_event->m_peer = entity;
-            auto_ptr_char prot(getProtocolFamily());
-            login_event->m_protocol = prot.get();
-            login_event->m_nameID = ssoName;
-            login_event->m_saml2AuthnStatement = ssoStatement;
-            login_event->m_saml2Response = response;
-            if (ctx)
-                login_event->m_attributes = &ctx->getResolvedAttributes();
-            application.getServiceProvider().getTransactionLog()->write(*login_event);
-        }
-        else {
-            m_log.warn("unable to audit event, log event object was of an incorrect type");
-        }
-    }
-    catch (std::exception& ex) {
-        m_log.warn("exception auditing event: %s", ex.what());
-    }
 }
 
 #endif
diff --git a/shibsp/handler/impl/SAML2Logout.cpp b/shibsp/handler/impl/SAML2Logout.cpp
index 77c89572..7e40038b 100644
--- a/shibsp/handler/impl/SAML2Logout.cpp
+++ b/shibsp/handler/impl/SAML2Logout.cpp
@@ -243,10 +243,6 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
     SessionCache* cache = application.getServiceProvider().getSessionCache();
     string session_id = cache->active(application, request);
 
-    scoped_ptr<LogoutEvent> logout_event(newLogoutEvent(application, &request));
-    if (logout_event.get() && !session_id.empty())
-        logout_event->m_sessions.push_back(session_id);
-
     if (!strcmp(request.getMethod(),"GET") && request.getParameter("notifying")) {
         // This is returning from a front-channel notification, so we have to do the back-channel and then
         // respond. To do that, we need state from the original request.
@@ -295,10 +291,7 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
         auto_ptr_XMLCh reqid(request.getParameter("ID"));
         if (worked1 && worked2) {
             // Successful LogoutResponse. Has to be front-channel or we couldn't be here.
-            if (logout_event.get())
-                logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_GLOBAL;
             return sendResponse(
-                logout_event.get(),
                 reqid.get(),
                 StatusCode::SUCCESS, nullptr, nullptr,
                 request.getParameter("RelayState"),
@@ -310,7 +303,6 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
         }
 
         return sendResponse(
-            logout_event.get(),
             reqid.get(),
             StatusCode::RESPONDER, nullptr, "Unable to fully destroy principal's session.",
             request.getParameter("RelayState"),
@@ -348,14 +340,6 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
         if (!policy->isAuthenticated())
             throw SecurityPolicyException("Security of LogoutRequest not established.");
 
-        if (logout_event) {
-            logout_event->m_saml2Request = logoutRequest;
-            if (policy->getIssuerMetadata())
-                logout_event->m_peer = dynamic_cast<const EntityDescriptor*>(policy->getIssuerMetadata()->getParent());
-            application.getServiceProvider().getTransactionLog()->write(*logout_event);
-            logout_event->m_saml2Request = nullptr;
-        }
-
         // Message from IdP to logout one or more sessions.
         // Extract the NameID from the request, decrypting it if needed.
 
@@ -396,7 +380,6 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
             // No NameID, so must respond with an error.
             m_log.error("NameID not found in request");
             return sendResponse(
-                logout_event.get(),
                 logoutRequest->getID(),
                 StatusCode::REQUESTER, StatusCode::UNKNOWN_PRINCIPAL, "NameID not found in request.",
                 relayState.c_str(),
@@ -424,7 +407,6 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
             if (!XMLString::equals(logoutRequest->getReason(),LogoutRequest::REASON_ADMIN)
                     && !cache->matches(application, request, entity, *nameid, &indexes)) {
                 return sendResponse(
-                    logout_event.get(),
                     logoutRequest->getID(),
                     StatusCode::REQUESTER, StatusCode::REQUEST_DENIED, "Active session did not match logout request.",
                     relayState.c_str(),
@@ -454,13 +436,7 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
         }
         catch (const std::exception& ex) {
             m_log.error("error while logging out matching sessions: %s", ex.what());
-            if (logout_event) {
-                logout_event->m_nameID = nameid;
-                logout_event->m_sessions = sessions;
-                logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_PARTIAL;
-            }
             return sendResponse(
-                logout_event.get(),
                 logoutRequest->getID(),
                 StatusCode::RESPONDER, nullptr, ex.what(),
                 relayState.c_str(),
@@ -506,13 +482,7 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
             }
         }
 
-        if (logout_event) {
-            logout_event->m_nameID = nameid;
-            logout_event->m_sessions = sessions;
-            logout_event->m_logoutType = (worked1 && worked2) ? LogoutEvent::LOGOUT_EVENT_PARTIAL : LogoutEvent::LOGOUT_EVENT_GLOBAL;
-        }
         return sendResponse(
-            logout_event.get(),
             logoutRequest->getID(),
             (worked1 && worked2) ? StatusCode::SUCCESS : StatusCode::RESPONDER,
             (worked1 && worked2) ? nullptr : StatusCode::PARTIAL_LOGOUT,
@@ -533,23 +503,7 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
             annotateException(&ex, policy->getIssuerMetadata()); // throws it
         }
  
-        if (logout_event) {
-            logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_PARTIAL;
-            logout_event->m_saml2Response = logoutResponse;
-            if (policy->getIssuerMetadata())
-                logout_event->m_peer = dynamic_cast<const EntityDescriptor*>(policy->getIssuerMetadata()->getParent());
-        }
-
-        try {
-            checkError(logoutResponse, policy->getIssuerMetadata()); // throws if Status doesn't look good...
-        }
-        catch (const std::exception& ex) {
-            if (logout_event) {
-                logout_event->m_exception = &ex;
-                application.getServiceProvider().getTransactionLog()->write(*logout_event);
-            }
-            throw;
-        }
+        checkError(logoutResponse, policy->getIssuerMetadata()); // throws if Status doesn't look good...
 
         // If relay state is set, recover the original return URL.
         if (!relayState.empty()) {
@@ -564,11 +518,6 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
             wasPartial = true;
         }
 
-        if (logout_event) {
-            logout_event->m_logoutType = wasPartial ? LogoutEvent::LOGOUT_EVENT_PARTIAL : LogoutEvent::LOGOUT_EVENT_GLOBAL;
-            application.getServiceProvider().getTransactionLog()->write(*logout_event);
-        }
-
         if (!relayState.empty()) {
             application.limitRedirect(request, relayState.c_str());
             return make_pair(true, response.sendRedirect(relayState.c_str()));
@@ -591,7 +540,6 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, HTTPReque
 #ifndef SHIBSP_LITE
 
 pair<bool,long> SAML2Logout::sendResponse(
-    LogoutEvent* logoutEvent,
     const XMLCh* requestID,
     const XMLCh* code,
     const XMLCh* subcode,
@@ -647,12 +595,6 @@ pair<bool,long> SAML2Logout::sendResponse(
     XMLString::release(&msgid);
     logout->setIssueInstant(time(nullptr));
 
-    if (logoutEvent) {
-        logoutEvent->m_peer = role ? dynamic_cast<EntityDescriptor*>(role->getParent()) : nullptr;
-        logoutEvent->m_saml2Response = logout.get();
-        application.getServiceProvider().getTransactionLog()->write(*logoutEvent);
-    }
-
     auto_ptr_char dest(logout->getDestination());
     long ret = sendMessage(*encoder, logout.get(), relayState, dest.get(), role, application, httpResponse, "conditional");
     logout.release();  // freed by encoder
diff --git a/shibsp/handler/impl/SAML2LogoutInitiator.cpp b/shibsp/handler/impl/SAML2LogoutInitiator.cpp
index f9e81627..1f4495ec 100644
--- a/shibsp/handler/impl/SAML2LogoutInitiator.cpp
+++ b/shibsp/handler/impl/SAML2LogoutInitiator.cpp
@@ -98,15 +98,6 @@ namespace shibsp {
             const MessageEncoder* encoder=nullptr
             ) const;
 
-        LogoutEvent* newLogoutEvent(
-            const Application& application, const HTTPRequest* request=nullptr, const Session* session=nullptr
-            ) const {
-            LogoutEvent* e = LogoutHandler::newLogoutEvent(application, request, session);
-            if (e)
-                e->m_protocol = m_protocol.get();
-            return e;
-        }
-
         bool m_async;
         vector<string> m_bindings;
         map< string,boost::shared_ptr<MessageEncoder> > m_encoders;
@@ -291,19 +282,10 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
     ) const
 {
     Locker sessionLocker(session, false);
-#ifndef SHIBSP_LITE
-    scoped_ptr<LogoutEvent> logout_event(newLogoutEvent(application, &httpRequest, session));
-#endif
 
     // Do back channel notification.
     vector<string> sessions(1, session->getID());
     if (!notifyBackChannel(application, httpRequest.getRequestURL(), sessions, false)) {
-#ifndef SHIBSP_LITE
-        if (logout_event) {
-            logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_PARTIAL;
-            application.getServiceProvider().getTransactionLog()->write(*logout_event);
-        }
-#endif
         time_t revocationExp = session->getExpiration();
         sessionLocker.assign();
         session = nullptr;
@@ -366,14 +348,6 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
                         continue;
                     auto_ptr<LogoutRequest> msg(buildRequest(application, *session, *role, epit->getLocation()));
 
-                    // Log the request.
-                    if (logout_event) {
-                        logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_UNKNOWN;
-                        logout_event->m_saml2Request = msg.get();
-                        application.getServiceProvider().getTransactionLog()->write(*logout_event);
-                        logout_event->m_saml2Request = nullptr;
-                    }
-
                     SAML2SOAPClient client(soaper, false);
                     auto_ptr_char dest(epit->getLocation());
                     client.sendSAML(msg.release(), application.getId(), mcc, dest.get());
@@ -395,12 +369,6 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
                 else
                     m_log.warn("IdP didn't respond to logout request");
 
-                // Log the end result.
-                if (logout_event) {
-                    logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_PARTIAL;
-                    application.getServiceProvider().getTransactionLog()->write(*logout_event);
-                }
-
                 ret = sendLogoutPage(application, httpRequest, httpResponse, "partial");
             }
             else {
@@ -412,13 +380,6 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
                     partial = XMLString::equals(sc->getStatusCode()->getValue(), StatusCode::PARTIAL_LOGOUT);
                 }
 
-                // Log the end result.
-                if (logout_event) {
-                    logout_event->m_logoutType = partial ? LogoutEvent::LOGOUT_EVENT_PARTIAL : LogoutEvent::LOGOUT_EVENT_GLOBAL;
-                    logout_event->m_saml2Response = logoutResponse;
-                    application.getServiceProvider().getTransactionLog()->write(*logout_event);
-                }
-
                 if (partial)
                     ret = sendLogoutPage(application, httpRequest, httpResponse, "partial");
                 else {
@@ -466,13 +427,6 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
         auto_ptr<LogoutRequest> msg(buildRequest(application, *session, *role, ep->getLocation(), encoder));
         msg->setDestination(ep->getLocation());
 
-        // Log the request.
-        if (logout_event) {
-            logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_UNKNOWN;
-            logout_event->m_saml2Request = msg.get();
-            application.getServiceProvider().getTransactionLog()->write(*logout_event);
-        }
-
         auto_ptr_char dest(ep->getLocation());
         ret.second = sendMessage(*encoder, msg.get(), relayState.c_str(), dest.get(), role, application, httpResponse, "true");
         ret.first = true;
diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp
index c6d5c148..457b21d2 100644
--- a/shibsp/handler/impl/SAML2SessionInitiator.cpp
+++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp
@@ -837,17 +837,6 @@ pair<bool,long> SAML2SessionInitiator::doRequest(
     XMLString::release(&genid);
     req->setIssueInstant(time(nullptr));
 
-    scoped_ptr<AuthnRequestEvent> ar_event(newAuthnRequestEvent(app, httpRequest));
-    if (ar_event) {
-        auto_ptr_char b(ep ? ep->getBinding() : nullptr);
-        ar_event->m_binding = b.get() ? b.get() : samlconstants::SAML20_BINDING_SOAP;
-        auto_ptr_char prot(getProtocolFamily());
-        ar_event->m_protocol = prot.get();
-        ar_event->m_peer = entity.first;
-        ar_event->m_saml2Request = req.get();
-        app.getServiceProvider().getTransactionLog()->write(*ar_event);
-    }
-
     auto_ptr_char dest(ep ? ep->getLocation() : nullptr);
 
     if (httpRequest) {
diff --git a/shibsp/handler/impl/SAMLDSSessionInitiator.cpp b/shibsp/handler/impl/SAMLDSSessionInitiator.cpp
index 2b9703bb..1632a790 100644
--- a/shibsp/handler/impl/SAMLDSSessionInitiator.cpp
+++ b/shibsp/handler/impl/SAMLDSSessionInitiator.cpp
@@ -40,12 +40,6 @@ using namespace xmltooling;
 using namespace boost;
 using namespace std;
 
-#ifndef SHIBSP_LITE
-# include <saml/saml2/metadata/Metadata.h>
-# include <saml/saml2/metadata/MetadataProvider.h>
-using namespace opensaml::saml2md;
-#endif
-
 namespace shibsp {
 
 #if defined (_MSC_VER)
diff --git a/shibsp/impl/StorageServiceSessionCache.cpp b/shibsp/impl/StorageServiceSessionCache.cpp
index 9dd034d7..aa0b75f1 100644
--- a/shibsp/impl/StorageServiceSessionCache.cpp
+++ b/shibsp/impl/StorageServiceSessionCache.cpp
@@ -57,18 +57,7 @@
 #include <xercesc/util/XMLStringTokenizer.hpp>
 #include <xercesc/util/XMLUniDefs.hpp>
 
-#ifndef SHIBSP_LITE
-# include <saml/exceptions.h>
-# include <saml/SAMLConfig.h>
-# include <saml/saml2/core/Assertions.h>
-# include <saml/saml2/metadata/Metadata.h>
-# include <xmltooling/XMLToolingConfig.h>
-# include <xmltooling/util/ParserPool.h>
-# include <xmltooling/util/StorageService.h>
-using namespace opensaml::saml2md;
-#else
-# include <xercesc/util/XMLDateTime.hpp>
-#endif
+#include <xercesc/util/XMLDateTime.hpp>
 
 using namespace shibsp;
 using namespace opensaml;
@@ -305,15 +294,6 @@ bool SSCache::compareAddresses(const char* client_addr, const char* session_addr
 
 #ifndef SHIBSP_LITE
 
-void SSCache::test()
-{
-    XMLCh* wide = SAMLConfig::getConfig().generateIdentifier();
-    auto_ptr_char temp(wide);
-    XMLString::release(&wide);
-    m_storage->createString("SessionCacheTest", temp.get(), "Test", time(nullptr) + 60);
-    m_storage->deleteString("SessionCacheTest", temp.get());
-}
-
 void SSCache::insert(const char* key, time_t expires, const char* name, const char* index, short attempts)
 {
 #ifdef _DEBUG
@@ -851,28 +831,6 @@ bool SSCache::stronglyMatches(const XMLCh* idp, const XMLCh* sp, const saml2::Na
     return true;
 }
 
-LogoutEvent* SSCache::newLogoutEvent(const Application& app) const
-{
-    if (!SPConfig::getConfig().isEnabled(SPConfig::Logging))
-        return nullptr;
-    try {
-        auto_ptr<TransactionLog::Event> event(SPConfig::getConfig().EventManager.newPlugin(LOGOUT_EVENT, nullptr, false));
-        LogoutEvent* logout_event = dynamic_cast<LogoutEvent*>(event.get());
-        if (logout_event) {
-            logout_event->m_app = &app;
-            event.release();
-            return logout_event;
-        }
-        else {
-            m_log.warn("unable to audit event, log event object was of an incorrect type");
-        }
-    }
-    catch (const std::exception& ex) {
-        m_log.warn("exception auditing event: %s", ex.what());
-    }
-    return nullptr;
-}
-
 #endif
 
 HTTPResponse::samesite_t SSCache::getSameSitePolicy(const Application& app) const
@@ -998,12 +956,6 @@ Session* SSCache::_find(const Application& app, const char* key, const char* rec
 
             if (timeout && *timeout > 0 && now - lastAccess >= *timeout) {
                 m_log.info("session timed out (ID: %s)", key);
-                scoped_ptr<LogoutEvent> logout_event(newLogoutEvent(app));
-                if (logout_event.get()) {
-                    logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_INVALID;
-                    logout_event->m_sessions.push_back(key);
-                    app.getServiceProvider().getTransactionLog()->write(*logout_event);
-                }
                 remove(app, key);
                 const char* eid = obj["entity_id"].string();
                 if (!eid) {
@@ -1063,15 +1015,6 @@ Session* SSCache::_find(const Application& app, const char* key, const char* rec
         session->validate(app, client_addr, timeout);
     }
     catch (...) {
-#ifndef SHIBSP_LITE
-        scoped_ptr<LogoutEvent> logout_event(newLogoutEvent(app));
-        if (logout_event.get()) {
-            logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_INVALID;
-            logout_event->m_session = session;
-            logout_event->m_sessions.push_back(session->getID());
-            app.getServiceProvider().getTransactionLog()->write(*logout_event);
-        }
-#endif
         session->unlock();
         remove(app, key);
         throw;
@@ -1493,12 +1436,6 @@ void SSCache::receive(DDF& in, ostream& out)
 
             if (timeout > 0 && now - lastAccess >= timeout) {
                 m_log.info("session timed out (ID: %s)", key);
-                scoped_ptr<LogoutEvent> logout_event(newLogoutEvent(*app));
-                if (logout_event.get()) {
-                    logout_event->m_logoutType = LogoutEvent::LOGOUT_EVENT_INVALID;
-                    logout_event->m_sessions.push_back(key);
-                    app->getServiceProvider().getTransactionLog()->write(*logout_event);
-                }
                 remove(*app, key);
                 throw RetryableProfileException("Your session has timed out due to inactivity, and you must re-authenticate.");
             }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list