Frank Kobzik has uploaded a new change for review.

Change subject: core: add time tolerance to websocket proxy
......................................................................

core: add time tolerance to websocket proxy

This small patch adds 5 second tolerance to the past in
ovirt-websocket-proxy. This is to prevent really small time drifts
between clocks of the engine and the machine where the proxy is deployed
in situations when the proxy clock is ahead of the engine clock (and
therefore the ticket is not yet valid from the proxy POV).

Change-Id: I811f6c3c4413576c1dc8d209408767367b3687ad
Signed-off-by: Frantisek Kobzik <[email protected]>
Bug-Url: https://bugzilla.redhat.com/1052921
---
M packaging/services/ovirt-websocket-proxy/ovirt-websocket-proxy.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/43/27643/1

diff --git a/packaging/services/ovirt-websocket-proxy/ovirt-websocket-proxy.py 
b/packaging/services/ovirt-websocket-proxy/ovirt-websocket-proxy.py
index 8f3f4a5..34baec3 100755
--- a/packaging/services/ovirt-websocket-proxy/ovirt-websocket-proxy.py
+++ b/packaging/services/ovirt-websocket-proxy/ovirt-websocket-proxy.py
@@ -89,7 +89,7 @@
         if (
             datetime.datetime.utcnow() -
             datetime.datetime.strptime(decoded['validFrom'], '%Y%m%d%H%M%S')
-        ) < datetime.timedelta():
+        ) < datetime.timedelta(seconds=-5):  # tolerance to the past
             raise ValueError('Ticket life time expired')
         if (
             datetime.datetime.strptime(decoded['validTo'], '%Y%m%d%H%M%S') -


-- 
To view, visit http://gerrit.ovirt.org/27643
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I811f6c3c4413576c1dc8d209408767367b3687ad
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to