From ef7584c08fa4f4fa548d76b8e98323864a587198 Mon Sep 17 00:00:00 2001 From: pastith Date: Mon, 4 May 2009 13:33:08 +0000 Subject: [PATCH] Move the time skew definition to the configuration file. --- gss/jboss/conf/gss.properties | 3 ++- gss/src/gr/ebs/gss/server/rest/RequestHandler.java | 8 +------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/gss/jboss/conf/gss.properties b/gss/jboss/conf/gss.properties index 0f7d1b7..6a19b23 100644 --- a/gss/jboss/conf/gss.properties +++ b/gss/jboss/conf/gss.properties @@ -6,7 +6,8 @@ noUsernameMessage=No username found in the Shibboleth attributes!

Your fileRepositoryPath=/tmp/gss-root #quota in bytes(10GB) quota=10737418240 - +#milliseconds a request's timestamp may differ from the current system time (10') +timeSkew=600000 solrSelectUrl=http://localhost:8983/solr/select solrUpdateUrl=http://localhost:8983/solr/update solrUpdateRichUrl=http://localhost:8983/solr/update/rich diff --git a/gss/src/gr/ebs/gss/server/rest/RequestHandler.java b/gss/src/gr/ebs/gss/server/rest/RequestHandler.java index 1cdd390..8a21fb8 100644 --- a/gss/src/gr/ebs/gss/server/rest/RequestHandler.java +++ b/gss/src/gr/ebs/gss/server/rest/RequestHandler.java @@ -161,12 +161,6 @@ public class RequestHandler extends Webdav { private static final String HMAC_SHA1 = "HmacSHA1"; /** - * The amount of milliseconds a request's timestamp may differ - * from the current system time. - */ - private static final int TIME_SKEW = 600000; - - /** * The serial version UID of the class. */ private static final long serialVersionUID = 1L; @@ -695,7 +689,7 @@ public class RequestHandler extends Webdav { if (logger.isDebugEnabled()) logger.debug("Time: server=" + cal.getTimeInMillis() + ", client=" + timestamp); // Ignore the request if the timestamp is too far off. - if (Math.abs(timestamp - cal.getTimeInMillis()) > TIME_SKEW) + if (Math.abs(timestamp - cal.getTimeInMillis()) > getConfiguration().getInt("timeSkew", 600000)) return false; return true; } -- 1.7.10.4