[java-idp-oidc] branch master updated: Increased expiration time of the JWK sets to 5 seconds.

Henri Mikkonen henri.mikkonen at iki.fi
Fri Feb 7 08:00:58 EST 2020


This is an automated email from the git hooks/post-receive script.

hjmikkon pushed a commit to branch master
in repository java-idp-oidc.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-oidc.git;a=commit;h=e4073ad528477d3029a8eb69406ba7436b6ae164

The following commit(s) were added to refs/heads/master by this push:
       new  e4073ad   Increased expiration time of the JWK sets to 5 seconds.
e4073ad is described below

commit e4073ad528477d3029a8eb69406ba7436b6ae164
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Feb 7 14:59:22 2020 +0200

    Increased expiration time of the JWK sets to 5 seconds.
    
    The existing value (100 ms) was unnecessary short and causing
    false unit test failures when tests were running slowly.
---
 .../oidc/metadata/resolver/RemoteJwkSetCacheTest.java             | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/idp-oidc-extension-api/src/test/java/org/geant/idpextension/oidc/metadata/resolver/RemoteJwkSetCacheTest.java b/idp-oidc-extension-api/src/test/java/org/geant/idpextension/oidc/metadata/resolver/RemoteJwkSetCacheTest.java
index 1e4ae0a..439761f 100644
--- a/idp-oidc-extension-api/src/test/java/org/geant/idpextension/oidc/metadata/resolver/RemoteJwkSetCacheTest.java
+++ b/idp-oidc-extension-api/src/test/java/org/geant/idpextension/oidc/metadata/resolver/RemoteJwkSetCacheTest.java
@@ -84,12 +84,12 @@ public class RemoteJwkSetCacheTest {
         jwkSetCache.initialize();
         final String uri = "http://example.org";
         System.out.println(new URI(uri).toString());
-        JWKSet jwkSet = jwkSetCache.fetch(new URI(uri), Instant.now().plusMillis(100));
+        JWKSet jwkSet = jwkSetCache.fetch(new URI(uri), Instant.now().plusSeconds(5));
         Assert.assertNotNull(jwkSet);
         Assert.assertNotNull(jwkSetCache.getStorage().read(RemoteJwkSetCache.CONTEXT_NAME, uri));
-        jwkSet = jwkSetCache.fetch(new URI(uri), Instant.now().plusMillis(100));
+        jwkSet = jwkSetCache.fetch(new URI(uri), Instant.now().plusSeconds(5));
         Assert.assertNotNull(jwkSet);
-        Thread.sleep(101);
+        Thread.sleep(5001);
         Assert.assertNull(storageService.read(RemoteJwkSetCache.CONTEXT_NAME, uri));
     }
 
@@ -99,7 +99,7 @@ public class RemoteJwkSetCacheTest {
         jwkSetCache.setStorage(storageService);
         jwkSetCache.setHttpClient(createMockHttpClient("not_jwk_set"));
         jwkSetCache.initialize();
-        final JWKSet jwkSet = jwkSetCache.fetch(new URI("http://example.org"), Instant.ofEpochMilli(100));
+        final JWKSet jwkSet = jwkSetCache.fetch(new URI("http://example.org"), Instant.now().plusSeconds(5));
         Assert.assertNull(jwkSet);
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list