mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
chore(ci): gate hand-built ARN concatenation, probes and splits (#6482)
The partition-literal gate only saw ARNs that name a partition. Code that
builds, checks or cuts an ARN by hand names none, so it passed the gate while
bypassing the helpers that get every partition right, and the number of
startsWith("arn:") probes grew from 84 to 98 in two weeks.
Three code-scope categories join the per-file baseline:
- arn-concat: "arn:" + ..., except a pattern built from PARTITION_REGEX
- arn-probe: startsWith("arn:")
- arn-split: split(":") on a value named like an ARN
The baseline starts with today's 159 sites, so new ones fail and migrating
existing ones to AwsArnUtils shrinks it. AwsArnUtils's own formatter and
parser carry partition-literal escapes. PartitionSmokeInventoryTest also
counts a concatenated ARN as minting, and AGENTS.md names the categories.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
1 parent
4f9866418f
commit
e5d93dba5e
6 files changed
+195
-6
No files matched your search
@@ -51,7 +51,7 @@ public final class AwsArnUtils {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "arn:" + partition + ":" + service + ":" + region + ":" + accountId + ":" + resource;
|
||||
return "arn:" + partition + ":" + service + ":" + region + ":" + accountId + ":" + resource; // partition-literal: the one ARN formatter
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public final class AwsArnUtils {
|
||||
if (arn == null || arn.isBlank()) {
|
||||
throw new IllegalArgumentException("ARN must not be null or blank");
|
||||
}
|
||||
String[] parts = arn.split(":", 6);
|
||||
String[] parts = arn.split(":", 6); // partition-literal: the one ARN parser
|
||||
if (parts.length < 6 || !"arn".equals(parts[0])) {
|
||||
throw new IllegalArgumentException("Invalid ARN: " + arn);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user