[cpp-sp] branch main updated: Implement remove operations.
Scott Cantor
cantor.2 at osu.edu
Thu May 29 17:55:29 UTC 2025
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=459006651684830ee2e3f2b12a3125981801ceff
The following commit(s) were added to refs/heads/main by this push:
new 45900665 Implement remove operations.
45900665 is described below
commit 459006651684830ee2e3f2b12a3125981801ceff
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu May 29 13:55:23 2025 -0400
Implement remove operations.
---
shibsp/session/AbstractSessionCache.h | 4 ++--
shibsp/session/impl/AbstractSessionCache.cpp | 16 ++++++++++++----
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/shibsp/session/AbstractSessionCache.h b/shibsp/session/AbstractSessionCache.h
index 79354887..55358bd2 100644
--- a/shibsp/session/AbstractSessionCache.h
+++ b/shibsp/session/AbstractSessionCache.h
@@ -91,8 +91,8 @@ namespace shibsp {
std::string create(SPRequest& request, DDF& session);
std::unique_lock<Session> find(SPRequest& request, bool checkTimeout, bool ignoreAddress);
std::unique_lock<Session> find(const char* applicationId, const char* key);
- void remove(SPRequest& request, time_t revocationExp=0);
- void remove(const char* applicationId, const char* key, time_t revocationExp=0);
+ void remove(SPRequest& request);
+ void remove(const char* key);
protected:
/**
diff --git a/shibsp/session/impl/AbstractSessionCache.cpp b/shibsp/session/impl/AbstractSessionCache.cpp
index 6b29c465..f318a770 100644
--- a/shibsp/session/impl/AbstractSessionCache.cpp
+++ b/shibsp/session/impl/AbstractSessionCache.cpp
@@ -234,7 +234,6 @@ unique_lock<Session> AbstractSessionCache::_find(
const char* applicationId, const char* key, unsigned int lifetime, unsigned int timeout, const char* client_addr
)
{
-
m_log.debug("searching local cache for session (%s)", key);
#if defined(HAVE_CXX17)
shared_lock<shared_mutex> readlocker(m_lock);
@@ -252,7 +251,7 @@ unique_lock<Session> AbstractSessionCache::_find(
if (!dynamic_cast<BasicSession*>(session.mutex())->isValid(applicationId, lifetime, timeout, client_addr)) {
session.unlock();
m_log.debug("session (%s) was found but was invalid, removing it", key);
- remove(applicationId, key);
+ remove(key);
}
return session;
}
@@ -313,12 +312,21 @@ unique_lock<Session> AbstractSessionCache::_find(
return unique_lock<Session>(*ref);
}
-void AbstractSessionCache::remove(SPRequest& request, time_t revocationExp)
+void AbstractSessionCache::remove(SPRequest& request)
{
+ const char* key = m_cookieManager->getCookieValue(request);
+ if (!key) {
+ m_log.debug("no session cookie present, no session bound to request");
+ return;
+ }
+ remove(key);
+ m_cookieManager->unsetCookie(request);
}
-void AbstractSessionCache::remove(const char* applicationId, const char* key, time_t revocationExp)
+void AbstractSessionCache::remove(const char* key)
{
+ dormant(string(key));
+ cache_remove(key);
}
void AbstractSessionCache::dormant(const string& key)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list