[java-oidfed-common] branch main updated: Exploit the new clearAll() method in previously disabled trust anchor tests.
Codeberg
noreply at shibboleth.net
Mon Sep 28 12:22:50 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-oidfed-common.
View the commit online:
https://codeberg.org/Shibboleth/java-oidfed-common/commit/085e893384d26cfafa68882ef96e42c4bc228099
The following commit(s) were added to refs/heads/main by this push:
new 085e893 Exploit the new clearAll() method in previously disabled trust anchor tests.
085e893 is described below
commit 085e893384d26cfafa68882ef96e42c4bc228099
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Mon Sep 28 15:21:47 2026 +0300
Exploit the new clearAll() method in previously disabled trust anchor tests.
https://shibboleth.atlassian.net/browse/JCOMOIDC-154
---
.../flow/cache/TrustChainMetadataCacheTest.java | 27 ++++++++++++++++------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/oidfed-common-conf-impl/src/test/java/net/shibboleth/oidfed/flow/cache/TrustChainMetadataCacheTest.java b/oidfed-common-conf-impl/src/test/java/net/shibboleth/oidfed/flow/cache/TrustChainMetadataCacheTest.java
index 9657164..379b7c2 100644
--- a/oidfed-common-conf-impl/src/test/java/net/shibboleth/oidfed/flow/cache/TrustChainMetadataCacheTest.java
+++ b/oidfed-common-conf-impl/src/test/java/net/shibboleth/oidfed/flow/cache/TrustChainMetadataCacheTest.java
@@ -38,6 +38,8 @@ import net.shibboleth.oidfed.flow.EntityConfigurationFlowTest;
import net.shibboleth.oidfed.metadata.cache.IssuerEntityIDCriterion;
import net.shibboleth.oidfed.metadata.cache.ResponseContainerExpirationCriterion;
import net.shibboleth.oidfed.metadata.cache.SubjectEntityIDCriterion;
+import net.shibboleth.oidfed.metadata.cache.configuration.EntityConfigurationContainer;
+import net.shibboleth.oidfed.metadata.cache.subordinate.SubordinateStatementContainer;
import net.shibboleth.oidfed.metadata.cache.trustchain.TrustChainsContainer;
import net.shibboleth.oidfed.testing.FederationJwtSupport;
import net.shibboleth.shared.resolver.CriteriaSet;
@@ -56,6 +58,14 @@ public class TrustChainMetadataCacheTest extends AbstractFederationFlowTest {
@Qualifier("shibboleth.oidfed.TrustChainMetadataCache")
MetadataCache<TrustChainsContainer> trustChainCache;
+ @Autowired
+ @Qualifier("shibboleth.oidfed.EntityConfigurationMetadataCache")
+ MetadataCache<EntityConfigurationContainer> entityConfigurationCache;
+
+ @Autowired
+ @Qualifier("shibboleth.oidfed.SubordinateEntityStatementMetadataCache")
+ MetadataCache<SubordinateStatementContainer> subordinateStatementCache;
+
@Test
public void testValidTrustChainResolved()
throws MetadataCacheException, UnsupportedOperationException, IOException, URISyntaxException {
@@ -97,9 +107,7 @@ public class TrustChainMetadataCacheTest extends AbstractFederationFlowTest {
}
}
- @Test(enabled = false)
- //TODO: enable once the entity configuration cache can be cleaned before/after the test
- //otherwise the non-compatible trust anchor configuration may be in the cache
+ @Test
public void testTrustAnchorConfigurationSignatureWithUntrustedKey()
throws MetadataCacheException, UnsupportedOperationException, IOException, URISyntaxException {
final String entityId = uniqueClientId();
@@ -128,6 +136,8 @@ public class TrustChainMetadataCacheTest extends AbstractFederationFlowTest {
mapResponse(subordinateStatementUrl(anchorFetchEndpoint, entityId),
mockResponse(subordinateStatement));
try {
+ entityConfigurationCache.clearAll();
+ subordinateStatementCache.clearAll();
final List<TrustChainsContainer> result =
trustChainCache.get(new CriteriaSet(new SubjectEntityIDCriterion(entityId),
new ResponseContainerExpirationCriterion(Instant.now().plusSeconds(300)),
@@ -136,14 +146,14 @@ public class TrustChainMetadataCacheTest extends AbstractFederationFlowTest {
Assert.assertEquals(result.size(), 1);
Assert.assertNotNull(result.get(0).getTrustChains());
Assert.assertEquals(result.get(0).getTrustChains().size(), 0);
+ entityConfigurationCache.clearAll();
+ subordinateStatementCache.clearAll();
} catch (MetadataCacheException e) {
Assert.fail("Could not resolve entity configuration", e);
}
}
- @Test(enabled = false)
- //TODO: enable once the trust anchor cache can be cleaned before/after the test
- //otherwise the non-compatible trust anchor configuration may be in the cache
+ @Test
public void testTrustAnchorSubordinateSignatureWithUntrustedKey()
throws MetadataCacheException, UnsupportedOperationException, IOException, URISyntaxException {
final String entityId = uniqueClientId();
@@ -173,6 +183,8 @@ public class TrustChainMetadataCacheTest extends AbstractFederationFlowTest {
mapResponse(subordinateStatementUrl(anchorFetchEndpoint, entityId),
mockResponse(subordinateStatement));
try {
+ entityConfigurationCache.clearAll();
+ subordinateStatementCache.clearAll();
final List<TrustChainsContainer> result =
trustChainCache.get(new CriteriaSet(new SubjectEntityIDCriterion(entityId),
new ResponseContainerExpirationCriterion(Instant.now().plusSeconds(300)),
@@ -181,6 +193,8 @@ public class TrustChainMetadataCacheTest extends AbstractFederationFlowTest {
Assert.assertEquals(result.size(), 1);
Assert.assertNotNull(result.get(0).getTrustChains());
Assert.assertEquals(result.get(0).getTrustChains().size(), 0);
+ entityConfigurationCache.clearAll();
+ subordinateStatementCache.clearAll();
} catch (MetadataCacheException e) {
Assert.fail("Could not resolve entity configuration", e);
}
@@ -270,5 +284,4 @@ public class TrustChainMetadataCacheTest extends AbstractFederationFlowTest {
Assert.fail("Could not resolve entity configuration", e);
}
}
-
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list