Commit cd4b9846 authored by Valentin Samir's avatar Valentin Samir

Add a timeout to SLO requests

parent bfad2652
...@@ -99,6 +99,7 @@ Authentication settings: ...@@ -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:
......
...@@ -59,6 +59,8 @@ setting_default('CAS_PROXY_GRANTING_TICKET_IOU_PREFIX', 'PGTIOU') ...@@ -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', '')
......
...@@ -405,6 +405,7 @@ class Ticket(models.Model): ...@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment