Add a timeout to SLO requests

This commit is contained in:
Valentin Samir 2015-12-13 13:50:01 +01:00
parent bfad265299
commit cd4b9846cd
3 changed files with 4 additions and 0 deletions

View File

@ -99,6 +99,7 @@ Authentication settings:
* ``CAS_SLO_MAX_PARALLEL_REQUESTS``: Maximum number of parallel single log out requests send. * ``CAS_SLO_MAX_PARALLEL_REQUESTS``: Maximum number of parallel single log out requests send.
If more requests need to be send, there are queued. The default is ``10``. If more requests need to be send, there are queued. The default is ``10``.
* ``CAS_SLO_TIMEOUT``: Timeout for a single SLO request in seconds. The default is ``5``.
Tickets validity settings: Tickets validity settings:

View File

@ -59,6 +59,8 @@ setting_default('CAS_PROXY_GRANTING_TICKET_IOU_PREFIX', 'PGTIOU')
# Maximum number of parallel single log out requests send # Maximum number of parallel single log out requests send
# if more requests need to be send, there are queued # if more requests need to be send, there are queued
setting_default('CAS_SLO_MAX_PARALLEL_REQUESTS', 10) setting_default('CAS_SLO_MAX_PARALLEL_REQUESTS', 10)
# SLO request timeout.
setting_default('CAS_SLO_TIMEOUT', 5)
setting_default('CAS_SQL_HOST', 'localhost') setting_default('CAS_SQL_HOST', 'localhost')
setting_default('CAS_SQL_USERNAME', '') setting_default('CAS_SQL_USERNAME', '')

View File

@ -405,6 +405,7 @@ class Ticket(models.Model):
session.post( session.post(
url.encode('utf-8'), url.encode('utf-8'),
data={'logoutRequest': xml.encode('utf-8')}, data={'logoutRequest': xml.encode('utf-8')},
timeout=settings.CAS_SLO_TIMEOUT
) )
) )
except Exception as error: except Exception as error: