diff options
author | Rob Crittenden <rcritten@redhat.com> | 2015-04-20 16:44:41 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2015-05-11 16:47:24 -0400 |
commit | d169919a1ff5a7668c8bb23a45b59011a91132e1 (patch) | |
tree | 206545171b8863848c7bf6d8dc343de485192441 /ipsilon/providers/saml2idp.py | |
parent | acc8954e5812fa65040192e92170b05beada359f (diff) | |
download | ipsilon.git-d169919a1ff5a7668c8bb23a45b59011a91132e1.tar.gz ipsilon.git-d169919a1ff5a7668c8bb23a45b59011a91132e1.tar.xz ipsilon.git-d169919a1ff5a7668c8bb23a45b59011a91132e1.zip |
Remove expired SAML2 sessions
Run a cherrypy background task to sift through the sessions
database and find expired entries and remove them.
From my testing if a previous execution of the background task
is still executing when the next one is scheduled to run, it will
skip it. In other words, you can't end up with multiple expirations
running at the same time.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Diffstat (limited to 'ipsilon/providers/saml2idp.py')
-rw-r--r-- | ipsilon/providers/saml2idp.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ipsilon/providers/saml2idp.py b/ipsilon/providers/saml2idp.py index 6528fdf..efaf67e 100644 --- a/ipsilon/providers/saml2idp.py +++ b/ipsilon/providers/saml2idp.py @@ -8,6 +8,7 @@ from ipsilon.providers.saml2.admin import Saml2AdminPage from ipsilon.providers.saml2.rest import Saml2RestBase from ipsilon.providers.saml2.provider import IdentityProvider from ipsilon.providers.saml2.sessions import SAMLSessionFactory +from ipsilon.providers.saml2.sessions import expire_sessions from ipsilon.tools.certs import Certificate from ipsilon.tools import saml2metadata as metadata from ipsilon.tools import files @@ -280,6 +281,9 @@ Provides SAML 2.0 authentication infrastructure. """ logger.addHandler(lh) logger.setLevel(logging.DEBUG) + bt = cherrypy.process.plugins.BackgroundTask(60, expire_sessions) + bt.start() + @property def allow_self_registration(self): return self.get_config_value('allow self registration') |