@Test(expected = RequestTimeTooSkewedException.class) public void testAssertDateNotSkewedForPastDate() throws Throwable { S3Authentication.assertDateNotSkewed(DateTime.now().minusMinutes(17).toDate()); fail("Date should have been expired"); }
static void assertDateNotSkewed(final Date date) throws RequestTimeTooSkewedException { DateTime currentTime = DateTime.now(); DateTime dt = new DateTime(date); if (dt.isBefore(currentTime.minusMillis((int) ObjectStorageProperties.EXPIRATION_LIMIT))) throw new RequestTimeTooSkewedException(); if (dt.isAfter(currentTime.plusMillis((int) ObjectStorageProperties.EXPIRATION_LIMIT))) throw new RequestTimeTooSkewedException(); }
S3Authentication { static void assertDateNotSkewed(final Date date) throws RequestTimeTooSkewedException { DateTime currentTime = DateTime.now(); DateTime dt = new DateTime(date); if (dt.isBefore(currentTime.minusMillis((int) ObjectStorageProperties.EXPIRATION_LIMIT))) throw new RequestTimeTooSkewedException(); if (dt.isAfter(currentTime.plusMillis((int) ObjectStorageProperties.EXPIRATION_LIMIT))) throw new RequestTimeTooSkewedException(); } }
S3Authentication { static void assertDateNotSkewed(final Date date) throws RequestTimeTooSkewedException { DateTime currentTime = DateTime.now(); DateTime dt = new DateTime(date); if (dt.isBefore(currentTime.minusMillis((int) ObjectStorageProperties.EXPIRATION_LIMIT))) throw new RequestTimeTooSkewedException(); if (dt.isAfter(currentTime.plusMillis((int) ObjectStorageProperties.EXPIRATION_LIMIT))) throw new RequestTimeTooSkewedException(); } private  S3Authentication(); }
S3Authentication { static void assertDateNotSkewed(final Date date) throws RequestTimeTooSkewedException { DateTime currentTime = DateTime.now(); DateTime dt = new DateTime(date); if (dt.isBefore(currentTime.minusMillis((int) ObjectStorageProperties.EXPIRATION_LIMIT))) throw new RequestTimeTooSkewedException(); if (dt.isAfter(currentTime.plusMillis((int) ObjectStorageProperties.EXPIRATION_LIMIT))) throw new RequestTimeTooSkewedException(); } private  S3Authentication(); static void authenticateV4Streaming(MappingHttpRequest request, List<AwsChunk> chunks); }
S3Authentication { static void assertDateNotSkewed(final Date date) throws RequestTimeTooSkewedException { DateTime currentTime = DateTime.now(); DateTime dt = new DateTime(date); if (dt.isBefore(currentTime.minusMillis((int) ObjectStorageProperties.EXPIRATION_LIMIT))) throw new RequestTimeTooSkewedException(); if (dt.isAfter(currentTime.plusMillis((int) ObjectStorageProperties.EXPIRATION_LIMIT))) throw new RequestTimeTooSkewedException(); } private  S3Authentication(); static void authenticateV4Streaming(MappingHttpRequest request, List<AwsChunk> chunks);  }