Commit Graph
173 Commits
Author SHA1 Message Date
Hector Ventura 9dcb1b65ae feat(core): translate LocalStack variables in Java instead of the entrypoint (#5851)
* feat(core): translate LocalStack variables in Java instead of the entrypoint

The LocalStack-to-Floci variable mapping (PERSISTENCE, EDGE_PORT,
LOCALSTACK_HOST, GATEWAY_LISTEN, LS_LOG/DEBUG, the Lambda and Docker
variables, the DNS suffixes, USE_SSL, CUSTOM_SSL_CERT_PATH) lived in
docker/localstack-parity.sh, sourced by the image's entrypoint. A JVM run or
a native binary on the host never saw it.

LocalStackParity now computes the same mapping and LocalStackParityConfigSource
serves it at ordinal 301, just above environment variables, as the exported
variables did. A key is produced only when its Floci variable is unset, so an
explicit Floci setting still wins; the DNS suffixes are still appended to any
configured ones; LOCALSTACK_PARITY=false still turns it all off.
TlsConfigSource, which reads its properties before the configuration exists,
consults the mapping too.

The script, its shell test and every Dockerfile copy of it are removed; the
test cases move to LocalStackParityTest.

Refs #5767

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(core): keep TLS backends on loopback, keep configured DNS suffixes, and pass LocalStack settings to hooks

Review follow-ups for the Java LocalStack translation:

- Dockerfile.compat took docker-entrypoint.sh from the published native
  image, which still sourced the removed localstack-parity.sh, so the compat
  image never became healthy. It now copies the entrypoint from the build
  context, as it already does healthcheck.sh.
- At ordinal 301 the parity source outranked TlsConfigSource's loopback pin
  (300): with TLS on and GATEWAY_LISTEN set, the backends bound the gateway
  address while the proxy dialled 127.0.0.1. It now sits at 299, below
  environment variables and the TLS source and above .env and
  config/application.yml, where the exported variables used to be.
- floci.dns.extra-suffixes is no longer a translated property, which on JVM
  and native runs replaced suffixes set in application.yml. The five
  readers append LocalStack's and Floci's suffixes to the configured list
  through LocalStackParity.withDnsSuffixes instead.
- GATEWAY_LISTEN=0.0.0.0:4566 (or [::]:4566, or a list) gives the host to
  quarkus.http.host and the port to floci.port when EDGE_PORT is unset,
  instead of a host Floci rejects as malformed.
- Init hooks get the translation as FLOCI_*/QUARKUS_* variables again, as
  they did when the entrypoint exported them.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(core): parse LOCALSTACK_HOST and GATEWAY_LISTEN the way LocalStack does

Both take LocalStack's host-and-port forms (HostAndPort.parse in its
config.py): host:port, host, :port, [v6]:port and [v6].

- LOCALSTACK_HOST is <hostname>:<port>, localhost.localstack.cloud:4566 by
  default. Its port went into floci.hostname, so the base URL came out as
  http://localhost.localstack.cloud:4566:4566. floci.hostname now gets the
  host alone.
- GATEWAY_LISTEN=:4566, LocalStack's default host on 4566, did not match
  and stopped startup with "Refusing to listen on malformed host". An empty
  host now keeps Floci's own bind address and takes just the port.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-17 17:37:15 -04:00
Andre Kurait 720f95bebe fix(ci): retain Docker fixture sockets and bound result uploads (#5877)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-17 14:09:42 -04:00
Hector Ventura 5370920012 chore(release): publish standalone floci-aws binaries as release assets (#5844)
* chore(release): publish standalone floci-aws binaries as release assets

The release already built Linux native executables, but only to package them
into the images; they were discarded after a day and releases carried no
assets. Users without Docker had nothing to download.

release.yml now also builds macOS (arm64, and x86_64 under Rosetta) and Windows
x86_64 binaries with GraalVM Community, smoke-tests every binary on its own
runner with .github/scripts/smoke-binary.sh (version matches the tag, SQS and
DynamoDB round trips, clean stop on SIGTERM), and checks that the Linux amd64
binary still starts on glibc 2.34 (Ubuntu 22.04). A new publish-binaries job,
the only one with write access to the release, stages the six executables as
floci-aws-<os>-<arch>, writes sha256sums.txt, signs every file with keyless
cosign sign-blob, attests build provenance, and uploads them to the release
semantic-release created. Build artifacts are kept 7 days so that job can be
re-run on its own.

make native-install now installs floci-aws, since floci is the CLI.

Refs #5767

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(release): check the glibc 2.34 floor on every Linux binary and wait for the release

Review follow-ups for the binary release jobs:

- The floor check started the amd64 binary on Ubuntu 22.04, whose glibc is
  2.35, so a binary that needed 2.35 would have passed. check-glibc-floor.sh
  now reads the newest GLIBC_ symbol version the binary requires with
  readelf and fails above 2.34, then starts it in UBI 9, whose glibc is 2.34.
- The two arm64 builds had no floor check at all; they run the same script.
- publish-binaries waits up to 10 minutes for semantic-release to create the
  GitHub Release before uploading, instead of failing if it is not there yet.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(release): build darwin-amd64 with a pinned, checksummed GraalVM Community

The macOS x86_64 job downloaded Oracle GraalVM from download.oracle.com's
"latest" URL: not the Community build the job's comment names, unpinned and
unchecked, though its output is then signed and attested as ours. It now
fetches GraalVM Community 25.0.1, the last release with a macOS x64 build,
from graalvm-ce-builds and checks it against the published SHA-256 before
extracting it.

The publish-binaries header said semantic-release creates the release
before pushing the tag; it pushes the tag first, as the upload step says.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-17 12:36:20 -04:00
TATSUNO “Taz” Yasuhiro 6e01216f88 feat(lambdaweb): serve endpoint domains from a Node.js environment per revision (#5760)
* feat(lambdaweb): serve endpoint domains from a Node.js environment per revision

A request whose Host is an endpoint's domainName goes over HTTP/1.1 to
a container that Floci starts from the revision's S3 code on the first
request: public.ecr.aws/lambda/nodejs:24 with the code in /var/task,
index.js or AWS_LAMBDA_NODEJS_ENTRYPOINT as the entry file, the node
flags and the environment variables AWS sets, ten seconds to listen,
SIGTERM and one second when idle, and a fresh environment after the
process exits between requests.

The forwarded request carries the headers AWS adds and loses the ones
AWS drops. The response carries lambda-web-request-id and
lambda-web-logstream and streams as the app writes it. Two revisions in
revisionWeights split the traffic by weight. The platform pages for an
unsupported method, an unknown domain, HTTP/1.0, a server that does not
listen, a timeout, a crash and a disabled endpoint are the AWS pages.

Part of #5699

* fix(lambdaweb): index endpoint domains and claim only the minted host shapes

A request looked its domain up by scanning every stored function across
accounts and iterating live endpoint maps outside the function lock. The
service now keeps a domain index, filled from storage at start and kept
by the create and delete paths, and copies the function under its lock.
The data plane claims only hosts shaped like the domains Floci mints, in
any case and with any port, so a dotted S3 bucket with a lambda-web
label still reaches S3.

* fix(lambdaweb): reserve environments against the idle reaper and track exits

acquire now reserves the environment under the same lock the idle
reaper takes, so a request cannot start on a container the reaper is
about to stop. Docker faults in the reaper and in discard are contained
so one error does not end the periodic run or skip the removal. The exit
watcher records the exit time and arms itself again when its stream
drops, and a request that found a dead process is replayed only when
that recorded exit came first, never because the container is gone. The
unpacked code directory is removed on every path. The container gets the
execution role's session credentials when the role exists, and the
function account's credentials otherwise, as the Lambda launcher does.

* fix(lambdaweb): bound the whole exchange by timeoutSeconds and forward chunked bodies

timeoutSeconds is a deadline on the whole request, as recorded against
AWS: a response that has not started by then is the 504 page, one that
is still streaming is cut, and a slow upload gets its 504 once the body
is in, since the edge takes the body before it answers. A body without a
Content-Length is sent chunked instead of carrying the client's
Transfer-Encoding header. A failure of the upload stream ends the
exchange and releases the environment once.

* test(compat): probe the unknown Lambda Web domain in the shape Floci mints

The data plane claims only hosts shaped like the domains it mints, so
the unknown-domain check needs a 16 character id to reach it.
2026-10-15 22:50:05 -05:00
Hector Ventura 1ec4f957af ci: drop the em-dashes from the release-cut concurrency comment (#5704)
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-14 23:36:17 -05:00
Hector Ventura cb58b12b41 ci: cut a release at 00:30 Central on the 15th and last day of the month (#5698)
Schedule release-cut.yml at 00:30 on the 15th and on days 28-31 with timezone America/Chicago, so GitHub handles DST. A gate job passes only on the 15th or on the actual last day of the month; manual dispatch is unchanged. The release-cut concurrency group moves to the release job so skipped scheduled runs never hold or replace a pending cut.

README.md, CONTRIBUTING.md and the docs/ pages now describe the new train: stable releases on the 15th and the last day of each month, cut automatically at 00:30 US Central time.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-14 23:29:36 -05:00
dependabot[bot] ad68ae3248 chore(deps): bump the actions-minor-patch group with 3 updates (#5682)
Bumps the actions-minor-patch group with 3 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/download-artifact](https://github.com/actions/download-artifact) and [actions/setup-node](https://github.com/actions/setup-node).


Updates `actions/upload-artifact` from 7.0.1 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9)

Updates `actions/download-artifact` from 8.0.1 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333)

Updates `actions/setup-node` from 7.0.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/820762786026740c76f36085b0efc47a31fe5020...949feb2413d6458794dcd2491c4babbbce0c15c1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: actions/setup-node
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-14 18:31:52 -05:00
Hector Ventura 7f0da8ba2b chore(deps): bump Quarkus to 3.40.1 and the native-safe minor and patch updates (#5617)
Takes the updates from the Dependabot group in #5335 that do not break
the native image:

- quarkus-bom and quarkus-maven-plugin 3.39.2 to 3.40.1
- jackson-bom 2.22.2 to 2.22.3
- h2 and h2-mvstore 2.4.240 to 2.5.252
- bcprov-jdk18on 1.85.2 and bcpkix-jdk18on 1.85 to 1.86
- neo4j-java-driver 6.2.1 to 6.3.0
- checkstyle 14.1.0 to 14.3.0
- Maven 3.9.16 to 3.10.0 in the wrapper properties

and holds back three, each now ignored in dependabot.yml so the group
stops proposing them:

- proto-google-common-protos stays at 2.49.0. This is what failed the
  native build on #5335: from 2.65.0 on the artifact is generated for
  protobuf-java 4 and its classes need com.google.protobuf.GeneratedFile,
  which the pinned protobuf-java 3.25.9 does not have, so initializing
  apicurio's FileDescriptorUtils at image build time ends in a
  NoClassDefFoundError.
- httpcore5 and httpcore5-h2 stay at 5.3.6, and httpclient5 at 5.5.1.
  Both pins are deliberate and explained in pom.xml: httpcore5 5.4 breaks
  every Docker call in the native image, and httpclient5 5.6 needs
  org.tukaani:xz at native link time.

The mvnw and mvnw.cmd scripts are left as they are: regenerating them
drops the check from #4751 that refuses the unverifiable .tar.gz fallback
when a distribution checksum is set.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-14 18:54:40 -04:00
Hector Ventura d3999ad416 chore(compat): run the partition nightly in GovCloud and EUSC too (#5616)
The partition compatibility nightly ran the Java SDK suite in cn-north-1
only. GovCloud (IAM signs us-gov-west-1, no CloudFront) and EUSC (no
global endpoints) take their own code paths and had no end-to-end check.
The job is now a matrix of cn-north-1, us-gov-west-1 and eusc-de-east-1;
a dispatch that names a region runs that region alone.

Measured locally on main 367ae0b2d with a JVM image: a us-east-1 control
run and one run per new region, 2461 tests each. Beyond the control
run's one failure, GovCloud showed one and EUSC four, all in tests that
assumed the commercial partition, so they are fixed here and both new
allowlists start empty:

- WafV2Test.cloudfrontScopeIsolated created a CLOUDFRONT-scope IP set,
  which Floci refuses where CloudFront does not exist. It now runs only
  in the partitions that have CloudFront.
- S3Test built its LocationConstraint through the SDK enum, which has no
  value for eusc-de-east-1 and is then sent as the literal "null". It
  passes the region id as a string.

The workflow checks the suite out at the commit the nightly image was
built from, so the new legs first run with these fixes on the nightly
after this lands.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-13 23:58:24 -04:00
Priamo Germosen eba058266b fix(iam): authorize an operation as the action AWS checks for it (#5604)
Under enforcement a request naming its operation, in a Query Action or an
X-Amz-Target header, was authorized as <namespace>:<Operation>, the operation's
own name. AWS authorizes some operations as an action of another name: SQS
SendMessageBatch, DeleteMessageBatch and ChangeMessageVisibilityBatch as
sqs:SendMessage, sqs:DeleteMessage and sqs:ChangeMessageVisibility, and SNS
PublishBatch as sns:Publish. None of the batch names is an IAM action, so a policy
AWS honours for a batch call was denied, and a policy naming the batch operation
granted something AWS does not check.

AWS publishes the mapping in the Operations of each Service Reference file.
tools/aws/regen_iam_authorized_actions.py vendors the operations authorized by
exactly one action of their own namespace under another name, 235 over 33
namespaces, into src/main/resources/aws/iam-authorized-actions.json. Everything else
keeps its own name. The generator leaves out operations that list:
- several actions, whose extras apply only when tags or a role are passed;
- no action, which is missing data;
- an action of another namespace;
- another action while one of the operation's own name exists;
- a tagging action alone;
- the same action for several SDK clients, which AWS can authorize differently,
  as S3 and S3 Control's GetPublicAccessBlock;
or whose name is listed again with another answer. A record of the wrong shape
fails the run instead of being skipped.
make iam-authorized-actions-check gates the file's shape on pull requests that touch it, and
iam-authorized-actions-verify, run by the IAM Data Drift workflow, checks every
entry against AWS.

IamAuthorizedActions reads the file through the new core.common
VendoredResources, rather than adding one more copy of the read-or-fail block a
dozen catalogs carry, and the Query and X-Amz-Target paths ask it for the action.
DynamoDB TransactGetItems, which AWS authorizes as dynamodb:GetItem, keeps its own
name: the transaction check recognizes the call by it and checks every Get as
dynamodb:GetItem on its own table, with its own dynamodb:LeadingKeys. Renamed, the
call would skip that check and be authorized as one GetItem whose body has no
top-level Key, which a ForAllValues condition accepts, so a fine-grained policy
would grant every key.

The check for operations AWS serves without credentials reads the Query action
directly, rather than through resolve with a placeholder scope, now that resolve
returns the authorized action. A Query request naming no action is not one of them.

An SDK compatibility test covers SendMessageBatch and PublishBatch, granted by
the single-item action and refused under the batch name, with enforcement on.
2026-10-13 22:29:06 -05:00
Priamo Germosen d884d55c26 fix(iam): evaluate every IAM action against the resource it acts on (#5404)
Under enforcement, almost every IAM action reached the policy evaluator with
* as its resource, because ResourceArnBuilder named only the server-certificate
operations and everything else fell through to the wildcard. A statement naming
an IAM resource was therefore ignored, and wrongly in both directions, because
the evaluator globs the statement's pattern against the request's resource and
a resource of * is matched as that literal string. So a Deny on
arn:aws:iam::000000000000:user/bob did not stop DeleteUser for bob, while an
Allow scoped to that same user did not permit DeleteUser on anyone at all: a
least-privilege policy naming the resource it meant to grant refused the call.
Measured both ways by reverting this resolver to the wildcard, which turns the
permitted call in aResourceScopedAllowGrantsThatUserOnly into a 403 and the
refused call in aDenyNamingOneUserLeavesTheOthersAlone into a 200. Nothing
failed and nothing warned, which is the dangerous shape for an emulator people
test policies against.

The resource type each action is evaluated against now comes from AWS's own
authorization metadata for IAM, action by action. That is not the parameter an
action happens to take: AddUserToGroup and RemoveUserFromGroup are evaluated
against the group, AddRoleToInstanceProfile and RemoveRoleFromInstanceProfile
against the instance profile, and EnableMFADevice, DeactivateMFADevice and
ResyncMFADevice against the user rather than the device they name. Mapping those
from the request's parameters would have scoped them to the wrong resource and
let a deny on the right one pass.

An action acting on a resource that exists is checked against that resource's
stored ARN. The reference gives the formats as user/${UserNameWithPath},
group/${GroupNameWithPath} and so on, so the path is part of the ARN a policy
names, and only the store knows it; the stored ARN also carries the partition
the resource was created in, which re-minting from the caller's signing region
would get wrong. A create has nothing stored, so its ARN is minted from the
request's own Path: reading a stored path there would authorize a create into
/team/ against the root path.

A policy, MFA device, SAML provider, OIDC provider or principal is named by an
ARN the request already carries, so that is passed through rather than rebuilt
from parts. Only an ARN is: a hardware MFA device's SerialNumber is a bare
serial, and naming the request after it would produce a resource no policy could
be written against.

That table is read before the one keyed by resource type, so an action in both
would silently take its ARN parameter and the mistake would look like a resource
that never matches rather than like a bug. An attach is the case that makes it
worth pinning down: it carries both a user and a policy ARN, and the reference
gives it the user alone, so it stays out of that table and
iamNamesTheUserRatherThanThePolicyOnAnAttach is what holds it there.

UpdateUser and UpdateGroup join UpdateServerCertificate in naming both the old
resource and the one the request would produce. Both are documented, which the
certificate case was not: UpdateUser's reference says the requester "must have
appropriate permissions on both the source object and the target object", and
UpdateGroup's that a principal allowed to update the old group but not the new
one has the update fail.

Two actions name their role indirectly and are derived rather than looked up.
CreateServiceLinkedRole does not name the role it creates, so the check reads
the same ServiceLinkedRoles table the create reads and cannot name a different
role. GetServiceLinkedRoleDeletionStatus carries only a DeletionTaskId, and its
reference publishes that identifier's format as
task/aws-service-role/<service-principal-name>/<role-name>/<task-uuid>, which is
the role's own path and name with a prefix in front and a uuid behind; the role
is already deleted by the time the status is asked for, so there is no stored ARN
left to read either way. The /aws-service-role/ path moved to that class, so there is one copy of
it rather than a second in the builder. GetAccessKeyLastUsed names only a key,
and is evaluated against a user: the User Guide's own iam:*AccessKey* example
scopes exactly that set to user/${aws:username}, so the owner is resolved from
the key.

That covers all 130 of the IAM actions this emulator dispatches that AWS gives a
resource type, out of 164 in total. The remaining 34 have no resource type in the
reference, such as ListUsers, GetAccountSummary and SimulateCustomPolicy, so *
is the right answer for them. An action that names its target only by defaulting
to the calling user, such as GetUser or ChangePassword with no UserName, is
resolved from the credential instead, which the last paragraph here sets out.

Nine enforcement tests drive the whole path rather than the ARN the builder
returns, since the defect was invisible: a scoped statement was ignored, not
rejected. They cover a deny that must bind to one user and leave another alone,
the stored path being part of the ARN, the group and the instance profile being
the resource where two entities are named, a managed policy named by ARN, a
create authorized against the path it asks for, a rename refused on its
destination alone, and a scoped Allow granting one user only. Reverting the
mapping to the wildcard fails all nine.

The map is vendored rather than written out here, because a hand-written copy of
AWS's metadata is exactly what tools/aws exists to prevent.
regen_iam_action_resources.py generates src/main/resources/aws/iam-action-resources.json
from the same reference, 190 actions with the resource types each is authorized
against plus the ARN format of all 15 resource types, and it gates the file the
way regen_service_namespaces.py gates the namespace list: --check offline for
shape, --verify online against AWS. A type the file claims and AWS does not fails,
since that would authorize against a resource AWS does not use, which is the one
outcome worse than the wildcard. A type or an action AWS has added is reported
without failing, because being behind leaves that action on * and failing there
would break this build for someone else's launch. make
iam-action-resources-check runs per pull request beside the namespace check, and
make iam-action-resources-verify weekly in the drift workflow. Its unit tests need
no step of their own: make aws-data-test in that same job already runs every
generator's.

So no list of actions is written down here. What stays in code is the half that is
Floci's rather than AWS's: the parameter each resource type arrives in, the nine
creates and the name each spells, the actions whose request carries an ARN, the
three resolved from something other than a name, and the three resource types
that belong only to actions the handler does not dispatch. IamActionResourcesTest
checks the code against the data: every resource type AWS uses must be resolved
or declared unresolved, every create must have exactly one type to mint, and
every minted prefix must match the ARN format AWS publishes for that type. A
regeneration that brings in a new resource type then fails a test naming the
type, rather than quietly putting that action back on *, which is the permissive
answer and a silent one. The create check reads the resolver's own map rather
than restating it, so a create added there is checked too, and the minting falls
back to the wildcard instead of indexing an empty list: a create AWS authorizes
against no single type has no ARN to build, and a request should not fail on
what is a defect in this class.

The reason each declared-unresolved type gives is a claim about the handler, not
about the builder, so nothing inside the builder can check it, and getting it
wrong is silent and fail-open: dispatching such an action without teaching the
resolver its type leaves it evaluated against *, which is the gap this closes.
UnresolvedResourceTypesIntegrationTest therefore sends every action carrying one
of those types and holds it to answering UnsupportedOperation, naming the action
and what to do if it no longer does. No other vendored-data loader validates at class init
either, so the checks read the data the way AwsPartitions and
AwsServiceNamespaces do: parse, and let the gate and the tests have the opinion.

The nineteen user actions whose UserName the model marks optional act on the
user who signed the request, so that user is the resource they resolve to. The
access key id in the credential names the identity, which is the same lookup
GetAccessKeyLastUsed already makes on a key passed as a parameter, and the
stored ARN carries the path and partition as everywhere else here. The wildcard
still stands when the signer is not an IAM user, an account's root stand-in and
a session credential having no user record to name.

What stays at the wildcard is what AWS gives no resource type, 34 of the 164.

Closes #4979

The online gate verifies the ARN formats as well as the action mapping. A format
drifts invisibly otherwise: the offline check only asks whether it still looks
like an IAM ARN, and a changed one does, while the minting reads that string to
place the resource type. So a right-looking file could build a wrong ARN.

The resource types this class covers are worked out from its own tables rather
than restated in the test, so a type cannot be waved through by adding it to a
list in the test file. That is the check the earlier startup guard made.

The three actions whose resource the request carries in some other form hold
their own resolver, rather than being listed in one place and routed by name in
another. A list cannot then say an action is handled while the dispatch has
nothing for it, since adding a key means supplying the resolver that goes with
it.

The enforcement suite removes what it creates. The emulator is shared, so a user,
group, role, profile, policy or provider left behind turns up in the next class
to list one, and the shared fixture helper grew the prerequisites IAM enforces
before a delete: group memberships and attached policies for a user, inline and
managed policies for a role and a group. A rename leaves its destination name
behind rather than the name that was created, and the create test goes through
the enforced path, so both register their own removal.

The drift workflow stays one check, and make iam-data-verify is what keeps that
honest. Two sequential steps stop at the first failure: while the namespace list
was stale, the action resource check this change adds never ran at all, so the
gate arrived unexercised in CI. The target runs both regardless of the first
result and then fails, naming the file that drifted rather than leaving a reader
to guess from one message. The workflow file is renamed to match what it covers,
and the IAM targets it uses join .PHONY, which they should have done when they
were added.

That namespace check was red because AWS retired evidently and iotevents, and
the vendored list still claimed both. Regenerating it drops those two, picks up
end-user-messaging and startups, and leaves the count at 456. A retired
namespace only narrows wildcard expansion; a policy naming one literally is
still reported, since a namespace written out is kept whether or not the catalog
knows it.
2026-10-11 09:12:29 -05:00
Hector Ventura 379086f818 ci: let a running main CI run finish instead of cancelling it (#5396)
* ci: let a running main CI run finish instead of cancelling it

A CI run takes about 18 minutes and merges often land closer together
than that, so cancel-in-progress on refs/heads/main stopped runs partway
through: from 2026-10-05 to 2026-10-09, 77 of 138 CI runs on main were
cancelled, leaving most main commits without a result and a break
pointing at the wrong commit.

Cancel only on pull requests. On main the concurrency group still holds
one pending run that a newer merge replaces before it starts, so a burst
of merges is tested once, at its newest commit, and no run stops halfway.

Refs #5085

* ci: stop cancelling main runs in the other workflows that run on pushes to main

Checkstyle, Docs in sync and Partition Literals run on pull requests and
on pushes to main, so they get the same rule as ci.yml: cancel a superseded
run only on pull requests. The docs deploy never runs on pull requests, so
it stops cancelling altogether.

The remaining workflows named in #5085 (compatibility, compat-partitions,
iam-namespace-drift, nightly) have no push trigger, so a merge to main
never cancels them and they are left as they are.

Refs #5085

* ci: state the measured cancellation figures in the ci.yml comment

The comment quoted one-day figures (30 of 47 runs, a 13 minute median gap, 546 runner-minutes) that the run history does not reproduce. Replace them with the count measured from it: 77 of 138 CI runs on main cancelled from 2026-10-05 to 2026-10-09.

Refs #5085

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-11 00:06:59 -05:00
Hector Ventura c6068e8cf5 chore(iam): generate the managed-policy catalog from iam-dataset (#5403)
* chore(iam): generate the managed-policy catalog from iam-dataset

The three managed-policy resources were hand-seeded in #2194, #3237 and #3275,
so nothing noticed when AWS added or revised a policy. tools/aws/
regen_managed_policies.py now rebuilds them from the local/aws/iam-dataset
checkout: names, paths, versions and update dates from
aws/managed_policies.json, documents from aws/managedpolicies/. Deprecated
policies leave the catalog except AWSLambdaFullAccess, which #2194 kept on
purpose. createDate (from the AWS managed policy reference pages) and the
curated descriptions are not in the dataset and are carried over.

It joins make aws-data-sync and aws-data-check. CI has no iam-dataset, so
there the check verifies the three files agree and keep their shape, the way
regen_region_facts.py handles its missing corpus.

This commit changes no data; only the catalog header gains a generated-by
line. The files were taken from three dataset days, and the generator
reproduces each from its own: the names from 2026-08-12 (f18cb038), the
versions from 2026-09-08 (a52abe16), and the documents from 2026-09-08 too,
except AWSCodeStarServiceRole, which matches 2026-09-07 (1c729479).

* chore(iam): refresh the managed-policy catalog from iam-dataset 2026-09-19

make aws-data-sync against the local/aws/iam-dataset checkout (72d2a4f62,
2026-09-19). Catalog 1566 -> 1578 policies:

- 12 added: AIDevOpsChannelAccessPolicy, AIDevOpsReleaseManagementVPCPolicy,
  AWSWellArchitectedAgentOrganizationsServiceRolePolicy,
  AmazonBioDiscoveryFullAccess, AmazonBioDiscoveryInAppFullAccess,
  AmazonODBAutonomousDatabaseAdmin, AmazonODBExadataVmClusterAdmin,
  AmazonODBExascaleStorageVaultAdmin, AmazonODBExascaleVmClusterAdmin,
  AmazonSageMakerHyperPodInferenceGatewayAccess, AssuranceServiceRolePolicy,
  NetworkSecurityManagerServiceRolePolicy. All are on v1, so their
  createDate is the dataset's date.
- 0 removed.
- 22 changed: 21 moved to a new default version with a new document and
  update date (among them ReadOnlyAccess and SecurityAudit), and
  AWSCodeStarServiceRole kept v12 but took the document and update date
  the dataset recorded on 2026-09-08.

No path or description changed, and the service-linked role table still
matches the documents (make slr-check).

* chore(iam): make the managed-policy generator's date fetch and offline check stricter

--fetch-create-dates now reads the reference page of every policy past v1
that has no creation date, not only of policies new to the catalog, so a
policy first vendored without the flag can be dated by a later run. A page
that cannot be read leaves that one policy undated with a warning instead
of ending the run with nothing written.

The offline check compares the catalog with a re-render of its parsed
entries, so content outside the generated header and policy entries fails
it instead of passing unnoticed.

* chore(iam): refresh the managed-policy catalog from iam-dataset 2026-10-09

The dataset moved after the first refresh. Regenerated against 2244bd78a
(2026-10-09) with --fetch-create-dates. Catalog 1578 -> 1586 policies:

- 11 added. Ten are on v1 and take the dataset's date;
  AWSCloudWatchOmniServiceRolePolicy is on v2 and takes its creation date
  from its reference page.
- 3 removed: the CloudWatch Evidently policies, which the dataset now
  marks deprecated.
- 45 moved to a new default version, among them SecurityAudit (v94) and
  ReadOnlyAccess (v190).

The generated header said createDate falls back to the dataset's date for
a policy with no reference page. It does so only for a policy that entered
the catalog on v1; one past v1 stays undated, and the header now says so.
AWSConfigRole is still the only policy without a creation date.
2026-10-10 13:40:04 -04:00
TATSUNO “Taz” Yasuhiro e4278a800c chore(style): Enforce no-FQCN rule on new files, existing bad files later (#5094)
* chore: flag unnecessary fully qualified type names with Checkstyle

Use the built-in UnnecessaryFullyQualifiedType check. It allows a
qualified name when another type with the same simple name is used in
the same file.

The 379 files that have such names today are listed in
suppressions.xml, so only new files are checked for now. Remove an
entry once its file is clean.

* docs: drop the written no-FQCN rule now that Checkstyle checks it

* docs: keep the written no-FQCN rule for files Checkstyle still skips

The baselined files are not checked, and the comment that names a clash
is not something the check can enforce.
2026-10-10 09:22:14 -05:00
Niels Kootstra 546d7e894e ci: abort hung tests with a thread dump and time out a stuck surefire fork (#4940)
* ci: abort hung tests with a thread dump and time out a stuck surefire fork

A hung test ran until the 20-minute job limit killed the shard, leaving no surefire report that named it.

Give every test and lifecycle method a 2-minute JUnit default with a thread dump, set through surefire configurationParameters so quarkus-junit's own junit-platform.properties (its profile-aware class orderer) is not shadowed. In CI, -Dsurefire.timeout=900 kills a fork whose test ignores the interrupt (deadlock, blocking I/O) before the job limit; shards' test steps take 10-11 minutes. SageMakerDockerIntegrationTest waits up to 150 s for real containers, so it gets a 3-minute timeout.

* test: give two Docker-backed tests a timeout that covers their own waits

EksRegistryHostsDockerIntegrationTest (three 60 s cluster-ready waits plus 105 s of polling) and TimestreamInfluxDbDockerIntegrationTest (three 180 s status waits) can legitimately run past the new 2-minute default.

* ci: size the fork timeout to the slowest shard and cover the remaining long tests

surefire.timeout caps a whole shard, and shard 2 already spends 903 s running tests, so 900 s would kill a passing run. Raise it to 1200 s and the job limit to 25 minutes so surefire still reports first. Give the Timestream test headroom beyond its 540 s of status waits, and the opt-in GPU SageMaker test a timeout covering its 300 s poll.
2026-10-10 09:22:05 -05:00
dependabot[bot] 2444c52811 build(deps): bump graalvm/setup-graalvm (#5336)
Bumps the actions-minor-patch group with 1 update: [graalvm/setup-graalvm](https://github.com/graalvm/setup-graalvm).


Updates `graalvm/setup-graalvm` from 1.6.6 to 1.6.7
- [Release notes](https://github.com/graalvm/setup-graalvm/releases)
- [Commits](https://github.com/graalvm/setup-graalvm/compare/0426e2e191540e8514dff98dc52a5f5146a2a276...27b360dbb857524eaf0b4c4cef364d38e5b4f173)

---
updated-dependencies:
- dependency-name: graalvm/setup-graalvm
  dependency-version: 1.6.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-08 23:14:18 -05:00
Hector Ventura 408cd8feac chore(deps): let Dependabot move the botocore pin behind the AWS data (#5295)
src/main/resources/aws/*.json is generated from the botocore version
pinned in tools/aws/requirements.txt, and nothing moved that pin, so a
region, partition or service AWS added later was never flagged. A
monthly Dependabot pip update, allowed for botocore only, now proposes
the bump; its PR runs the Partition Literals workflow, whose
aws-data-check fails when the new release changes the vendored data,
and the comment in dependabot.yml says how to regenerate it.
2026-10-08 23:37:02 -04:00
dependabot[bot] 52985a2f19 build(deps): bump the actions-minor-patch group with 8 updates (#4867)
Bumps the actions-minor-patch group with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [graalvm/setup-graalvm](https://github.com/graalvm/setup-graalvm) | `1.6.4` | `1.6.6` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.0` | `7.0.1` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `8.0.0` | `8.0.1` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `4.3.0` | `4.4.1` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `7.3.0` | `7.4.0` |
| [actions/setup-java](https://github.com/actions/setup-java) | `6.0.0` | `6.0.1` |
| [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) | `6.2.3` | `6.3.0` |
| [aws-actions/amazon-ecr-login](https://github.com/aws-actions/amazon-ecr-login) | `2.0.1` | `2.1.7` |


Updates `graalvm/setup-graalvm` from 1.6.4 to 1.6.6
- [Release notes](https://github.com/graalvm/setup-graalvm/releases)
- [Commits](https://github.com/graalvm/setup-graalvm/compare/5298d94fb55a4f185c602eeac5de1b553882abe2...0426e2e191540e8514dff98dc52a5f5146a2a276)

Updates `actions/upload-artifact` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v7...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a)

Updates `actions/download-artifact` from 8.0.0 to 8.0.1
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v8...3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c)

Updates `docker/setup-buildx-action` from 4.3.0 to 4.4.1
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/37fe631027851001ddb9b187196cc803df7f5f0e...f87e5991a6d7451dcb8d9637bfbc97413f497069)

Updates `docker/build-push-action` from 7.3.0 to 7.4.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/53b7df96c91f9c12dcc8a07bcb9ccacbed38856a...c3c9e263c25d99ce0380d002d59b67737d91b0dc)

Updates `actions/setup-java` from 6.0.0 to 6.0.1
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/dd06d9cba3e5552c54d9f8ea23572deb30010f7c...de7274f081f381c8f8158605e0321c36c376e2e6)

Updates `aws-actions/configure-aws-credentials` from 6.2.3 to 6.3.0
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/e6de054238d6b7531b4efff3b6587d9aade6a06c...e1253824e5c10ff9df46874f81ed3ec929e19cfd)

Updates `aws-actions/amazon-ecr-login` from 2.0.1 to 2.1.7
- [Release notes](https://github.com/aws-actions/amazon-ecr-login/releases)
- [Changelog](https://github.com/aws-actions/amazon-ecr-login/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/amazon-ecr-login/compare/062b18b96a7aff071d4dc91bc00c4c1a7945b076...03f1aad4c6c7ffd436567f42f9384779290529bd)

---
updated-dependencies:
- dependency-name: graalvm/setup-graalvm
  dependency-version: 1.6.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: actions/download-artifact
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
- dependency-name: docker/build-push-action
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
- dependency-name: actions/setup-java
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor-patch
- dependency-name: aws-actions/configure-aws-credentials
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
- dependency-name: aws-actions/amazon-ecr-login
  dependency-version: 2.1.7
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-08 22:18:24 -05:00
David Phillips da6a7dd085 build: enforce Java import order with Checkstyle (#5326)
* style: align Java imports with project guidelines

* build: enforce consistent Java import order

* style: follow IntelliJ import order
2026-10-08 20:50:53 -04:00
Vũ Thế Huy dc41417e79 fix(ec2): avoid Docker waits on the first CreateVpc (#5179)
* fix: avoid Docker waits on first EC2 CreateVpc

* fix(ec2): reseed default VPC resources after a state reset

Ec2Service now implements Resettable: clear() forgets the seeded account
scopes and seeds the default region again, so a reset followed by
DescribeVpcs still returns the default VPC and subnets.

Also run Ec2CreateVpcLatencyTest in the non-mock EC2 compatibility job,
where VPC planning is active and a regression of the first-call Docker
wait would be caught.

* refactor(ec2): share one default-region seeding method between startup and reset

Ec2Startup and Ec2Service.clear() repeated the same enabled check and seed call. Both now go through Ec2Service.seedDefaultRegionIfEnabled() so they cannot drift apart. Also reorder the Resettable import.
2026-10-08 19:25:31 -04:00
Priamo Germosen df4fa58ea1 fix(iam): take service-linked role names and suffix support from AWS evidence (#5293)
CreateServiceLinkedRole guessed both things it cannot derive. The role name came
from capitalising the principal, which is wrong for 141 of the 162 services the
table covers: acm.amazonaws.com is AWSServiceRoleForCertificateManager on AWS and
was AWSServiceRoleForAcm here. And a CustomSuffix was accepted for every service,
where AWS refuses one for 68 of the 71 it has been recorded against, so the
emulator minted roles AWS would have rejected outright.

Both now come from iam/service-linked-roles.tsv, generated by
tools/slr/service_linked_roles.py and gated by make slr-check. One table, because
both facts come out of one pass over the same AWS-validated snapshot: the name
from a recorded create response, the suffix verdict from the test's own
parameterisation. Writing either by hand only captures what someone noticed, and
every finding behind this change came from grepping.

Sources, each row recording its own: recording, actual create responses and the only
source that can establish suffix support; policy-documents, role ARNs in the vendored
AWS managed policies, names only; and docs, from AWS's own service-linked role
pages, quoted and linked in the generator. Counts live in the table's header, where
this script keeps them right.

Two shapes in the policy documents have to be refused rather than read, and both
were being read. A name followed by `*` is a prefix pattern: the policy writes
AWSServiceRoleForAmazonCognitoIdpEmail* where the recorded create returns
AWSServiceRoleForAmazonCognitoIdpEmailService, so reading the prefix invents a role
AWS never mints. Twenty-one principals rested on nothing but such a prefix. And a
role name is unique per account, which these documents ignore: they point
maintenance.elasticbeanstalk at the parent's AWSServiceRoleForElasticBeanstalk, so
taking that at face value made the sibling's create fail as a duplicate of a role
it does not own. A collision guard drops the weaker row back to the derived
fallback and says so; an unresolvable collision is an error for a human.

KNOWN_SOURCE_CONFLICTS is empty as a result. Its one entry was never a
disagreement between sources, only that truncated prefix read as a name. The
mechanism stays for a real one.

make slr-check runs offline: policy-documents rows must still match the vendored
JSON, every vendored service must be in the table, it must be sorted, and a suffix
verdict on a non-recording row is an error because nothing but a recording can
establish one. Three extraction traps have a test each, all three being ones the
real data walked into: an underscore can be part of a name, so splitting on the
CustomSuffix separator truncates ApplicationAutoScaling_CassandraTable; a policy
matching suffixed roles writes the prefix with a trailing separator; and a
wildcard ARN names a role without saying which principal mints it, which is how an
earlier pass handed plain GuardDuty the MalwareProtection role's name.

The name was not only wrong against AWS, it was inconsistent within the tree.
ConnectService built an ARN for AWSServiceRoleForAmazonConnect while
CreateServiceLinkedRole minted AWSServiceRoleForConnect for the same principal:
two roles for one purpose. GuardDutyService, MacieController and RamController
each hard-coded their own name too, and all four were right where IamService was
wrong. They read the table now, and a test fails if a principal any of them builds
an ARN for loses its row, since the fallback would quietly derive a name again.

ApplicationAutoScalingService was wrong a different way. It maps a namespace to a
dimension itself, and had no arm for appstream, cassandra, ec2 or sagemaker, so
all four fell to CustomResource where AWS names them AppStreamFleet,
CassandraTable, EC2SpotFleetRequest and SageMakerEndpoint. It prefers the table
now and keeps its switch for the namespaces nothing records, where the shape is
right even when the dimension is a guess. Its dynamodb arm is gone with the rest:
the table covers that namespace, so the arm was unreachable and a second copy of a
fact the table owns, free to disagree with it while never running. A test pins
dynamodb resolving through the table, since removing the arm is what left nothing
else covering it.

Two behaviour changes worth calling out. rds.amazonaws.com is AWSServiceRoleForRDS
rather than the derived Rds, which flipped one existing expectation. And two table
names are long enough that a suffix alone breaches the 64-character RoleName
limit, ApplicationDiscoveryService's ContinuousExport role leaving three
characters and SageMakerEndpoint six, so that check now reports "The role name"
rather than "The derived role name", which stopped being true.

cloud9 is in the table because deleting IamService's three-entry override map
dropped it: autoscaling and ram were covered, cloud9 was not, and it regressed to
the derived AWSServiceRoleForCloud9. Two tests caught it. Rather than restore the
literal, which is the circular sourcing this work exists to remove, its User Guide
settles it and the row carries that citation.

The table is registered in quarkus.native.resources.includes rather than exempted
from it. AwsManagedPolicies is exempt because parsing its 3.5 MB at image build time
and keeping the result in the heap beats shipping the source twice; at 13 KB that
saving is not worth depending on the static initialiser running at build time, and
NativeImageResourceIncludesTest is the thing that says so.

The header records the sha256 of the snapshot the recording rows came from, because
that half cannot be rechecked offline and --check can only say so rather than fix
it. A digest makes the next --refresh a diff against a known source: an unchanged
digest means any difference in the table came from the vendored policy documents,
and a changed one says the recordings moved with it. --check cannot verify the
digest without the snapshot, but it does reject a table that has quietly lost the
line, or one claiming no snapshot while carrying recording rows.

Refs #5084
2026-10-08 07:49:50 -05:00
Hector Ventura d1fc2654a9 ci: cap open PRs at 4 with drafts and 2 ready for review (#5283)
Describe the new open-PR limits (floci-loft decision 0021) in CONTRIBUTING.md
and the PR template, and grant the caller contents: write, which the shared
workflow needs to convert a PR back to a draft.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-07 17:49:31 -05:00
Hector Ventura 6d417e522f fix(ci): pass VERSION to the nightly native image build (#5165)
The native nightly step built docker/Dockerfile.native-package without the VERSION build argument, so FLOCI_VERSION fell back to latest and a nightly reported itself as latest on the health endpoint. The compat step and release.yml already pass it.
2026-10-05 23:56:39 -05:00
Hector Ventura fde5170335 test(compat): take the partition and region from TestFixtures in the last 33 suites (#5052)
Third and last batch of the cn-north-1 allowlist burn-down (#4272). The 41
remaining entries all pinned commercial values: ARNs built as
arn:aws:<svc>:us-east-1:..., arn:aws: prefix assertions, us-east-1 zones,
hosts and filter strings, and clients or signers created for us-east-1
next to the cn-north-1 fixture clients. Among them, the RDS IAM-token tests
signed their tokens for us-east-1, OrganizationsTest built its invited
account's client for us-east-1, Route53Test associated VPCs as us-east-1
that live in the fixture region, and SesEventPublishingTest failed in setup
on a us-east-1 event bus ARN.

All 33 classes now derive those values from TestFixtures, so the allowlist
is empty: any failure in the China nightly fails the run.
2026-10-03 23:46:21 -04:00
Hector Ventura 6deb0d4d2b test(compat): run the China-absent tests per partition instead of allowlisting them (#5027)
* test(compat): run the China-absent tests per partition instead of allowlisting them

Third batch of the cn-north-1 allowlist burn-down (#4272): the 13 tests that
exercised something AWS does not offer in China. Seven keep running there
with the China shape:

- S3Test: only the us-east-1 endpoint creates a bucket in another region, so
  elsewhere the location-constraint round trip names the client's own region.
- StsTest: the SAML assertion's Recipient is the partition's console sign-on
  URL (the CDK region facts), signin.amazonaws.cn in China.
- Ec2Tests: China names its interface endpoint services cn.com.amazonaws, so
  the S3 gateway and interface offerings are two services there.
- IamTest: GetAccountSummary reports GlobalEndpointTokenVersion only in the
  commercial partition, the one with a global STS endpoint.

Six skip where the service has no endpoint: the five Marketplace tests (the
regions botocore publishes for each) and Lightsail (commercial only).

The allowlist's China-absent section is gone, 13 entries, 73 to 60.

* test(compat): derive VPC endpoint names from the DNS suffix and keep Marketplace guards to us-east-1

The ECR interface service is named under the partition's DNS suffix reversed
in every China, EUSC and ISO region (eu.amazonaws, gov.ic.c2s, ...), not only
in China, so describeVpcEndpointServices now takes that prefix from the SDK's
partition metadata. S3 keeps the China-only split, the only regions where
AWS lists it.

Floci serves Marketplace Agreement and Entitlement only in us-east-1, so
their guards no longer admit the other regions AWS runs them in; widening
both is a separate change.
2026-10-03 17:53:57 -04:00
Hector Ventura dfe2117fed test(compat): take the partition and region from TestFixtures in five more suites (#5025)
Second batch of the cn-north-1 allowlist burn-down (#4272). These tests pinned
the commercial partition, so they failed against a China deployment for the
test's own reasons, not Floci's:

- AppSyncTest asserted the arn:aws:appsync: prefix on four ARNs.
- Ec2DescribeSpotPriceHistoryTest filtered on us-east-1a and us-east-1b.
- PipesTest built its role, SQS and Kinesis ARNs in arn:aws and us-east-1.
- IamTest looked its user up by an arn:aws ARN; its AWS managed-policy prefix
  and the SimulatePrincipalPolicy source now follow the partition too.
- CloudWatchLogsMetricFilterTest replaced the recorded @aws.region dimension
  with us-east-1, and MetricFilterQueryAssertions signed its Query request for
  us-east-1, so it read another region's metrics.

All now derive the partition and region from TestFixtures. The allowlist drops
19 entries, from 73 to 54.
2026-10-03 15:54:55 -04:00
Hector Ventura fa30cd7834 test(compat): take the partition and region from TestFixtures in SES and SSO Admin tests (#5017)
* test(compat): take the partition and region from TestFixtures in SES and SSO Admin tests

The cn-north-1 nightly allowlists 25 cases in SesTagResourceTest,
SsoAdminAccountAssignmentTest and SesConfigurationSetEventDestinationTest
that fail only because the tests pin commercial values: ARNs built as
arn:aws:<svc>:us-east-1:..., the arn:aws: AWS-owned SSO application
provider and managed policies, and a us-east-1 primaryRegion. Floci answers
correctly in China.

TestFixtures gains region(), partition() (from the SDK's region metadata)
and arn()/globalArn() builders, and the three classes use them. The
rejected-bus cases move from @CsvSource, which only takes constants, to a
@MethodSource whose mismatched-region bus is another region of the fixture
partition. The 25 entries leave the allowlist (98 to 73). Part of BL-020.

* test(compat): keep the SES bus rejection cases running in a single-region partition

Greptile on #5017: the method source threw when the fixture partition has no
second region (aws-eusc and aws-iso-e list one), so the custom-bus and
mismatched-account cases, which need no second region, never ran there. The
other region is now optional: the two cases always run, and only the
mismatched-region case is left out of a single-region partition.
2026-10-03 14:12:29 -04:00
Hector Ventura c800cc375e test(compat): keep the China nightly allowlist free of an order-dependent entry (#4891)
The first Partition Compatibility run (36963820252) went red on one stale
entry: SsoAdminAccountAssignmentTest#createInstanceQuotaUsesAwsSdk passed. It
only fails when OrganizationsTest#testFullLifecycle leaves its organization
behind, which made the caller the management account for every later test,
and that happened because the organization's own assertions, including the
arn:aws: one that fails in cn-north-1, ran before the try whose finally
deletes it.

The assertions now run inside the try, so the organization is deleted however
they end, and the stale entry is gone from the cn-north-1 allowlist. Part of
#4272.
2026-10-02 09:28:41 -04:00
Hector Ventura d72923ab33 fix(core): compare ARN partitions with the resource's region, not the literal aws (#4791)
* fix(core): compare ARN partitions with the resource's region, not the literal aws

Part of #4272 (P10b). Running the Java SDK suite against a Floci deployed in
cn-north-1 (#4790) found five checks comparing a parsed ARN with "aws" and a
seeded ARN fixed to the commercial partition:

- RdsService.hasRdsResourceIdentity required partition aws, so DB instances,
  clusters, DB and cluster snapshots and subnet groups created outside aws
  failed their own ownership check and were not found right after creation.
  The proxy target group check had the same comparison, and CopyDBSnapshot
  refused any source ARN outside aws; it now requires the target region's
  partition, since a snapshot copies within its partition.
- ElastiCache ListTagsForResource rejected every arn:aws-cn: ARN; it now
  expects the request region's partition and names it in the message.
- RAM ignored organization principals outside aws; any published partition is
  accepted, the organization id ties the principal to the caller's.
- The seeded IAM Identity Center instance was arn:aws:sso:::instance/... in
  every deployment, so China permission sets never found it. It now takes the
  partition of the deployment's home region, and AddRegion compares against
  the instance's own primary region instead of a fixed us-east-1.

* fix(sso): move a persisted bootstrap instance to its partition, and drop the fixed China allowlist entries

Greptile on #4791: a deployment persisted before the seeded instance took its
partition keeps it as arn:aws:sso:::instance/..., while its permission sets were
already minted in the instance's own partition, so the fix would not reach it.
ensureBootstrapInstance now rewrites a stored bootstrap instance whose ARN is
not in its primary region's partition.

pgermosen on #4791: with #4790 on main, the cn-north-1 allowlist entries this
fixes would turn stale and fail the nightly. Measured against this branch in
cn-north-1: CloudFormationRdsDynamicReferenceTest, the ten RdsControlPlaneTest
entries, RdsJdbcCompatTest#createDbInstanceAndConnectWithPassword and
SsoPortalTest now pass and are deleted. The four IAM-token connection tests
still fail because they sign their tokens for a pinned us-east-1, which a
cn-north-1 database rightly refuses; they move to the group of tests that pin
commercial values.

* fix(ram): answer the listing operations for the request's region only

Greptile on #4791: with organization principals accepted in every partition,
a commercial GetResourceShares from a member of the organization returned a
China share. The cause predates this PR: GetResourceShares, ListResources,
ListPrincipals and GetResourceShareInvitations walked every stored share, so
a share created in eu-west-1 was listed through us-east-1 too, while a
resource share is a regional resource. RamController now passes the request
region and the four operations keep only shares (and invitations to shares)
in it, which also keeps a share out of another partition.

* fix(ram): resolve a share or invitation to mutate in the request's region only

pgermosen on #4791: after the listings were scoped to the request's region,
findOwnedShare still walked every stored share, so a share invisible to
GetResourceShares in one region could still be deleted, updated, associated,
disassociated or retagged from there; AssociateResourceShare would add a
resource the same endpoint's ListResources does not report. Accept and
RejectResourceShareInvitation had the same gap.

The six share mutations and the two invitation responses now take the request
region from RamController and resolve only a share or invitation in it: one
from another region gets UnknownResourceException or
ResourceShareInvitationArnNotFoundException, like an ARN that does not exist.
2026-10-01 21:00:35 -04:00
Hector Ventura 8d056e9456 ci: limit contributors to 2 open pull requests (#4864)
Call the shared floci-io/.github pr-limit workflow on opened, reopened and
ready_for_review, and on closed and converted_to_draft to clear stale
labels. Runs for the same pull request queue rather than cancel, and manual runs use their own concurrency group. Contributors
keep at most 2 open, non-draft pull requests: the 3rd and 4th get the
over-pr-limit label and a reminder, and from 2026-10-08 the 5th and later
are closed automatically. Bots and maintainers are exempt.

This replaces the advisory bot that labelled authors with more than 5 open
pull requests: the limit is now 2, drafts no longer count, and the logic and
wording live in one shared workflow.

CONTRIBUTING.md and the pull request template describe the policy.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-01 17:44:05 -05:00
Hector Ventura ea06896984 test(compat): run the Java SDK suite nightly in cn-north-1 against an allowlist of known failures (#4790)
* test(compat): run the Java SDK suite nightly in cn-north-1 against an allowlist of known failures

Part of #4272 (P11). The partition work is covered by unit and integration
tests over all eight partitions, but nothing ran a real SDK whose own
partition logic (arn:aws-cn: ARNs, China signing scopes, the LocationConstraint
S3 CreateBucket sends) has to round-trip.

The Partition Compatibility workflow runs after each Nightly against the image
it published, or on dispatch with an image and region: Floci starts with
FLOCI_DEFAULT_REGION=cn-north-1 and sdk-test-java runs with AWS_REGION set,
which TestFixtures now reads (default us-east-1, so the per-PR legs are
unchanged). It runs once a night rather than per PR, to keep the shared runner
pools free.

compat-allowlist-check.py compares the JUnit results with
compat-partition-allowlist-<region>.txt and fails on a failure the list does
not name, on an entry that no longer fails, or on missing results, so the list
only shrinks. The cn-north-1 list holds the 112 failures measured locally on
main plus #4787: 96 tests that pin commercial ARNs, regions or zones, 13 that
exercise commercial-only behaviour, and 3 still to explain.

* test(compat): pin the nightly China run to its image's commit and catch an aborted suite

Greptile on #4790: the workflow checked out the Nightly run's head_sha but
pulled the mutable floci/floci:nightly tag, so the image and the tests could
come from different commits; it now pulls the image first and checks out the
commit in its org.opencontainers.image.revision label. And Maven exits
non-zero for allowlisted failures too, so a suite that stopped partway could
pass; the checker now takes --test-sources and requires a report for every
test class in that tree.

The cn-north-1 allowlist groups its entries by the verified cause: the RDS and
SSO portal entries are Floci bugs (an RdsService ownership check against the
literal partition "aws", and an arn:aws: seeded Identity Center instance),
and SsoAdminAccountAssignmentTest#createInstanceQuotaUsesAwsSdk passes alone
and fails only after OrganizationsTest leaves an organization behind.
2026-10-01 00:33:54 -04:00
TATSUNO “Taz” Yasuhiro 76adb9a97e chore(style): Enforce NoVar rule on new files, existing bad files later (#4362)
* chore: ban var with Checkstyle in CI

Checkstyle runs tools/checkstyle/checkstyle.xml over src and compatibility-tests/sdk-test-java in its own workflow. It stays out of the Maven lifecycle because a full run takes about 30 seconds.

Code that already uses var is listed in tools/checkstyle/suppressions.xml, one entry per service and one per compatibility-tests file, so each can be cleaned and removed in its own PR.

* docs: point AGENTS.md and CONTRIBUTING.md at Checkstyle

* chore: load Checkstyle suppressions from checkstyle.xml

IDE plugins such as CheckStyle-IDEA set config_loc to the config directory and now apply the same suppressions as CI. Maven sets config_loc through propertyExpansion.

* chore: exclude files, not directories, from the var check

New files in services that still use var are now checked too.

* chore: exclude the renamed NativeDynamoDbJsonHandler files from the var check
2026-09-30 21:53:14 -05:00
Abhigya d73e33fe4b fix(ecs): pull task images at launch so a moved tag reaches the next task (#4583)
* fix(ecs): pull task images at launch so a moved tag reaches the next task

Floci resolved an image reference to an image id the first time it saw it and
reused that id for the life of the process, so a rebuilt :latest pushed to the
registry never reached a new task, even through a new task definition revision
and a forced deployment, and nothing reported the mismatch.

ECS now pulls every container image when a task starts, before creating any of
its containers, following the agent's ECS_IMAGE_PULL_BEHAVIOR (configurable as
floci.services.ecs.image-pull-behavior, default "default": pull, and fall back
to the cached image when the pull fails). The cached image is whatever the
local tag names at launch rather than a remembered id. Each container reports
the manifest digest it runs as containers[].imageDigest.

* fix(ecs): create task containers from the image id their pull resolved to

An overlapping RunTask could pull the same moved tag between this task's pull
and its container creation, so the container was created from whatever the
shared tag cache named by then while reporting the digest this task pulled.
resolveForLaunch now returns the resolved image id with its digest, and ECS
builds each container from that id, so the image a task runs and the digest it
reports always come from the same pull.

The pull also now uses the reference the container is created from, including
floci.docker.image-registry-base, instead of the unprefixed name.

* fix(ecs): launch image ids without a pull and report the digest the pull resolved

A bare sha256 image id under always, or on the first once launch, went to the
registry as if it were a repository reference and failed the task although the
image was local. resolveForLaunch now runs an image id as it is, like
ensureImageExists.

The reported digest took the first RepoDigests entry for the repository, which
is not necessarily the manifest the tag resolved to when the image holds more
than one (an index and a platform manifest). It now comes from the Digest line
the daemon streams for the pull, kept while the tag still names that image; a
cached image falls back to its repo digest only when there is exactly one.

The shared test config uses prefer-cached so the other ECS Docker suites stop
adding a registry round trip per launch; the image pull integration test pins
default in its own profile. ContainerBuilder imports are back in order.

* fix(ecs): report a pull's digest only for the launch that pulled

The digest a pull reported was kept per reference and reused while the tag
still named the same image id, but on the classic image store an id is the
config digest and several manifests can share it, so an outside pull could move
the tag to another manifest and leave the reused digest stale. Only the launch
that pulled now uses the streamed digest. A cached launch uses the image's
repo digest for the repository when there is one, or the one equal to the id
(the containerd store names an image by its manifest), and otherwise none.

Also sorts the ContainerLifecycleManager imports.

* fix(ecs): pull the image-pull test's busybox and registry from Docker Hub

EcsImagePullDockerIntegrationTest pulled both images through the
public.ecr.aws/docker/library mirror, whose anonymous quota is shared per
runner IP; shard 3 failed on toomanyrequests: Data limit exceeded. Take
them from TestImages like the other Docker-backed tests, pinning the
registry image there, and prefetch both for the shard that runs the class.

* test(ecs): name the registry readiness probe's tolerated exception expected
2026-09-30 22:14:50 -04:00
Hector Ventura 8ff1eae121 ci: run the per-PR hygiene checks in one job and skip drafts without a gate job (#4703)
* ci: run the per-PR hygiene checks in one job

The signed commits, AI attribution, Conventional Commits, em-dash and PR
template checks were five workflows with one job each, so every push to a
pull request started five runners for about ten seconds of work apiece. At
busy times those jobs queued for up to twenty minutes behind the CI shards
and the compatibility suites under the account's concurrent-job limit.

They now run as steps of a single "PR hygiene" job. Each step keeps the old
check's name, script and annotations, and runs under !cancelled() so one
failure does not hide the others. The signature check also runs on
"edited" now: with one job, an edit-triggered run replaces the whole
result, and skipping signatures there would turn an unsigned PR green. A
per-PR concurrency group cancels superseded runs.

The path-filtered checks (docs tables, partition literals, changelog guard)
keep their own workflows.

* ci: skip draft PRs with a job condition instead of a gate job

CI and Compatibility Tests reached the draft rule through a reusable
workflow that started its own job on every run. That job did about three
seconds of work, but every other job in the run needed it, so under the
account's concurrent-job limit its queue wait sat at the head of the
critical path: on recent PR runs a median of about 35 seconds, and nine to
thirteen minutes at the tail, before a shard or native build could even be
queued.

The same condition now sits on the root jobs as a job-level if:, which
GitHub evaluates without a runner. Drafts, closed PRs and edited events
still skip the suites and pushes to main still run; the native suites
follow build-native. CI summary keeps always() so a failed shard still
reaches the partition check and report, and uses the same condition so it
does not run on a draft. pr-draft-gate.yml has no callers left and is
removed.
2026-09-30 09:26:42 -04:00
Kenshin Okinaka 5aae37a3ef ci: prefetch busybox for the ECS leftover-container test (#4647)
EcsLeftoverContainersDockerIntegrationTest starts busybox but was not
listed among the classes that key the busybox prefetch, so its shard
pulled the image during the test instead of before it. List it with the
other busybox users.
2026-09-29 19:01:15 -05:00
TATSUNO “Taz” Yasuhiro 1465251e0c fix(dynamodb): reject a request member of the wrong JSON type (#4636)
* chore(dynamodb): vendor the input shapes of botocore's DynamoDB model

tools/aws/regen_dynamodb_shapes.py keeps each operation's input shape and
the type of every shape it reaches, from the pinned botocore release.
make aws-data-sync regenerates it and make aws-data-check keeps it in sync.

* fix(dynamodb): reject a request member of the wrong JSON type

DynamoDB answers a member of the wrong JSON type with a
SerializationException before it runs the operation, such as
"NUMBER_VALUE cannot be converted to String" for a number BillingMode or
IndexName. The message names the JSON token and the Java type, or says
"Unexpected field type", "Unexpected value type in payload",
"Start of structure or map found where not expected" or "UnknownError"
by where the value sits. The first bad member in body order is reported.
A JSON null counts as absent and an unknown member is ignored.

Floci now checks every DynamoDB JSON request against the vendored input
shapes. A number in an ExclusiveStartKey S value is one of these errors on
AWS, so that test now expects the SerializationException.

* fix(dynamodb): keep provenance out of the shapes freshness check

The shapes file now carries its provenance in a _source block, like the
other vendored AWS data, and --check compares it without that block. A
run against --botocore-data or a local checkout no longer reports the
file as stale when only the botocore label differs.
2026-09-29 11:18:40 -04:00
Kenshin Okinaka ac706264a3 ci: pull the Firelens router from Docker Hub and correct why (#4622)
* ci: pull the Firelens router from Docker Hub and correct why

A post-merge run showed the ECR Public quota is per runner IP and per
byte, not specific to the docker/library mirror: the Firelens router
failed with "toomanyrequests: Data limit exceeded" right after the same
job had pulled two Lambda runtimes from ECR Public. The router is the same
image AWS publishes on Docker Hub (same manifest, config and layer digests
on both architectures), so the Firelens test now names it there, through
a TestImages pin the prefetch reads. The Lambda runtimes stay on ECR
Public: their Docker Hub copies lag by more than a year and some tags are
missing. The TestImages Javadoc now gives the corrected reason.

* ci: annotate a stale, unreadable or misrouted prefetch

The prefetch already writes a line when a key names a class that no longer
exists or when a TestImages pin cannot be read, but only into a log nobody
reads unless a shard fails. The results step now turns those lines into
workflow warning annotations, and adds one more: an image prefetched from
ECR Public that is not a Lambda runtime, since everything else the tests
start is carried by Docker Hub and belongs there. The prefetch stays
best-effort, so these are annotations, not failures.

* ci: warn on a misrouted prefetch whether or not its pull succeeded

The routing warning matched only "prefetched" lines, so an image on the
wrong registry whose pull failed on the quota, the very case the warning
is for, produced only the raw failure line. It now matches
"prefetch failed" lines too.
2026-09-28 23:30:24 -05:00
Priamo Germosen 26146a3f94 feat(iam): expand wildcard service grants against a vendored namespace catalog (#4544)
GetServiceLastAccessedDetails reports the services an entity can reach, but
a grant that names no namespace could not be expanded: "Action": "*", a
globbed prefix such as s3*, and any NotAction all denote a set no policy
document spells out. A user holding only AdministratorAccess came back with
an empty report. Closes #4487.

The list of namespaces is vendored in aws/iam-service-namespaces.json and
generated by tools/aws/regen_service_namespaces.py from AWS's Service
Reference Information index, whose per-service "service" field is the IAM
namespace itself. botocore is deliberately not the source, even though every
other vendored file here comes from it: a namespace is not any botocore
field, since CloudWatch's endpointPrefix is monitoring and its serviceId is
CloudWatch against an IAM namespace of cloudwatch. A rule over botocore
metadata is wrong for some service, and a wrong namespace is worse than a
missing one because it names something IAM does not have.

That index is a live endpoint rather than a pinned dependency, so unlike
regen_partitions.py a fresh generation is not byte-identical and byte
equality is the wrong gate. What must be guaranteed is that nothing in the
file is invented, which is checked directly: make iam-namespaces-check
validates the file's shape offline, and make iam-namespaces-verify checks
online that every namespace in it still exists upstream, failing on one that
does not. Services AWS has added since the last sync are reported without
failing, since the file being behind makes the report incomplete rather than
wrong.

A namespace a policy names outright is kept whether or not the catalog knows
it, so a catalog trailing an AWS launch still reports an explicitly named
service; only wildcard expansion depends on it being current. A globbed
prefix now expands to the namespaces it matches rather than being treated as
every service and then dropped.
2026-09-28 22:02:13 -05:00
Kenshin Okinaka 903efdf58e ci: key the ECR Public prefetch on the classes that start each image (#4600)
* ci: key the ECR Public prefetch on the classes that start each image

prefetch-images.sh keyed the four Lambda runtimes on any /lambda/ path in
shard.txt, and partition.sh spreads the Lambda tests over every shard, so
each of the four shards pulled all four runtimes (674 MiB) plus the Firelens
router (105 MiB) from ECR Public anonymously before its tests started. ECR
Public counts that transfer per runner IP, and once the quota is spent every
later anonymous pull fails with "toomanyrequests: Data limit exceeded",
which is how a 2 MiB busybox pull took a shard down on main twice on
2026-09-27.

Measured from a full four-shard run by pairing each ImageCacheService
"Pulling image" / "Image already present locally" line with the class that
logged it: nodejs:20 is reached from every shard, python:3.14 and
python:3.12 each have one Docker-backed class, nodejs:18 was pulled by every
shard and started by none, and the Firelens router has one class. Each entry
now keys on those classes, which cuts a shard's ECR Public prefetch from
about 800 MiB to between 120 and 330 MiB. A class the list misses pulls
inline, as before.

The tests also used three busybox tags (latest, 1.36, stable) for the same
2 MiB image. They now share one pin, TestImages.BUSYBOX (busybox:stable,
the tag application.yml and the compatibility suites already use), and the
prefetch script reads that pin from the class the way it reads the sidecar
pins from application.yml, so one prefetch serves every test and the two
cannot drift apart. The one test that pulls the other architecture keeps a
tag of its own: a foreign-platform pull replaces what the local tag points
at on a daemon without the containerd image store, and the docker build in
the VolumesFrom test resolves its base from that local tag.

Each key that names a class is checked against src/test/java, and a stale
name is written to the log, so a rename cannot silently turn a prefetch off.

The prefetch also set off ECR Public's per-second limit on its own: every
pull started in the background at once, so the shard's ECR Public pulls
landed in the same second. They are now queued and pulled one after another,
a second apart, small images first because core/common/docker sorts near
the top of every shard, while the Docker Hub pulls stay parallel. And each pull now
writes one result line to prefetch-images.log, printed by a step after the
tests, so a failed or still-running prefetch can be told apart from a test
pulling the image itself.

* ci: pull the Docker library test images from Docker Hub

The first run of the prefetch results log showed where the quota actually
runs out. On the two shards that failed, the very first pull of the job,
docker/library/busybox or docker/library/python from the ECR Public mirror,
came back with "toomanyrequests: Data limit exceeded" before the job had
transferred anything, so the shard's own volume was not what spent it. The
same runner then pulled busybox from Docker Hub seven seconds later and a
116 MiB lambda/ image from ECR Public half a minute after that, both fine.
The mirror at public.ecr.aws/docker/library has an anonymous quota of its
own, shared by runner IP and often already spent when a job starts, while
GitHub-hosted runners pull Docker Hub without a limit: the fourteen Docker
Hub images each shard prefetches have never failed.

TestImages now names busybox and python-alpine the Docker Hub way, with the
reason in its Javadoc, and the prefetch pulls them with the other Docker Hub
images instead of queuing them behind the ECR Public runtimes. The three
python-alpine literals share one pin. The pin is read with a regex that
tolerates spacing, and a pin the script cannot read writes a "prefetch
skipped" line instead of silently pulling nothing. An image two entries
name is pulled once. The results step also lists any docker pull still
running, so an early exit does not make an unfinished pull look like one
that never ran.

* test(compat): pull the SageMaker and CodeBuild images from Docker Hub

The SageMaker compatibility tests (Java and Python) and the CodeBuild one
named busybox through the public.ecr.aws/docker/library mirror, the same
namespace whose anonymous quota fails the Build and Test shards, and the
native Python jobs of another PR failed on it the same way. They now name
the image the Docker Hub way. The CodeBuild digest is the same on both
registries, so that reference only changes its host.
2026-09-28 21:17:51 -04:00
TATSUNO “Taz” Yasuhiro dce7983b15 chore(ci): native CI now fails when the native image breaks a Docker call (#4514)
* chore(ecs): read the task metadata stats from inside a container

No compatibility test reached Docker's stats API, so the native image could lose the docker-java stats models without any test failing.

* chore(compat): reach the Docker commands no native test used

Recording the Docker API calls of the Java suite against the native
image showed commands no test reached. Cover the ones a CI run can reach:

- ECS Exec resizes the terminal of an interactive session
- a Lambda function with 33 MB of unzipped code is served from a code
  volume, which lists the volumes
- Timestream for InfluxDB reboots an instance

* chore(ci): run container-backed EC2 against the native image

The native suites run EC2 in mock mode, so no native test reached the
Docker calls only container-backed EC2 makes: building the security group
helper image, committing an instance as an AMI and removing that image,
and the VPC networks. A new job starts the native image with
container-backed EC2, once with security group enforcement and once
without, since an enforced instance lives in its helper's network rather
than on a VPC network. It ends by killing and restarting Floci, which must
remove the VPC network the tests leave behind.

* chore(compat): trust Floci's test certificate in the ECS Exec session client

The native CI job runs Floci with TLS, which makes the ExecuteCommand stream URL wss:// on Floci's test CA.

* chore(ci): launch arm64 EC2 guests in the container-backed EC2 job

The job runs on an arm64 runner, and the x86_64 AMI starts its guest as linux/amd64. The VPC network instances never reached running there. Maven also logs its test counts now, so a skipped phase shows in the job log.

* chore(compat): say why the new tests' cleanup failures are ignored

* chore(ci): stop waiting for Floci once it reports unhealthy in the EC2 job

The wait kept polling for the full minute after an unhealthy status, unlike the existing wait step in the same workflow.
2026-09-28 21:04:01 -04:00
Priamo Germosen 238e21770e ci(compat): skip test compilation in the native build (#4539)
-DskipTests only stops surefire; testCompile still ran and compiled all of src/test on both arches before the native image build. -Dmaven.test.skip=true skips test compilation as well.
2026-09-27 18:16:15 -05:00
Matheus Oliveira c357d37fa9 feat(release): sign published image attestations with keyless cosign (#3914)
Move signing into its own sign-images job that consumes push-native's
digest outputs, so a Fulcio or Rekor outage can no longer strand a
partially published release, and document the cosign verify invocation
for consumers.

Closes #2397

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-09-26 01:34:46 -05:00
Matheus André 288cc01268 ci: verify the source-derived shard class list against compiled test classes (#4245)
all-classes.txt is derived from src/test/java file names so shard.txt
exists before Compile. A test class whose name differed from its file
would drop out of both all-classes.txt and the shard union, and the
completeness check in CI summary would not notice. After Compile, derive
the list from target/test-classes as before and fail the shard if the
two disagree.
2026-09-26 01:19:58 -05:00
Priamo Germosen a3a06bb7b6 ci: raise the shard timeout from 15 to 20 minutes (#4437)
Measured on recent green runs, shards take 10m49s to 13m47s, so the
slowest had about a minute of margin under a 15 minute ceiling. Shard 1
timed out twice on an unrelated PR because of exactly that.

timeout-minutes is a kill switch for a hung job rather than a budget.
Actions bills the minutes a job actually uses, so raising the ceiling
costs nothing while runs stay the length they are, and it stops a slow
runner or a contended queue turning a passing suite into a red build.

This does not make anything faster, and it is not a substitute for the
work in #3963: it removes the failure mode while the suite sits where it
sits. Per shard that is about 1m15s compiling, 2.3 to 3.2 min building
one application per distinct test profile, and 7.2 to 8.2 min running
test classes, with the class time spread too flat to have a hot spot
left.

ci-summary keeps its 10 minute ceiling; it finishes in seconds.
2026-09-25 16:57:57 -05:00
Hector Ventura 0dd080a46f feat(core): partition foundation from botocore's published partition data (#4317)
P1 of the multi-partition initiative (#4272). tools/aws/regen_partitions.py
vendors botocore's partitions.json and endpoints.json (8 partitions, 46 regions,
the partition-wide endpoints with their signing regions) plus the CDK's opt-in
and S3 website rules into src/main/resources/aws/partitions.json, checked by
make aws-data-check. AwsPartition and AwsPartitions replace the hand-typed rules
behind AwsRegions; RequestContext carries the request's partition from its
SigV4 signing region; RegionResolver mints global ARNs in that partition and
buildArn routes a blank region there; floci.partitions.id pins the deployment's
partition behind a startup validator that refuses a contradiction with the
default region.

Behaviour a reviewer will see, all AWS-faithful: DescribeRegions follows the
request's partition and the opt-in model (17 commercial regions by default, all
34 with AllRegions=true, RegionName.N filters, endpoints on the partition's DNS
suffix); TLS SANs cover every published region; the EKS registry mirrors follow
the deployment partition's regions. The partition-literal baseline drops by two.

Part of #4272
2026-09-24 10:33:05 -04:00
Hector Ventura 0a601d54eb chore(tooling): gate partition literals in src/main against a per-file baseline (#4270)
P0 of the multi-partition plan. tools/partition/partition_literals.py inventories
the arn:aws: prefixes, amazonaws.com hosts, hosted-zone ids and hand-rolled
partition regexes in src/main/java per file against tools/partition/baseline.tsv.
A literal in a new file fails, growth in an existing file fails, and a drop fails
until the baseline is regenerated, so the remaining count only shrinks. Escapes
are a `// partition-literal: <reason>` comment or an allowlist.yaml entry.

Makefile targets (partition-check, partition-baseline, partition-audit,
partition-test), a python-only workflow, AGENTS.md and CONTRIBUTING.md
paragraphs, and the ResourceExplorer2 assertion now checks the partition against
the ARN's region instead of a literal arn:aws:.
2026-09-24 07:08:28 -04:00
Matheus André 375d83c0f4 fix(ci): add draft PR handling to CI workflows for compatibility and build tests (#4292)
Signed-off-by: Matheus André <matheusandr2@gmail.com>
2026-09-23 22:48:50 -05:00
Matheus André 5fbaab1cca fix(ci): compute shard.txt before Compile so the image prefetch overlaps compilation (#4026)
The first prefetch-images.sh call ran before shard.txt existed, so it always
hit the readability guard and exited silently; only the second call, right
before the tests, did any work.

Derive the shard include list from src/test/java instead of
target/test-classes, so shard.txt is available before Compile. Every test is
a top-level class in src/test/java, so the source file name equals the class
name and the resulting shard.txt is byte-identical for all four shards.
Prefetch once, right after the shard is computed, and drop the second call.

Make the script log when it exits at the readability guard so a no-op call
shows up in the job log instead of being silent.

Closes #3995
2026-09-22 23:54:54 -05:00
Priamo Germosen 3c23fff607 ci: prefetch the Postgres, k3s, InfluxDB and Firelens images the shards pull inline (#4181)
Every shard pulled these images inline during the test run. Prefetch them
in the step that already warms the lambda and docdb images, matched on the
shard's own test list so a shard only pulls what it runs:
postgres:15-alpine for redshift and cloudformation, postgres:16.3-alpine
for rds, influxdb:2.7, rancher/k3s and the fluent-bit and busybox pair for
ecs. The rds tag is hardcoded on purpose, since imageForEngine adapts the
configured default to the requested EngineVersion and there is no single
config line to read.
2026-09-22 19:57:36 -05:00
Niels Kootstra 4753428567 fix(rds): bind PostgreSQL IAM tokens to the published endpoint and authorize rds-db:connect (#4100)
* fix(rds): bind PostgreSQL IAM tokens to the published endpoint

The PostgreSQL proxy validated IAM auth tokens with the two-argument
validator, so a token generated for any host, port or region was
accepted as long as the signature and DBUser matched. The MySQL proxy
already checked the token against the endpoint it publishes. Thread the
same binding into the PostgreSQL handler and validate against it.

* fix(rds): carry account and resource ids in the proxy binding

RdsService now builds the proxy binding itself at every relay start
(instances, clusters, RDS Proxy relays and restart restores) from the
published endpoint, port, region, account and DbiResourceId or
DbClusterResourceId, so the auth proxy has everything rds-db:connect
is scoped to. The convenience startProxy overload that re-derived the
region from the relay key is gone along with it.

* feat(rds): authorize rds-db:connect when IAM enforcement is on

After the token signature checks out, the auth proxy now asks IAM whether
the token's principal may perform rds-db:connect on
arn:aws:rds-db:<region>:<account>:dbuser:<resource-id>/<db-user>, the
same check AWS runs. It only applies when services.iam.enforcement-enabled
is on; a caller IAM does not know keeps the filter's bypass. The client
still sees the engine's generic authentication failure, and the denial is
logged in AWS's wording so the cause is visible server-side.

* refactor(rds): rename RdsMysqlBinding to RdsProxyBinding

Both engines, Aurora clusters and RDS Proxy relays now validate IAM
tokens against it, so the MySQL-specific name was misleading.

* docs(rds): describe IAM token endpoint binding and rds-db:connect

* test(rds): cover a replayed IAM token in the JDBC compat suite

* fix(rds): accept IAM tokens generated for the loopback name of the endpoint

Floci advertises the name containers reach it by (host.docker.internal
natively, its own address in Docker), while a client on the host connects
to the same proxy over the loopback interface and generates its token for
localhost or 127.0.0.1. Binding tokens strictly to the advertised host
therefore refused every native client; the published port still has to
match, so a token for another instance on the same host is still refused.

The compatibility workflow sets FLOCI_SERVICES_RDS_ENDPOINT_HOST=floci as
it already does for Redshift, so the tests' tokens name what the
containerised Floci publishes.

* feat(rds): make the PostgreSQL IAM token endpoint binding opt-in

Refusing a PostgreSQL token generated for another hostname, port or
region matches RDS but breaks clients whose tokens name a different
host than the endpoint publishes, so the check now sits behind
services.rds.iam-token-endpoint-binding
(FLOCI_SERVICES_RDS_IAM_TOKEN_ENDPOINT_BINDING), off by default.
MySQL and MariaDB keep requiring the endpoint as before, and the
rds-db:connect check still runs whenever IAM enforcement is on.
The compatibility workflow turns the flag on so the replayed-token
case stays covered.

* fix(rds): refuse an IAM token that reaches the validator without a binding

Every proxy publishes a binding, so a token without one has nothing to
be checked against; validating its signature alone was a fail-open
path. The signature-only validate(token, user) overload and the MySQL
handleAuth overloads that passed no binding are removed; production
only ever used the ones that pass it.

* fix(rds): sanitize the rds-db resource named in the refused connection warning

The database user is part of that resource and comes straight from the
client's startup message, so it is stripped of control characters like
the other client-controlled values in the warning.

* docs(rds): call a refused IAM token the engine's ordinary authentication failure

The exact message differs per engine, and RDS PostgreSQL words it
differently from Floci's handler today, so the docs no longer promise
one wording.

* docs(rds): move the IAM token binding row into the RDS variables table

The row had landed above the page heading, where it rendered as a
stray one-row table; it now follows FLOCI_SERVICES_RDS_ENDPOINT_HOST
as it does on the RDS page.

* fix(rds): bind PostgreSQL IAM tokens to the endpoint by default

A stock Floci still accepted a PostgreSQL token generated for another
endpoint, the replay this change set out to close, and PostgreSQL and
MySQL disagreed about it in a way RDS never has. The endpoint check is
now on for every engine. services.rds.iam-token-endpoint-binding
(FLOCI_SERVICES_RDS_IAM_TOKEN_ENDPOINT_BINDING=false) stays as the
escape hatch for clients that generate tokens for a container name or
DNS alias the endpoint does not publish. The compatibility workflow no
longer needs to turn the check on.

* chore(ci): rerun after a Docker Hub rate limit failed shard 1
2026-09-22 15:49:14 -04:00