From 3baa38a346e16133ee4dd5ea291808a04f3a8d48 Mon Sep 17 00:00:00 2001 From: Hector Ventura Date: Tue, 20 Oct 2026 22:36:12 -0500 Subject: [PATCH] test: leave generic routes out of the credential scope coverage check (#6105) CredentialScopeCoverageTest failed wherever the botocore corpus is present: it read Account Access (account-access) as 2/3 routes served, because AppConfig and seven other services model /applications/{id} and over a hundred model /tags/{arn}. Floci does not implement Account Access. Routes that three or more signing names model are now left out of every count. Account Access drops to one route, below MIN_ROUTES. The IoT Jobs Data Plane routes, which the check exists for, are each shared with iot alone and stay in. Signed-off-by: Hector Ventura --- .../common/CredentialScopeCoverageTest.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/test/java/io/github/hectorvent/floci/core/common/CredentialScopeCoverageTest.java b/src/test/java/io/github/hectorvent/floci/core/common/CredentialScopeCoverageTest.java index 69fdacebdf..b8054dca27 100644 --- a/src/test/java/io/github/hectorvent/floci/core/common/CredentialScopeCoverageTest.java +++ b/src/test/java/io/github/hectorvent/floci/core/common/CredentialScopeCoverageTest.java @@ -56,6 +56,14 @@ class CredentialScopeCoverageTest { private static final int MIN_ROUTES = 3; /** Fraction of a service's routes Floci must already serve before its scope is expected. */ private static final double MIN_COVERAGE = 0.6; + /** + * A route this many signing names model is generic and says nothing about which of them Floci + * serves, so it is left out of every count. Without it Account Access ({@code account-access}) + * reads as 2/3 served: AppConfig and seven others model {@code /applications/{id}}, and over a + * hundred model {@code /tags/{arn}}. The IoT Jobs Data Plane's routes are each shared with + * {@code iot} alone, so they stay in. + */ + private static final int GENERIC_ROUTE_OWNERS = 3; @Inject ResolvedServiceCatalog catalog; @@ -70,10 +78,19 @@ class CredentialScopeCoverageTest { .collect(Collectors.toSet()); Set flociRoutes = flociRouteTemplates(); Map> modelled = routeTemplatesBySigningName(); + Map signingNamesPerRoute = modelled.values().stream() + .flatMap(Set::stream) + .collect(Collectors.groupingBy(route -> route, Collectors.counting())); Map undeclared = new TreeMap<>(); - modelled.forEach((signingName, routes) -> { - if (declared.contains(signingName) || routes.size() < MIN_ROUTES) { + modelled.forEach((signingName, modelledRoutes) -> { + if (declared.contains(signingName)) { + return; + } + List routes = modelledRoutes.stream() + .filter(route -> signingNamesPerRoute.get(route) < GENERIC_ROUTE_OWNERS) + .toList(); + if (routes.size() < MIN_ROUTES) { return; } long served = routes.stream().filter(flociRoutes::contains).count();