Move the time skew definition to the configuration file.
authorpastith <devnull@localhost>
Mon, 4 May 2009 13:33:08 +0000 (13:33 +0000)
committerpastith <devnull@localhost>
Mon, 4 May 2009 13:33:08 +0000 (13:33 +0000)
gss/jboss/conf/gss.properties
gss/src/gr/ebs/gss/server/rest/RequestHandler.java

index 0f7d1b7..6a19b23 100644 (file)
@@ -6,7 +6,8 @@ noUsernameMessage=<B>No username found in the Shibboleth attributes!</B><P>Your
 fileRepositoryPath=/tmp/gss-root
 #quota in bytes(10GB)
 quota=10737418240
 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
 solrSelectUrl=http://localhost:8983/solr/select
 solrUpdateUrl=http://localhost:8983/solr/update
 solrUpdateRichUrl=http://localhost:8983/solr/update/rich
index 1cdd390..8a21fb8 100644 (file)
@@ -161,12 +161,6 @@ public class RequestHandler extends Webdav {
        private static final String HMAC_SHA1 = "HmacSHA1";
 
        /**
        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;
         * 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 (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;
        }
                        return false;
                return true;
        }