Commit Graph
3210 Commits
Author SHA1 Message Date
Priamo Germosen 64375691ac fix(iam): enforce tag constraints across every IAM tagging action (#4485)
extractTags collapsed Tags.member.N into a map before any count was taken,
so a 51-member list with one repeated key slipped through as 50 tags, and
TagUser, TagRole, TagPolicy and TagOpenIDConnectProvider bounded nothing.

The request-shape rules now live in the handler, on the members as sent:
tagListType and tagKeyListType are capped at 50 for every tag and untag
action, keys must be 1-128 characters and values at most 256, both matching
IAM's tag character pattern, with errors naming the offending member index.

Users, roles, policies and OIDC providers now also enforce the 50-tag
per-resource quota (LimitExceeded, as instance and SAML providers already
did), and the tag read-modify-write runs under a lock so two requests that
each fit cannot together push a resource past it.

Closes #4407
2026-09-26 16:10:41 -05:00
Priamo Germosen 1451693cda feat(ecs): give task containers their role credentials (#4486)
Wires the pieces together so a task that declares a taskRoleArn actually gets
credentials. EcsContainerManager issues the task's session, stands the proxy
up on the network its containers join, publishes one relative URI to every
container in the task the way real ECS does, and gives each container its own
address in 169.254.0.0/16 so it has a connected route to the endpoint at all.
Credentials and addresses are released when the task stops, exits, or fails
part way through a launch.

EcsTaskLinkLocalAddresses owns the addresses because Docker will not: it
accepts two containers claiming the same link-local address on one network
and then which one answers depends on whose ARP reply wins. Addresses are
tracked per network, since separate networks are separate L2 segments, and
freed with the task.

ContainerBuilder.resolveDockerNetwork exposes the network a spec would land
on, which the allocator needs before the spec exists. withDockerNetwork now
calls the same method rather than keeping a second copy of the resolution.

A security-group protected task is skipped for now and says so: those
containers run in an isolated helper namespace that the proxy's address does
not reach, so issuing credentials there would hand out an endpoint the task
cannot use.

Closes #4483.
2026-09-26 16:10:30 -05:00
Niels Kootstra 8b9f441bb4 fix(cognito): expire auth challenge sessions (#4417)
* fix(cognito): expire auth challenge sessions

InitiateAuth and RespondToAuthChallenge session tokens for SRP, custom
auth, and USER_AUTH never expired, so an abandoned challenge session
lingered in memory forever and could still be completed long after
AWS would have rejected it. Track when each session was issued and
reject expired ones with the NotAuthorizedException Cognito returns
in that case, purging expired entries whenever a new one is created.

AWS defaults AuthSessionValidity to 3 minutes (configurable 3-15 via
CreateUserPoolClient); UserPoolClient does not yet store a per-client
override, so every client uses the 3 minute default for now.

* fix(cognito): stamp custom auth tokens when they are issued

A CUSTOM_AUTH session's issue time was recorded before the
DefineAuthChallenge and CreateAuthChallenge triggers ran, so a slow
trigger shortened the session handed to the client. The issue time
also lived on the flow state shared across rounds, so minting the next
round's token refreshed the old token while it was still in the map.

Each custom auth token now carries its own issue time, stamped when it
is stored, and every issuance path (including both continuations)
purges expired tokens first.

* style(cognito): brace the custom auth session lookup

* test(cognito): use the shared MutableClock

* docs(cognito): document auth challenge session expiry

* chore: rerun CI

* chore: rerun CI
2026-09-26 16:10:19 -05:00
Abhigya a5ded3e162 fix(apigateway): import x-amazon-apigateway-any-method in the native image and roll back failed imports (#4473)
* fix(apigateway): import x-amazon-apigateway-any-method in the native image and roll back failed imports

The ANY pseudo-operation reaches the service as an untyped extension map, and it was
bound to io.swagger.v3.oas.models.Operation with Jackson bean deserialization. The
swagger model graph is not registered for reflection, so in the native image every
ImportRestApi or PutRestApi body with x-amazon-apigateway-any-method failed with
BadRequestException. Parse it with the swagger parser's own Operation reader, the one
that already builds the real verbs, which needs no reflection.

A failed import also left state behind: ImportRestApi kept a half-built API whose id the
caller never received, and PutRestApi left the API cleared and partly rebuilt. ImportRestApi
now deletes what it created and PutRestApi restores the API-scoped state it replaced.

* chore(apigateway): import swagger Json instead of qualifying it inline
2026-09-26 14:03:30 -04:00
vamsiakandVamsi Akavarapu f3dde75c0b fix(sns): retry failed sqs subscription deliveries (#4468)
* fix(sns): retry failed sqs subscription deliveries

* fix(sns): support fifo subscription dead letter queues

* fix(sns): distinguish shared fifo dlq deliveries

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-09-26 13:59:29 -04:00
Abhigya 5af1d4048e fix(elasticache): report a ConfigurationEndpoint only for cluster-mode-enabled replication groups (#4469)
A cluster-mode-disabled replication group reported a ConfigurationEndpoint
alongside NodeGroups[0].PrimaryEndpoint. AWS only returns ConfigurationEndpoint
for a cluster-mode-enabled group, and terraform-provider-aws branches on its
presence: when it is set, primary_endpoint_address and reader_endpoint_address
are left null.
2026-09-26 13:33:47 -04:00
vamsiakandVamsi Akavarapu bbb1e10fc8 fix(sqs): retain fifo deduplication after message deletion (#4460)
* fix(sqs): retain fifo deduplication after message deletion

* fix(sqs): preserve fifo send identity after deletion

* fix(sqs): serialize fifo dedup expiry with sends

* fix(sqs): narrow FIFO deduplication send locking

* chore(ci): rerun PR test workflow

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-09-26 10:58:42 -04:00
Hector Ventura 2cccc73499 fix(core): build and recognise AWS hostnames in every partition (#4451)
* fix(core): build and recognise AWS hostnames in every partition

AwsEndpoints builds the AWS-shaped hosts Floci returns from the region's partition DNS suffix: execute-api, the S3 bucket, regional, dual-stack and website hosts, Cognito and EKS OIDC issuers, APS, Bedrock AgentCore, AppSync and EC2 public DNS names. partitions.json records the regions whose S3 endpoint publishes a dual-stack variant, so DualStackDomainName is only returned there. The S3 virtual-host fallback, the execute-api host filter, the ECR image URI and the CloudFront S3-origin parsers recognise every published suffix, longest first. The CloudFront domain suffix Cognito and API Gateway mint comes from floci.services.cloudfront.domain-suffix.

Two commercial bugs go with it: WebsiteURL uses the dash form (s3-website-<region>) in the nine regions that keep it and ends with a slash, and EMR's public DNS name is compute-1 only in us-east-1.

Also carries the follow-ups from the #4444 review: accessDeniedResponse gets its Javadoc back in IamEnforcementFilter, IamAuthValidator's imports are in order, and the IAM test helper's pair loop cannot read past the array.

Part of #4272

* fix(core): keep CloudTrail S3 hosts and CFN dual-stack attributes consistent with their region

CloudTrail built an S3 data event's Host, TLS host header and resource ARNs from the request scope, but the log writer emits its own deliveries from the flush thread, where the request region falls back to the deployment default: a cn-north-1 trail's self-delivery record said awsRegion cn-north-1 with a .amazonaws.com host and an arn:aws: ARN. buildS3Record now takes the event region emitS3DataEvent already resolves and derives all of them from it.

AWS::S3::Bucket drops a prior DualStackDomainName when an update lands in a region without an S3 dual-stack endpoint, since provision receives the previous attributes on update.

* test(resourceexplorer2): check a regionless ARN's partition against the resource's region

The cn-north-1 CloudTrail self-delivery test left its bucket behind in the shared emulator, and ResourceExplorer2's partition assertion then failed on arn:aws-cn:s3:::loop-logs-..., a correct ARN: S3 ARNs carry no region, so the expected partition fell back to aws. The assertion now takes a regionless ARN's partition from the Region the listing reports, and skips it when that is not a published region (global resources). The CloudTrail test deletes its trail, objects and bucket after each case through PartitionCleanup.
2026-09-26 10:15:18 -04:00
Aniket Shukla df67d421f9 fix(rds): honor Port on cluster snapshot restore (#4326)
* fix(rds): honor requested port when restoring a cluster snapshot

Reserve an explicit RestoreDBClusterFromSnapshot port for the cluster endpoint and proxy, validate its AWS range, and reject local port collisions. Keep automatic allocation when Port is omitted.

* fix(rds): keep requested ports within published proxy range

* fix(rds): reject occupied requested ports and preserve handler calls
2026-09-26 01:34:59 -05:00
Priamo Germosen b18ddc2c24 fix(sns): refuse http endpoints on link-local and metadata addresses (#4400)
Subscribe checked only that an http/https endpoint carried a matching scheme, then Floci posted the SubscriptionConfirmation and every notification to it. An unauthenticated Subscribe therefore turned the emulator into a blind request forwarder against addresses only it can reach.

Resolve and screen the endpoint at Subscribe, which is where a name can be judged. At delivery, screen only an endpoint that names an address outright, which reaches a subscription stored before Subscribe began refusing them and costs no lookup. Deliberately no second resolution there: HttpClient resolves the name again when it connects and cannot be given the result of a check, so a lookup could never decide where the request goes.

Loopback and private ranges stay allowed, since delivering to a neighbouring container is the normal case, and a host that does not resolve yet is accepted as it is on AWS.
2026-09-26 01:11:19 -05:00
Mario Toffia 2df052181d fix(dynamodb): route stream consumers through one account-scoped reader (#4394)
* refactor(dynamodb): add a stream reader and key native streams by table ARN

DynamoDbStreamReader is the engine-neutral way to read DynamoDB Streams.
DynamoDbApiStreamReader implements it over the selected DynamoDbOperations using the Streams wire API.
Native streams were keyed by region and table name, so same-named tables in two accounts shared one stream.
They are now keyed by table ARN, and ListStreams returns only the caller's account and region.

Streams of every account are restored from persisted tables at startup.

* refactor(dynamodb): move stream consumers onto the stream reader

The Lambda DynamoDB Streams poller reads through DynamoDbStreamReader: each tick renews iterators from committed progress for every readable shard, and reads a child shard only after its parent was read to its end.
It discards restart checkpoints only for a process-lifetime engine, and pins LATEST per shard via newestSequenceNumbers, replacing DynamoDbStreamService.latestSequenceNumber.
A read fills a batch from as many GetRecords calls as it needs, so a batch is not cut at the 1000 record GetRecords maximum.
EventBridge Pipes reads DynamoDB streams the same way, committing a batch only once it is delivered or sent to the DLQ, delivers the AWS stream record shape with eventSourceARN, and honors LATEST.
The Redshift zero-ETL consumer reads the same way, keeping per-shard progress in the integration (legacy checkpointSequenceNumber is ignored on load) and committing a batch only after it is written to the landing table.
It discards that progress at startup for a process-lifetime engine, and the writer now takes AWS stream records, so Redshift no longer uses DynamoDbStreamService or DynamoDbStreamRecord, whose SHARD_ID is now package-private.
2026-09-26 01:08:45 -05:00
Priamo Germosen 0a4320132d feat(ecs): hold 169.254.170.2 on the task's network with a small proxy container (#4293)
Adds EcsCredentialsProxy, which launches one small socat container per Docker
network, on first use, holding the address AWS SDKs hardcode for container
credentials and forwarding to EcsTaskRoleCredentialsServer over
host.docker.internal. Reuses the same floci/network-helper:local image and
build-on-first-use logic as security-group enforcement (now factored into
LocallyBuiltHelperImage, shared by both).

Docker accepts a link-local address request even when the runtime then drops
it (the review discussion on #4063), so the bind is never trusted from the
API call alone: after start, an actual HTTP round trip through the address,
socat, and to the real server is required before the proxy is considered
ready, not just that the address shows up on the interface. A prior version
of this checked only the interface, which has a real race between the
address appearing and socat finishing its bind; the end-to-end check is what
catches both that and a genuinely dropped LinkLocalIPs.

Proven against a real Docker daemon: a plain container with its own
169.254.0.0/16 address (what the follow-up EcsContainerManager wiring gives
each task container) fetches real credentials through the proxy end to end.
That same test corrects an assumption from earlier discussion: a task
container needs an address in that range to reach the proxy at all. Without
one, its routing table has no connected route for 169.254.0.0/16, so the
kernel routes toward the default gateway instead of resolving the peer
directly, and the connection is refused before it reaches the proxy's
socket, the same symptom a completely absent listener produces. This is
exactly why the original design in #2987 gave every task container its own
link-local address; that part of the design was right.

EmulatorLifecycle now starts and stops the credentials server, and runs the
session sweep, gated on the same enabled() flag: previously the flag did
nothing at all, since nothing in main called it after three merged PRs.
EcsCredentialsProxy also implements ContainerTeardown, so its proxy
containers are removed on shutdown and on /state/reset instead of
outliving either indefinitely. Full task wiring (EcsContainerManager
actually issuing credentials and giving task containers their own
link-local address) is still a separate follow-up.
2026-09-26 01:06:57 -05:00
MIdhun f29c2b1c95 fix(kms): return an empty Description when CreateKey omits one (#4349)
* fix(kms): return an empty Description when CreateKey omits one

* fix(kms): return an empty Description for stored keys without one
2026-09-25 23:17:59 -04:00
David 0d813adf95 feat(glue): create, run and chain triggers (#4436)
Glue had no triggers: CreateTrigger and the rest answered InvalidAction.
Add CreateTrigger, GetTrigger, GetTriggers, ListTriggers,
BatchGetTriggers, UpdateTrigger, DeleteTrigger, StartTrigger and
StopTrigger.

StartTrigger runs an ON_DEMAND trigger's actions. An activated
CONDITIONAL trigger fires when a watched job run or crawl finishes in
the named state, evaluated after every Glue request, so a chain of
triggers completes within the request that starts it when runs finish
at once. Runs started by a trigger carry its TriggerName. SCHEDULED
triggers are stored and can be activated but do not fire on a timer.

Part of #4380
2026-09-25 23:14:51 -04:00
Hector Ventura 7a583cc293 fix(sfn): resolve Reference Paths rooted at the Context Object (#4445)
* fix(sfn): resolve Reference Paths rooted at the Context Object

ASL accepts a string_sampler wherever it accepts a Reference Path, and a Context Object path ($$) is one of its three spellings, so a definition that deploys on AWS was rejected or silently mishandled here.

Validation rejected $$ outright. isReferencePath required a $-rooted path, so CreateStateMachine answered "Value is not a Reference Path" for the six Map numeric path fields (MaxConcurrencyPath, MaxItemsPath, ToleratedFailureCountPath, ToleratedFailurePercentagePath and the two ItemBatcher ones). The walk now strips a $$ root and keeps the existing strictness that rejects wildcards, filters and slices.

Resolution never saw the Context Object. Five sites called the context-free resolvePath overload, so an accepted $$ path resolved to a missing node: InputPath narrowed the state input to null, OutputPath returned null, Wait's SecondsPath fell through without waiting at all, Wait's TimestampPath failed with "Invalid Timestamp: null", and the ItemReader's MaxItemsPath failed with "MaxItems must resolve to an integer of 0 or more", each blaming the value rather than the unresolved path. applyInputPath and applyOutputPath now take the Context Object and it is threaded through all fifteen state-handler call sites, each of which already received it.

StepFunctionsValidateStateMachineDefinitionIntegrationTest used "$$.Execution.Input.count" as its example of an invalid Reference Path, so the test pinned the defect and CI stayed green while the behaviour was wrong. It now uses "$.counts[*]", which is genuinely not a Reference Path, and that assertion still passes against the unpatched validator.

Grammar reference: ASLParser.g4 input_path_decl:85, output_path_decl:91, seconds_path:110, timestamp_path:115, max_concurrency_path:128, max_items_path:330, tolerated_failure_count_path:336, tolerated_failure_percentage_path:342, all string_sampler at :475.

* test(sfn): pin Context Object Wait paths through the sleeper seam and execute Map batch and tolerance paths

The two Wait cases timed the whole execution from the client, so setup and polling counted toward the wait and they spent about two seconds proving a path resolves. They now live in AslExecutorWaitStateTest, where the fixed clock and recording sleeper assert the exact requested pause for SecondsPath and TimestampPath rooted at $$.

MaxItemsPerBatchPath and ToleratedFailureCountPath were only validated with a $$ root; two execution cases now run a distributed Map that reads each from the Context Object, with InputPath narrowing the input so a resolver that sees only the state input cannot pass.

applyOutputPath drops its state-input parameter, which it never read.
2026-09-25 22:46:41 -04:00
Mario Toffia f51679c1f6 fix(iot): parse exponent and large integer literals in rule SQL (#4441)
A number literal written with an exponent (1e5, 1E-3) or an integer beyond 64 bits failed to parse, so in the default lenient mode the rule fell back to a passthrough that ignored WHERE, and in strict mode CreateTopicRule was rejected.
The tokenizer now reads an optional exponent and such literals become decimals, following the JSON number syntax AWS IoT SQL uses for literals.
2026-09-25 22:27:02 -04:00
Vũ Thế Huy cee5b441d9 fix(lambda): drop a DynamoDB Streams batch whose OnFailure send fails (#4338)
* fix(lambda): discard streams records on delivery failure

* test(lambda): align streams failure test with discard behavior

* fix(lambda): log stream destination refusal once
2026-09-25 20:45:54 -04:00
Vũ Thế Huy c3c5c16c81 fix(lambda): support async retries and dead-letter queue (DLQ) for asynchronous invocations (#4251)
* fix(lambda): support async retries and dead-letter queue (DLQ)

- Add retry loop honoring MaximumRetryAttempts and MaximumEventAgeInSeconds in LambdaExecutorService
- Deliver original payload and message attributes (RequestID, ErrorCode, ErrorMessage) to SQS/SNS DLQ in AsyncInvokeDestinationRouter
- Give precedence to OnFailure destination over DeadLetterConfig
- Wrap EventInvokeConfig queries in RequestScopes.callAs for correct account partitioning
- Add comprehensive unit and integration tests covering retries and DLQ delivery

Closes #4194

* test(lambda): cover cross-account DLQ delivery

* fix(lambda): add missing async destination test helper

* test(lambda): allow async retry attempts in chain guard test

* fix(lambda): preserve async result on age expiry
2026-09-25 20:35:23 -04:00
Aniket Shukla cd9843f5bd fix(sts): preserve assumed role session identity (#4403)
* fix(sts): preserve assumed role session identity

* test(sts): cover federated caller identity round trips
2026-09-25 20:29:14 -04:00
lex00 4b15ca8950 fix(ec2): deliver flow log records in the format the flow log declares (#4429)
* fix(ec2): deliver flow log records in the format the flow log declares

record took no format argument and emitted all 29 available fields in
alphabetical order every time. Only the header line varied, so a flow log
created with a six field LogFormat wrote a six field header above 29 field
rows, and a reader following that header took the wrong value for every
column.

The field list now reaches record, which resolves a value per token. A field
this emulator carries no value for keeps its column and reads "-", since
dropping it would shift every later value one place left against the header
the caller asked for.

A flow log with no LogFormat delivers the version 2 fields in the documented
order rather than the alphabetised superset. The version a record reports is
now the highest its selected fields belong to, in place of a fixed 5.

* fix(ec2): keep every LogFormat token, whatever its spelling

The token pattern matched lowercase names only, so a format naming ${DSTADDR}
lost that column from the header and every row. Any non-blank token now holds
its column and reads "-" when there is no value for it.

A field outside the version table counts as the highest version that table
defines rather than the lowest. The table is complete through version 5, so an
unlisted field belongs to a later one, and calling it version 2 labelled a
record that plainly was not one.

Row assertions go through a helper that fails on a delivery carrying only a
header, so none of them can pass without seeing a record.
2026-09-25 20:21:34 -04:00
Hector Ventura 0e8f965cb6 fix(core): mint every ARN in the request's partition (#4444)
* fix(core): mint every ARN in the request's partition

The build side of the multi-partition plan. 123 of the 126 gated arn:aws: literals in src/main now go through AwsArnUtils.Arn.of for regional resources, RegionResolver.buildGlobalArn for regionless ones minted under a request, and Arn.global with the region's partition where only a region is in scope, so a resource created in cn-north-1 or us-gov-west-1 carries arn:aws-cn: or arn:aws-us-gov:. CloudFormation's AWS::Partition and AWS::URLSuffix pseudo-parameters follow the stack region instead of a literal aws and amazonaws.com, and the SAM transform emits arn:${AWS::Partition}:... as the real translator does.

Seven literals are escaped with a stated reason: the stub-resource marker, the three Greengrass runtime ids from the Lambda Runtime enum, S3 Control's error text, and the two console client ids. The three still gated (the managed policy catalog, Flink and the RDS proxy validator) belong to later phases.

ResourceExplorer2IntegrationTest holds every listed ARN to its region's partition again; P0 had relaxed it to commercial regions while China-region resources were still minted arn:aws:.

Part of #4272

* fix(s3): evaluate a bucket policy against the bucket's own partition

A bucket policy names its bucket in the partition of the bucket's region. The authorization paths built the resource ARN from the request's partition instead, so with bucket names shared across regions a same-account request signed for cn-north-1 against a us-east-1 bucket was checked against arn:aws-cn:s3:::bucket/key, missed an explicit deny on arn:aws:s3:::bucket/*, and was allowed. The seven S3Service call sites now take the partition from the bucket's region, which also drops their dependency on a RegionResolver that the package-private test constructors leave null.

* fix(iam): match S3 resource ARNs against the bucket's own partition under IAM enforcement

IamEnforcementFilter built every S3 resource ARN through a regionless Arn.of, which always yields arn:aws:. Once AWS::Partition follows the stack region, a bucket created in cn-north-1 gets a policy naming arn:aws-cn:s3:::bucket/*, and under IAM enforcement its statements never matched, so an explicit deny was skipped.

ResourceArnBuilder now mints S3 ARNs in the request region's partition, which is right for a bucket that does not exist yet. ResourcePolicyProvider gains resolveResourceArn, a default no-op, and S3ResourcePolicyProvider re-mints an existing bucket's ARN in the partition of the bucket's region before any identity or resource policy is evaluated. S3Service.bucketPartition is the single rule for both layers and for the CopyObject source and presigned POST ARNs in S3Controller.

S3PartitionBucketPolicyIamEnforcementIntegrationTest runs with IAM enforcement alone, so S3's own policy check cannot deny first: the China-bucket deny fails without this change, and the cross-partition deny on a us-east-1 bucket fails if the re-minting step is skipped.
2026-09-25 20:15:49 -04:00
David 93c7b1f93f feat(glue): start and stop crawls, crawler metrics, listing and schedules (#4427)
A crawler could be defined but never run: StartCrawler answered
InvalidAction and a crawler stayed READY with no LastCrawl. Add
StartCrawler, StopCrawler, GetCrawlerMetrics, ListCrawlers,
BatchGetCrawlers, UpdateCrawlerSchedule, StartCrawlerSchedule and
StopCrawlerSchedule.

Crawls follow the crawler state machine without reading data and are
settled on read, as job runs are;
floci.services.glue.crawler-run-duration-seconds (default 0) can keep a
crawler RUNNING. UpdateCrawler and DeleteCrawler are refused while a
crawl runs, and DeleteCrawler removes the crawl history.

Part of #4380
2026-09-25 18:50:30 -04:00
Allen Sanborn 6656c8e5df feat(backup): configure a vault with an access policy, notifications and a lock (#4412)
* feat(backup): configure a vault — access policy, notifications and vault lock

CreateBackupVault worked, and then every write that configures the vault it
just created was unrouted. PutBackupVaultAccessPolicy, PutBackupVaultNotifications
and PutBackupVaultLockConfiguration all matched no route, so a vault could be
created but never given a policy, a lock or a notification target — which is most
of what a vault is configured for.

The two GET paths already existed as deliberate stubs that always threw
ResourceNotFoundException, on the reasoning that these are "never-configured" in
the emulator. That error contract was right and is kept for the genuinely
unconfigured case; what was missing was any way to configure one.

Adds the three PUTs, the three DELETEs, and real read paths for the two GETs:

  PUT|GET|DELETE  /backup-vaults/{name}/access-policy
  PUT|GET|DELETE  /backup-vaults/{name}/notification-configuration
  PUT|DELETE      /backup-vaults/{name}/vault-lock

Details worth knowing:

- Vault Lock has two modes and the difference is the point of the feature. With
  ChangeableForDays the lock is governance mode: LockDate is set that far ahead
  and the lock stays removable until then. Without it the lock is compliance
  mode, immutable immediately. Modelling only the first would make a compliance
  lock look reversible, which is exactly the property a caller sets one to get.
  A locked vault also refuses DeleteBackupVault.

- The lock fields live on BackupVault because AWS returns them from
  DescribeBackupVault. The access policy and notification configuration do not:
  AWS exposes each only through its own Get, so they are held in their own
  stores rather than as vault fields, which keeps DescribeBackupVault from
  growing members real AWS does not send. Locked is a primitive so it is always
  present, matching AWS and letting a client tell "not locked" from "not
  modelled".

- BackupVaultEvents outside the documented set are rejected rather than stored.
  An emulator that accepts a misspelt event and echoes it back lets a config
  real AWS refuses pass a local test.

- Deleting an unset policy or notification configuration is a no-op, so a
  Terraform destroy re-run does not fail, and both sub-resources are dropped
  with their vault so a recreated vault of the same name does not inherit them.

Reported as #4103, found by running the Gruntwork Terraform corpus against
Floci: four roots in terraform-aws-data-storage fail on this and nothing else.

Tests: 16 new integration cases covering both lock modes, the round-trips, the
rejected event, the idempotent deletes and the recreate-under-the-same-name case.
61 Backup-related tests pass.

* fix(backup): correct the vault lock modes, the delete rule and the event list

Three corrections from review, all of them cases where the first version of this
branch was confidently wrong about AWS.

1. THE TWO LOCK MODES WERE INVERTED. ChangeableForDays PRESENT means compliance
   mode — a lock date that far ahead, immutable on and after it. ABSENT means
   governance mode — no lock date, removable at any time. The reference says so
   directly: "If this parameter is not specified, you can delete Vault Lock from
   the vault using DeleteBackupVaultLockConfiguration or change the Vault Lock
   configuration using PutBackupVaultLockConfiguration at any time." The previous
   revision had it the other way round, which turned AWS's freely removable
   governance lock into a permanent one and its vault into an undeletable one.

2. A LOCK NO LONGER BLOCKS DELETING THE VAULT. A lock protects the recovery
   points, not the vault shell: AWS deletes an empty vault even under a compliance
   lock, and the pre-existing non-empty check is already the case AWS refuses. The
   added check could therefore only ever fire where AWS succeeds — and it reached
   outside this service, since BackupVaultCfnProvisioner deletes vaults during
   stack teardown and tolerates only not-found.

3. THE EVENT LIST WAS 17 OF 30. Missing CONTINUOUS_BACKUP_INTERRUPTED, the three
   RECOVERY_POINT_INDEX* values, the three EKS_* values and the six ACCESS_POINT_*
   values. Since unknown values are rejected with 400, each missing one failed an
   apply that AWS accepts. Rejecting is still right; the data was stale.

The tests asserted the inverted lock behaviour, so the suite could not have caught
any of this. Both modes are now pinned separately and in opposite directions, and
the gaps review named are covered: the cooling-off floor, the retention floors,
reconfiguring a governance lock in place, deleting an empty locked vault, the
object-bodied Policy branch, and the notification store being dropped with its
vault.

66 Backup-related tests pass, including the CloudFormation provisioner suites.

* style: use -- rather than an em dash in added prose

AGENTS.md forbids em dashes in all content and the conformance check flags
them. Five in lines this branch added, across the service, the notifications
model and the docs page. Upstream lines that already carry one are left alone.

* fix(backup): reject a non-integral vault lock retention instead of coercing it

longOrNull used JsonNode.asLong(), which silently accepts anything: 1.5
truncates to 1, true becomes 1, and the string "7" parses to 7. AWS rejects a
non-integral value for a long-typed member, so the emulator was letting a
request AWS refuses succeed against a number the caller never sent, and a
retention floor could be set from it.

Rejects with InvalidParameterValueException instead, matching the existing
shape in KinesisJsonHandler#optionalMaxRecordSize and
TimestreamInfluxDbValidation, which both refuse on !isIntegralNumber().

Found by Greptile on fork PR #16. Covered by a test that drives all three
coercions and requires each to 400.

* style(backup): import ChronoUnit instead of naming it inline

AGENTS.md requires used classes to be imported unless there is a genuine name
collision, and putBackupVaultLockConfiguration spelled
java.time.temporal.ChronoUnit.DAYS in full. There is no ChronoUnit collision in
this file.

Found by Greptile on fork PR #16, in its first review that saw the real 6-file
diff rather than the 132 files a stale base had been handing it.

* fix(backup): reject a retention value too large to represent, and free the order clash

Two follow-ups from review of the previous commit, both of which it got wrong.

THE COERCION CLASS WAS NOT CLOSED. isIntegralNumber() alone still let one
through: 99999999999999999999 IS an integral number, and longValue() truncates
it to 7766279631452241919, which then passed the retention checks as though the
caller had sent it. That is the same silent-acceptance the commit claimed to
fix, one rung up. Now guarded with canConvertToLong() as well, matching
KinesisJsonHandler#optionalMaxRecordSize, which pairs isIntegralNumber() with
canConvertToInt() for exactly this reason.

Proved by weakening the guard and running the ordered class: exactly one
failure, lockRejectsANonIntegralRetention, "Expected status code <400> but was
<204>" -- the vault lock silently set from the truncated number. Running that
test alone is not a valid control here: it 404s on a vault the earlier ordered
tests create, so it fails for the wrong reason and proves nothing.

THE NEW TEST REUSED @Order(136), already held by the retention-floor test.
Harmless in effect, since both only make requests that 400, but their relative
order was unspecified. Moved to the first genuinely free number rather than the
next one along, which was also taken.

* fix(backup): bound every Vault Lock day value at AWS's documented 36,500

AWS: "It must be a number no less than 3 and no greater than 36,500; otherwise,
an error will return." Only the floors were checked, which left two holes from
one root cause.

MinRetentionDays=40000 was accepted here and refused by AWS. That is the shape
this corpus exists to find: a Terraform configuration with changeable_for_days
= 40000 applies locally and fails for real.

Worse, Long.MAX_VALUE is a perfectly good long, so it survived the integral
check added in 5e1bed0ef -- that commit fixed representability, not the
documented range -- and reached Instant.plus(value, DAYS), which throws
ArithmeticException: long overflow. The only ExceptionMapper in the tree handles
AwsException, so it escaped as HTTP 500 rather than the documented 400. Bounding
the value makes the overflow unreachable rather than catching it afterwards.

The three floor checks become one requireDayRange so the range is stated once.

Both tests fail with the ceiling removed, which is the state before this commit:
the 40000 case and the Long.MAX_VALUE case each go from 400 to something else.

* docs(backup): stop the branch contradicting itself, and clear the order clash

Four corrections from review, all to things this branch introduced.

docs/services/backup.md:15 was changed here to "Delete an empty, unlocked
backup vault", which contradicts :132 ("A lock does not stop the vault being
deleted") and the code, where deleteBackupVault deliberately omits a lock check.
The AWS Vault Lock guide is with :132 and the code: the vault itself can be
deleted if it is empty. Line 15 was the wrong one.

BackupVaultCfnProvisioner's javadoc still said AccessPolicy, Notifications and
LockConfiguration "have no counterpart in the emulated vault". They have
counterparts now, which this branch added. The provisioner still ignores all
three, so a template declaring AccessPolicy reports CREATE_COMPLETE with nothing
attached; that is now stated as a gap in the provisioner rather than implied to
be a gap in the service. Wiring them through is separate work.

The lock log line printed "changeable for null day(s)" on a governance lock,
which is the mode where the value is absent by definition. It now names the mode.

The two tests added in the previous commit took @Order(141), which an existing
test already held -- the same clash 5e1bed0ef had to clear once. They move to the
end as 142 and 143, and the file now has no duplicate order. The pre-existing 140
declared between 136 and 137 is left alone: it executes correctly and moving a
method would be churn.

* fix(backup): accept an absent Policy on PutBackupVaultAccessPolicy

The PutBackupVaultAccessPolicy reference documents Policy as "Type: String,
Required: No", and we refused a request without one with HTTP 400. A call real
AWS accepts therefore failed locally, which is the exact divergence class this
branch exists to catch rather than introduce.

What AWS does with an omitted Policy is undetermined: the reference does not say
whether it clears the stored policy or stores an empty one, and we have not
measured it against real AWS. Clearing is the behaviour chosen here, on two
grounds. It leaves the vault carrying exactly the policy the request carried,
rather than silently retaining one the caller did not send, and the end state is
readable back through GetBackupVaultAccessPolicy, so a caller can tell what
happened. Storing an empty string would make that read return a value that is
not a valid policy document.

Present-but-empty stays an InvalidParameterValueException: an empty string is
supplied and unusable, which is a different fault from not supplying one.

The pinning test at Order(111) now asserts the clear, and it reads the policy
back through a separate GET after Order(110) has written one, so it fails if the
omission is refused and also if it is accepted as a no-op. Order(115) keeps the
old empty-document assertion.

* fix(backup): answer a missing notification parameter with MissingParameterValueException

PutBackupVaultNotifications lists MissingParameterValueException, "Indicates
that a required parameter is missing", in its Errors section, and we answered
InvalidParameterValueException for both an absent SNSTopicArn and absent
BackupVaultEvents. An SDK maps __type onto a typed exception, so a caller
catching the error AWS documents for this case never saw it.

Present-but-empty keeps InvalidParameterValueException, which is the deliberate
half of the distinction: "BackupVaultEvents": [] was supplied and is unusable,
which is not the same fault as not supplying it. A blank SNSTopicArn is now
treated the same way, where before it collapsed into the missing case.

The controller has to carry the distinction too: readStringList answers an empty
list for an absent member, so the service could not tell [] from absent. It now
passes null when the member is missing or null.

No new exception class or mapper was needed. AwsException takes the error code
as a string and jsonType() passes through any code not in its Query-to-JSON
remapping table, so MissingParameterValueException surfaces as HTTP 400 with
__type MissingParameterValueException. The test asserts that on the wire rather
than trusting it.

* fix(backup): quote the real Vault Lock day limits, and drop the invented MinRetentionDays ceiling

Two lines of this branch, one in BackupService and one in the test, attributed a
quotation to AWS that the PutBackupVaultLockConfiguration reference does not
contain: "no less than 3 and no greater than 36,500", presented as a single
ceiling covering every day value. The reference states three separate things,
per field:

  ChangeableForDays  "you must set ChangeableForDays to 3 or greater" and
                     "The maximum value you can specify is 36,500 days"
  MaxRetentionDays   "The longest maximum retention period you can specify is
                     36500 days"
  MinRetentionDays   "The shortest minimum retention period you can specify is
                     1 day", and no maximum at all

The fabricated sentence is replaced by those three, attributed to the field each
one belongs to. No claim about AWS appears here that is not read from the
reference; the floor of 1 on MaxRetentionDays is left in place but is no longer
presented as an AWS citation, because the reference does not state one.

MinRetentionDays no longer carries the 36,500 ceiling. The choice was to drop it
rather than keep it labelled as our own inference: applying an undocumented
maximum refuses a value real AWS accepts, which is the same divergence class the
Policy fix two commits back removed, pointing the other way. Nothing else
depends on the bound. Only ChangeableForDays reaches Instant.plus, so the
overflow the ceiling was also protecting against stays unreachable, and the
min-versus-max cross-check still applies when both are supplied.

requireDayRange takes a nullable ceiling, null meaning the reference documents
no maximum. Order(142) now asserts the ceiling on the two fields that have one
and asserts that MinRetentionDays 40000 is accepted and reads back, so the
dropped bound is pinned rather than merely absent.

* test(backup): pin the canConvertToLong guard with a value that wraps into range

The !n.canConvertToLong() half of the integral-number guard was load-bearing and
untested: deleting it left all 58 tests green. Order(140) fed it
99999999999999999999, which longValue() truncates to 7766279631452241919, and
that is above the retention ceiling, so the range check rejected the request
whether or not the guard was there. The test could not see the difference.

The value is now 18446744073709551623, which is 2^64 + 7: longValue() keeps the
low 64 bits and it wraps to 7, comfortably inside the valid range. Nothing
downstream rejects it, so the guard is the only thing standing between the
request and a lock configured from a number the caller never sent.

Verified by deleting !n.canConvertToLong() from the guard and re-running:
lockRejectsANonIntegralRetention fails, 204 where it expects 400. Restored, it
passes. Production code is unchanged apart from comments.

Also drops "#16" from the Greptile attribution in BackupController. On a fork PR
it is a live reference; reaching floci-io/floci it would auto-link to an
unrelated upstream issue. The comment's worked example is updated to the value
the test now uses.

* test(backup): cover the blank SNSTopicArn rejection, which no test reached

3c4e6321f split a blank SNSTopicArn out of the missing case and gave it its own
InvalidParameterValueException, and nothing exercised it: deleting the
snsTopicArn.isBlank() branch left all 59 tests green, so a vault would have been
configured to notify an empty topic ARN with no test noticing. It was also the
asymmetry with the blank-Policy case, which Order(115) does cover.

Order(122) now sends "SNSTopicArn": "" alongside a valid event list and expects
400 InvalidParameterValueException naming SNSTopicArn, which is the only request
shape that reaches that branch: absent is answered earlier by the missing case,
and a non-blank ARN passes both.

Verified by deleting the isBlank branch and re-running:
notificationsRequireATopicAndAtLeastOneEvent fails on the new case, 204 where it
expects 400. Restored, 59 pass. Test-only change.

* docs(backup): record the three vault decisions that lived only in javadoc

AGENTS.md asks for intentional deviations to be documented, and three of this
branch's user-visible decisions were reachable only by reading the source or the
commit log.

The omitted-Policy behaviour is the one a user is most likely to be surprised
by, and it is written with the same hedge the javadoc carries: AWS's behaviour
is undocumented and unmeasured, and clearing is the choice we took, not an
observed AWS behaviour. It is not upgraded to a measured claim here.

The other two are the MissingParameterValueException versus
InvalidParameterValueException split on PutBackupVaultNotifications, and the
per-field Vault Lock day limits, including that MinRetentionDays deliberately
carries no maximum because AWS documents none.

Documentation only. backup.md is hand-written, not generated, so docs-sync has
nothing to say about it; docs-check passes once this is committed, because its
last gate is git diff --exit-code over docs/.

* docs(backup): stop claiming AWS behaviour the reference does not state

"Deleting an access policy that is not set is a no-op, matching AWS: the
operation is idempotent" was an AWS attribution nobody had read. The
DeleteBackupVaultAccessPolicy reference lists ResourceNotFoundException among
this operation's errors and does not say what an unset policy does, so AWS may
well not be idempotent here. The no-op is kept, described as Floci's choice, and
the reference's silence is stated rather than papered over.

The same audit over everything these commits added turned up five more claims
that outran the reference. None was a fabricated quotation; each asserted an AWS
behaviour inferred from the reference rather than read in it.

Three inferred acceptance from silence: "no documented maximum" was written as
"inventing one would refuse a value real AWS accepts" in BackupService, "stricter
than AWS" in the test, and "would refuse a value real AWS accepts" in backup.md.
An undocumented limit is not an absent limit, so all three now say the bound is
a risk we decline to take, not a measured AWS acceptance.

Two inferred which error AWS picks. The reference names
MissingParameterValueException for a missing required parameter; it does not say
what AWS returns for a parameter that is present and unusable. "AWS answers them
differently" and "an error real AWS would not have returned" are now scoped to
what the reference actually names, with the present-but-unusable half called
Floci's reading.

Comments and documentation only. Verified mechanically: with comments stripped
and blank lines ignored, the executable content of BackupService.java,
BackupController.java and BackupIntegrationTest.java is identical to
3cb81fd41, 524 lines to 524 lines in the service.

* fix(backup): make the vault lock enforce something, and stop accepting values it cannot use

Six review findings on this branch, four of them one shape: state written that
nothing consumed. The lock is the clearest case. PutBackupVaultLockConfiguration
succeeded, DescribeBackupVault reported Locked, and every recovery point the lock
was supposed to protect deleted exactly as before, because deleteRecoveryPoint
read no lock field. getMinRetentionDays and getMaxRetentionDays had zero readers
anywhere in the tree. The lock was decorative.

Both directions of what a lock does now hold. DeleteRecoveryPoint refuses a
recovery point younger than MinRetentionDays while the vault is locked: Vault Lock
"prevents the deletion of recovery points before their retention periods expire".
StartBackupJob refuses a lifecycle whose DeleteAfterDays falls outside
[MinRetentionDays, MaxRetentionDays]: "backup jobs will fail if the lifecycle
policy of the backup plan is outside the vault lock's retention period". The second
is what gives MaxRetentionDays a reader at all, and it matters for the reason this
emulator exists: a configuration pairing a lock with a shorter plan lifecycle used
to apply cleanly here and fail its first backup on real AWS.

Governance mode enforces as compliance mode does, and the docs say so. Real AWS
lets a principal holding backup:DisableGovernanceRetention override a governance
lock; Floci does not model that permission, so it cannot grant the override.
Stricter for that one caller, identical for every other, and the safe direction: a
local test that deletes a protected recovery point and passes would be describing
behaviour that needs a specific permission to reproduce.

Two validation gaps, both the emulator being more permissive than AWS, which is
the one direction that costs a user real time -- it passes locally and the deploy
is where they find out:

  - A Policy is now required to parse as a JSON object. The blank check accepted
    any other string, so `not a policy` was stored, PUT reported success and GET
    returned it unchanged. Syntax only; nothing here evaluates what a policy
    grants, and PutBackupVaultAccessPolicy does not list
    MalformedPolicyDocumentException among its errors.
  - SNSTopicArn must be a JSON string. asText() turned the number 123 into the
    nonblank string "123", which passed every present-and-nonblank check and was
    stored as the topic. Same coercion already fixed in longOrNull on this branch,
    in the other direction, and it gets the same answer.

Vault teardown now removes the sub-resources BEFORE the vault record, and
CreateBackupVault sweeps both sub-resource keys before taking ownership of a name.
There is no transaction across the three stores, so the order is load-bearing:
with the vault removed first, a concurrent recreate could be configured in the gap
and the deletes still to come would erase the new vault's configuration.

Stated plainly because the measurement is unflattering: the recreate test still
passes with the create-side sweep removed, since deleteBackupVault already covers
the sequential path. The interleaving the sweep exists for is not reachable from a
single-threaded HTTP test, so no test pins it. Keeping it is a judgement that the
race is real, not a claim that it is covered. Every other test here was measured
failing with its fix reverted -- four of the six do, and the fifth is the negative
control that must pass either way.

Two findings are documented rather than fixed, in docs/services/backup.md under
Not Yet Supported, because each is its own change and neither belongs in a
sub-resource PR:

  - Notification delivery. The configuration is stored and reported; no vault
    event is ever published to the topic.
  - Access policy enforcement. The policy is stored and reported; no authorization
    path consults it. S3 bucket policies are the only resource policies any Floci
    service enforces today, so this matches the tree rather than being specific to
    Backup. Said out loud because a stored-and-ignored policy is otherwise
    indistinguishable from an enforced one.

* fix(backup): key vault sub-resources per vault, and stop an absent lifecycle bypassing the lock ceiling

Both findings from the second review round, and both were mine to own.

**An omitted lifecycle bypassed MaxRetentionDays.** The previous commit returned early
whenever DeleteAfterDays was missing, reasoning that indefinite retention cannot exceed a
maximum. That is backwards: retaining forever is the largest retention there is, so it
exceeds every finite ceiling, and dropping one member from the request was a one-line
bypass of the limit the lock exists to impose. An absent lifecycle is now refused when the
lock sets a maximum, and still accepted when it sets only a minimum, because a floor IS
satisfied by indefinite retention. The scoping is Floci's reading rather than a quotation:
the reference states the rule for a lifecycle outside the window and does not spell out the
absent case.

**The create-side sweep traded one race for a worse one.** Two creates of the same name can
both pass the existence check, so if a policy were applied against the first vault before
the second reached its sweep, the sweep would delete a live configuration while both creates
reported success. Removing a configuration that a caller had just successfully applied is
worse than the stale-record problem the sweep was there to prevent.

So the shared key is removed rather than policed. Sub-resources are keyed per vault
INCARNATION -- vault key plus creation date -- which means a new vault cannot see an old
vault's records, and cleanup for an old vault cannot touch a newer vault's. No sweep, and no
dependence on the order two stores are written in. The delete path still removes the vault's
own sub-resources, now because they are its own rather than because nothing else has claimed
them yet, and still dependents-first so any observable intermediate state is a vault without
configuration rather than a configuration without a vault.

Two vaults of one name within the same second would still collide on the key, which is why
the delete path does its own cleanup rather than relying on the key alone.

Tests: the absent-lifecycle refusal was measured failing with its guard reverted, and
aLockWithOnlyAMinimumStillAcceptsAJobWithNoLifecycle is its negative control -- refusing
there would refuse a request AWS accepts. subResourcesAreKeyedPerVaultIncarnationRatherThanPerName
pins the sequential behaviour and says in the test itself that it cannot pin the races,
which need two interleaved requests and are not reachable from a single-threaded HTTP test.
67 backup integration tests plus both CloudFormation backup suites pass.

* fix(backup): make CreateBackupVault atomic for a name, and take the parser by injection

Three findings from the third round, all correct.

**The sub-resource key was only as unique as the creation date.** Two creates of the same
name racing within one second could both find the name free, both write, and share a
sub-resource key, so the second vault could read configuration applied to the first.
AlreadyExistsException would never have fired either. The key was not the real problem: the
unsynchronised check-then-write was, and AWS's CreateBackupVault is atomic for a name.

Create and delete now hold a per-name monitor, following SecretsManagerService#lockFor and
KinesisService's append locks. That makes the existence check meaningful, which in turn is
what makes the creation date unique per name and the incarnation key sound. The javadoc says
so rather than leaving the key looking self-sufficient, and the delete path still removes its
own sub-resources for a record surviving any other way.

**The ObjectMapper came in through a field initializer**, against the AGENTS.md constructor
injection rule. Taken through the constructor now, like every other collaborator here. No
caller constructs BackupService by hand, so nothing else changes.

**Two tests spelled class names inline** rather than importing them. java.util.Map is
imported and used, and the policy request builds its body with Map.of instead of constructing
an ObjectMapper inline to serialise one string.

67 backup integration tests and both CloudFormation backup suites pass.

* test(backup): wait for a backup job to complete instead of sleeping

Three tests stood a fixed Thread.sleep(2000) in for a wait-on-condition, against a
job-completion-delay-seconds=1 test config. A 2x margin is not a guarantee: on a loaded
runner the job is simply still RUNNING when the sleep expires, and the failure then lands
on the assertion that follows -- State, RecoveryPointArn, or a delete's status code --
none of which is the behaviour under test. That is the worst shape of flake, because it
accuses the wrong code.

awaitJobCompleted polls GET /backup-jobs/{id} for COMPLETED, following the awaitility
idiom already used in 34 files here, AppSyncExecutionIntegrationTest.awaitSchemaSuccess
most closely: atMost 10s, pollInterval 25ms. It returns as soon as the job finishes rather
than always paying the worst case, so the ceiling can be generous without costing time.

The third site was inside a try/catch rather than a bare call, which is why a scan for the
two obvious ones misses it; all three are the same wait and now share one helper. Removing
them also drops two throws InterruptedException clauses.

Measured on this machine, same 67 tests passing either way:
  before  Tests run: 67, Failures: 0, Errors: 0 -- Time elapsed: 9.569 s
  after   Tests run: 67, Failures: 0, Errors: 0 -- Time elapsed: 5.922 s
2026-09-25 18:43:33 -04:00
Priamo Germosen 3d35eabf51 feat(iam): finish the SAML provider lifecycle (#4360)
Adds UpdateSAMLProvider, DeleteSAMLProvider, TagSAMLProvider,
UntagSAMLProvider and ListSAMLProviderTags, and adds tags to GetSAMLProvider.

UpdateSAMLProvider re-parses a new SAMLMetadataDocument the same way
CreateSAMLProvider does and replaces the stored entity ID and certificate.
The document is optional on the request: omitting it (metadata == null) is
a no-op, but an explicitly empty one is invalid input, the same as
CreateSAMLProvider already rejects it as; the two are distinguishable at
the wire level and were previously treated the same.

The update replaces the stored provider with a newly built one rather than
mutating the existing, already-published object's fields one at a time:
assertion verification (StsQueryHandler) reads a provider via find() /
findForAccount() without taking providerLock, so setting entityId and
certificate as two separate writes on the live object could let it
observe one field updated and the other not. Publishing a fully-built
replacement through the same ConcurrentHashMap-backed store means any
reader, synchronized or not, sees either the old provider intact or the
new one intact, never a mix.

DeleteSAMLProvider's existence check now runs inside the same lock as the
delete itself, not before it: two concurrent deletes could otherwise both
pass the check before either removed the provider, so the second returned
success instead of NoSuchEntity, and a delete racing a recreate of the
same ARN could remove the newly created provider instead of the deleted
one.

DeleteSAMLProvider itself does not check or update any role whose trust
policy still references the provider's ARN. This corrects an assumption
from the original gap-report plan (which expected a delete-blocked-while-
referenced check, by analogy with DeletePolicy's attachment guard): AWS's
own docs say the opposite, that deletion always succeeds and it is a later
AssumeRoleWithSAML against the now-dangling ARN that fails, not this call.

GetSAMLProvider and ListSAMLProviderTags both sort their tags by key,
matching AWS's own documented behavior for both, which the same wording
in ListInstanceProfileTags's docs already established the precedent for.

Also completes AwsQueryController's IAM_ACTIONS fallback set for every
SAML provider action, including the three pre-existing ones
(ListSAMLProviders, CreateSAMLProvider, GetSAMLProvider), none of which
were there before, and adds SDK-client coverage for the whole SAML
provider lifecycle to compatibility-tests/sdk-test-java/IamTest.java,
which (like the three pre-existing SAML actions) had none.
2026-09-25 17:39:15 -05:00
Priamo Germosen 61e7f07fb6 fix(codeartifact): stop sidecar containers on state reset and nuke (#4411)
A state reset wiped every CodeArtifact repository record without
stopping the Docker containers backing them. Reposilite's one shared
instance kept running with nothing left to reconcile it against;
Verdaccio, one container per repository, leaked one per repository
that existed at reset time, every reset.

Neither manager implemented ContainerTeardown, the interface
ContainerTeardowns.stopAll already runs on both /state/reset and
/state/nuke, and at process shutdown in place of an ad hoc @Observes
ShutdownEvent handler. Implementing it on both replaces their existing
onStop methods with stopManagedContainers(), the same shutdown
behavior now also reached from a reset.

A repository-record walk in CodeArtifactService.beforeReset() was
added as an earlier attempt at this, then removed once ContainerTeardown
turned out to be the actual, already-established mechanism: it is
driven by what each pool is really tracking rather than by
still-existing repository metadata, so it does not miss a container a
delete raced against, and it is what the rest of the codebase already
relies on for the exact same problem (Batch, CodeBuild, SageMaker,
Timestream for InfluxDB).

Verified live: starting a repository's Verdaccio container, calling
/state/reset, and confirming via a real Docker query that the
container is gone, not just that some Java method ran.
2026-09-25 17:39:03 -05:00
Priamo Germosen 3b21bb7e7e docs(iam): name the issue the Query residual is tracked in (#4399)
The javadoc on servingCredentialScope said the Query case was tracked separately without saying where, which reads as aspirational. Point it at #4296, which carries the case and a reproduction.
2026-09-25 17:38:38 -05:00
Priamo Germosen 6f75f68aea refactor(docker): share the network-helper image build instead of copying it (#4406)
SecurityGroupFirewallManager built floci/network-helper:local from the
Dockerfile checked into Floci itself, because that image is never pulled
from a registry. A second caller needs the same thing, so the build moves to
LocallyBuiltHelperImage in core/common/docker and the existing caller uses
it rather than keeping its own copy: image resolution, the inspect-then-build
check, the tar of the Dockerfile, and the guard that only builds when the
caller is still pointed at Floci's own default all live in one place now.

No behaviour change. Split out of #4293, where the second caller lives, since
this stands on its own.
2026-09-25 17:38:12 -05:00
XuJian b66c433a9f feat(sfn): resolve dynamic ItemReader max items (#3731) 2026-09-25 17:22:31 -05:00
lex00 fd3696a9fc fix(ec2): report a flow log's custom LogFormat (#4386)
* fix(ec2): report a flow log's custom LogFormat

CreateFlowLogs parsed LogFormat and stored it on the flow log, and
DescribeFlowLogs never emitted it. A client comparing its declared format
against the live flow log saw the field unset every time and proposed the same
change on every plan.

XmlBuilder.elem skips a null, so a flow log created without a custom format
reports no element rather than an empty one.

LogGroupName is also in the model's FlowLog shape and is not parsed, stored or
emitted here. That is a missing input rather than a dropped round-trip, and it
needs a decision about how it sits alongside LogDestination, so it is left
out of this change.

* test(ec2): address the flow log format assertions by id

DescribeFlowLogs serves no filters, so the resource-id filter these tests
passed was ignored and both described every flow log in the region. The
negative test then found the other test's custom format whenever it ran
second. Capture the id CreateFlowLogs returns and describe that one log.

* test(ec2): validate the flow log format with the EC2 SDK client

AGENTS.md asks for management APIs to be exercised through an SDK client
rather than handcrafted requests alone. Ec2Client.describeFlowLogs decodes
logFormat as the field the create call set, and reports null when the flow
log was created without one.

* test(ec2): tolerate a null id when cleaning up the flow log test

List.of rejects a null, so a failed CreateFlowLogs would have thrown from
the finally block and left the VPC behind, masking the real failure.

* fix(ec2): report the default log format when none was set

CreateFlowLogs builds the flow log with the default format when LogFormat is
omitted, so the flow log carries one from that point and DescribeFlowLogs
reports it. Omitting the element left the same gap this branch set out to
close, one step further in.

DEFAULT_LOG_FORMAT is the version 2 fields in the order AWS documents. It is
separate from DEFAULT_HEADER, which is the alphabetised superset written as
the header line of a generated log file.

* docs(ec2): restore the DEFAULT_HEADER javadoc the new constant displaced

The new constant landed between DEFAULT_HEADER and its comment, leaving that
comment attached to nothing. It also called the value a version 5 field order,
which it is not. It is every available field in alphabetical order.
2026-09-25 16:40:36 -04:00
Kenshin Okinaka c08e594f49 fix(ses): emit SES v2 timestamps as epoch seconds with milliseconds (#4422)
ListEmailTemplates, GetContactList, ListContactLists, GetContact,
ListContacts, GetSuppressedDestination and ListSuppressedDestinations
wrote whole epoch seconds. AWS returns the millisecond fraction
(e.g. 1.790312384592E9), as the other SES v2 operations already did.
Every SES v2 timestamp now goes through SesV2Json.putTimestamp.
2026-09-25 15:29:45 -04:00
Vũ Thế Huy 6bdf14210e fix(redshift): accept s3table log destination and reject mutual snapshot restore params (#4340)
* fix(redshift): accept s3table log destination and reject mutual snapshot restore params

Closes #4242

* fix(redshift): preserve S3-table logging configuration and report status

Pass S3TableKmsKeyId and S3TableGranularity through EnableLogging, store them on Cluster, and serialize S3Tables in LoggingStatus responses.

* fix(redshift): validate S3-table logging settings

* fix(redshift): complete S3 table logging status
2026-09-25 15:20:20 -04:00
Niels Kootstra 26eafba246 fix(lifecycle): exit when startup is interrupted (#4420)
The InterruptedException branch in onHttpStart restored the interrupt
flag and logged, but never called Quarkus.asyncExit() like the other
startup failure branch does. An interrupted startup hook left the
process half-started instead of exiting.
2026-09-25 15:09:53 -04:00
Niels Kootstra 444e9e8d6a fix(sts): validate DurationSeconds (#4418)
* fix(sts): validate DurationSeconds

STS actions accepted any DurationSeconds value: non-numeric input
silently fell back to the default and no range was enforced. Validate
it against the AWS bounds (900-43200 for AssumeRole,
AssumeRoleWithWebIdentity and AssumeRoleWithSAML; 900-129600 for
GetSessionToken and GetFederationToken), returning ValidationError for
out-of-range values and InvalidParameterValue for non-numeric ones.

* test(sts): cover DurationSeconds accepted at the limits
2026-09-25 15:01:04 -04:00
Mario Toffia 5bad6774f6 refactor(dynamodb): isolate backend operation execution (#4379)
* refactor(dynamodb): route wire operations through a backend seam

Rename the native wire handlers to NativeDynamoDbJsonHandler and NativeDynamoDbStreamsJsonHandler.
Add DynamoDbOperations as the raw operation seam, plus typed DynamoDbItemAccess and DynamoDbTableAccess contracts.
Add NativeDynamoDbBackend behind the seam and DynamoDbBackendSelector as the one immutable selection.
Keep DynamoDbJsonHandler and DynamoDbStreamsJsonHandler as thin entry points that resolve account and region.
Add RequestScopes.callAsChecked and let AslExecutor delegate to it.

* refactor(dynamodb): route Java consumers through DynamoDbFacade

DynamoDbFacade hands out the selected item and table capabilities and is
now the one DynamoDB Resource Explorer provider in place of DynamoDbService.
CloudFormation, Step Functions, the IAM condition context and the Redshift
backfill call it with an explicit scope; the IoT dynamoDBv2 action writes as
the rule's owning account.
2026-09-25 14:57:13 -04:00
XuJian 0be4d07111 fix(rds): align snapshot copy and encryption responses (#4355)
* fix(rds): align snapshot copy and encryption responses

* fix(rds): clean failed restores in target regionfix(rds): clean failed restores in target region

* fix(rds): allow cross-region snapshot copies by ARN

* fix(rds): require target KMS key for encrypted cross-region copies
2026-09-25 14:50:59 -04:00
lex00 a33c4e0b00 fix(autoscaling): round-trip the whole target tracking configuration (#4369)
* fix(autoscaling): round-trip the whole target tracking configuration

DescribePolicies carried PredefinedMetricSpecification.PredefinedMetricType and
TargetValue and nothing else, so three members the model gives
TargetTrackingConfiguration were accepted at PutScalingPolicy and then absent
from the read.

CustomizedMetricSpecification was dropped whole, along with its MetricName,
Namespace, Statistic, Unit, Period and Dimensions. DisableScaleIn was dropped,
and so was ResourceLabel on the predefined specification.

A client comparing its configuration against the live policy therefore sees a
difference that never resolves, however many times it re-applies. A policy that
names neither specification still reports neither.

* fix(autoscaling): carry the Metrics form of a customized metric, and refuse a bad Period

CustomizedMetricSpecification.Metrics is the metric data query form, the way
metric math reaches a target tracking policy. I listed it when reading the
model and then built only the MetricName form, so a policy defined by queries
was accepted at put and came back without them.

Metrics now round-trips with its Id, Expression, Label, ReturnData and
MetricStat, and MetricStat with its Metric, Stat, Unit, Period and Dimensions.
A specification is built when either MetricName or the first query id is
present.

Integer.valueOf on a client-supplied Period threw out of the handler, so a
non-numeric value was reported as InternalFailure. A bad Period is a
ValidationError, on the specification and inside a MetricStat alike.

* fix(autoscaling): validate DisableScaleIn and ReturnData instead of coercing them

Boolean.parseBoolean turns anything that is not "true" into false, so
DisableScaleIn=maybe was accepted and read back as false, a setting the caller
never asked for. ReturnData had the same hole.

This handler already carries parseOptionalBoolean, which raises ValidationError
for anything other than true or false, so both now use it. DisableScaleIn was
not flagged and had the same defect.

* fix(autoscaling): round-trip a metric data query's own Period

TargetTrackingMetricDataQuery carries a Period of its own, which the model
keeps separate from the Period on its MetricStat. Nothing parsed it, the
model had no field for it, and nothing wrote it, so a query period sent to
PutScalingPolicy was accepted and then absent from DescribePolicies. It goes
through parseMetricPeriod like the others, so a bad value is a ValidationError.

* chore: retrigger CI after a cancelled shard

Shard 4 of the previous run was cancelled by the runner, which failed the
summary job. Shards 1 to 3 passed.
2026-09-25 14:37:08 -04:00
lex00 49f253d0ec fix(ec2): report an unknown subnet id from DescribeSubnets as an error (#4408)
* fix(ec2): report an unknown subnet id from DescribeSubnets as an error

A requested SubnetId that does not exist was dropped from the result instead of
raising. An empty list tells the caller the subnet is gone when the id may
simply be wrong, and a waiter polling for a subnet it just created cannot tell
not-yet from never.

describeVpcs already reads its own requested ids this way, so this is the same
shape applied to subnets. A describe naming no ids still lists the region.

* fix(ec2): raise the unknown subnet id from the query handler, not the service

describeSubnets is shared with ELB, ELBv2, DMS, ElastiCache, RDS and others,
each of which reads an absent id as its own error. ElbV2Service raises
SubnetNotFound and DmsService raises InvalidSubnet, and both are the codes
those APIs owe their callers. Raising InvalidSubnetID.NotFound in the service
replaced them. Move the per-id check to handleDescribeSubnets so only the EC2
query surface changes, and reuse the existing requireSubnet helper.

Assertions now read the XML elements rather than the response text.

* test(ec2): validate the unknown subnet id with SDK clients

AGENTS.md asks for management APIs to be exercised through an SDK client
rather than handcrafted requests alone. Ec2Client.describeSubnets raises
InvalidSubnetID.NotFound for a missing id, on its own and mixed with a good
one, and resolves the known id.

The ELBv2 case pins the regression the query handler placement avoids. With
the check in describeSubnets, CreateLoadBalancer answers a missing subnet
with InvalidSubnetID.NotFound rather than the SubnetNotFound that API owes
its callers, and this test fails.

* test(ec2): delete the VPC even when subnet creation fails

Creating the subnet outside the try meant a failure there left the VPC
behind, which accumulates against persistent storage.
2026-09-25 13:53:02 -04:00
Luke Gordon b0ad799c5c fix(s3): allow delete markers and new versions over object-locked versions (#4390)
* fix(s3): allow delete markers and new versions over object-locked versions

Object Lock protects versions, not keys. On a versioned bucket, a simple
DeleteObject (no versionId) adds a delete marker and PutObject, CopyObject
and CompleteMultipartUpload add a new current version; none of them modify
or remove the locked version, so they must not be denied.

Only check lock protection on the current version when it is a
pre-versioning (null-version) object, which Floci replaces rather than
keeping as a noncurrent version.

* test(s3): cover locked pre-versioning objects under versioned writes
2026-09-25 13:50:06 -04:00
David 14ae1dfbdb feat(glue): start, read and stop job runs, and list and batch get jobs (#4382)
A job could be created but never run: StartJobRun and the other run
actions answered InvalidAction. Add StartJobRun, GetJobRun, GetJobRuns,
BatchStopJobRun, ListJobs and BatchGetJobs.

Runs follow Glue's state machine without executing the script. They are
settled on read, so floci.services.glue.job-run-duration-seconds (default
0, succeed at once) can keep a run RUNNING long enough to stop it or hit
MaxConcurrentRuns. DeleteJob also removes the job's runs.

Part of #4380
2026-09-25 11:52:12 -04:00
Niels Kootstra c9c01729f2 fix(mwaa): run CLI commands off the event loop (#4343)
* fix(mwaa): run CLI commands off the event loop

* fix(mwaa): run CLI execs on their own worker pool

* fix(mwaa): own the CLI pool from construction and release it on failed start
2026-09-25 11:23:10 -04:00
XuJian 73ea1e2463 feat(appsync): execute VTL unit resolvers over NONE (#4356)
* feat(appsync): execute VTL unit resolvers over NONE

* fix(appsync): preserve pipeline early returns

* style(appsync): fix pipeline lookup indentation

* style(appsync): align pipeline result assignment
2026-09-25 11:13:45 -04:00
Mario Toffia 7334cac52b fix(lambda): honor LATEST and stop deleted DynamoDB stream mappings writing back (#4318)
A DynamoDB Streams mapping created with StartingPosition LATEST is now
pinned after the stream's newest record at creation, so only later
writes are delivered. Previously every mapping without a checkpoint
started from TRIM_HORIZON.

The poll worker now re-reads the stored mapping after its fetch and
skips the batch when the mapping was deleted or disabled meanwhile. An
invocation still running when the mapping is deleted completes, but
its result is dropped: no retry state, no OnFailure destination send,
and no checkpoint write that would re-insert the mapping into the
store. This also covers a state reset racing an in-flight poll.

Refs #4311
2026-09-25 11:12:19 -04:00
Abhigya 04878b8c57 feat(cloudmap): resolve DNS namespaces and register ECS tasks in them (#4122)
* feat(cloudmap): resolve DNS namespaces and register ECS tasks in them

Cloud Map's control plane already accepted namespaces, services and
instances and read them back correctly, but nothing answered DNS for
<service>.<namespace>. A container that registered successfully still
failed to resolve its peers, and the gap only surfaced at application
runtime because every API call looked right.

The embedded DNS server now consults DnsRecordSource implementations
before forwarding a query upstream, and Cloud Map provides one: a DNS
namespace resolves to the AWS_INSTANCE_IPV4 of the instances registered
under it, one A record each. The SPI keeps the direction right, since
core must not import a service. Which instances answer follows Route 53:
the healthy ones while any instance is healthy, all of them when none
is, and at most eight records either way. HTTP namespaces do not
resolve, matching AWS, where they are reachable only through
DiscoverInstances.

An ECS service that declares serviceRegistries now registers each running
task as an instance of the named Cloud Map service, and deregisters it
when the task stops, mirroring EcsLoadBalancerRegistrar. The address is
the task's ENI address on an awsvpc task and the container's Docker
network address otherwise, which is the one a peer container can reach.
Alongside it the instance carries the metadata attributes the ECS
service discovery documentation lists: AVAILABILITY_ZONE, REGION,
ECS_SERVICE_NAME, ECS_CLUSTER_NAME and ECS_TASK_DEFINITION_FAMILY.
serviceRegistries stays raw: registryArn, containerName and
containerPort are the only members anything acts on.

* test(ecs): pin the Cloud Map registration hooks with a docker mode test

EcsServiceDiscoveryRegistrarTest drives the registrar directly, so removing
EcsService's calls to it left every ECS test green. The registration only runs
in docker mode, which the suite mocks out, so nothing covered the wiring.

The new test runs ECS unmocked under a profile, creates a service that declares
serviceRegistries, and drives one reconciler tick to launch a real container. It
asserts the Cloud Map name resolves to the task's ENI address while it runs, and
that stopping the task removes the instance and the answer. Commenting out
either hook fails it: the register hook on the resolve assertion, the deregister
hook on the instance one.

Security-group enforcement goes back to its shipped default of off for the
profile. The suite turns it on and its helper needs rootful Docker, which is a
requirement of security groups rather than of service discovery.

Also corrects the health status deviation note. An instance registered without
AWS_INIT_HEALTH_STATUS starts HEALTHY on AWS too, so the deviation is not the
initial status but that Floci never moves it: AWS registers an ECS task
UNHEALTHY and promotes it once the container health check passes, for a service
that declares HealthCheckCustomConfig.

* fix(cloudmap): retain DNS ownership and ECS registry targets

* fix(cloudmap): keep namespace apex queries authoritative

* style(dns): remove em dash from test heading
2026-09-25 11:11:28 -04:00
Mario Toffia 294f368814 refactor(dynamodb): move table mutations behind the service (#4378)
CreateTable, UpdateTable and the Kinesis toggles now validate, mutate and
persist in NativeDynamoDbTableService. The handler keeps wire parsing, response
formatting, the Kinesis precision check, and UpdateTable's PAY_PER_REQUEST
throughput and GSI update index checks (they must precede request parsing
errors). Its 4-arg constructor is package-private for tests. Behavior is unchanged.
2026-09-25 11:06:32 -04:00
Niels Kootstra cd21d58403 fix(eventbridge): stop a cron rule deleted or disabled mid-delivery (#4346)
* fix(eventbridge): stop a cron rule deleted or disabled mid-delivery

* fix(eventbridge): swap the next cron timer in atomically

* test: drive the cron timer by hand instead of waiting on real time

* test: cover a stop landing between the re-arm check and the swap
2026-09-25 10:47:54 -04:00
TATSUNO “Taz” Yasuhiro 59fda495a6 fix(sts): Reject SAML signature transforms that AWS rejects (bonus: native image shrunk by 7 MB) (#4372)
* perf(sts): drop the XSLT and XPath signature transforms from the native image

AWS answers AssumeRoleWithSAML with InvalidIdentityToken "Response signature
invalid" when the signature reference uses an XPath, XPath Filter 2.0 or
inclusive canonicalization transform, even though the signature itself is
valid. It accepts the enveloped signature transform alone or with exclusive
canonicalization, which is what SAML 2.0 core 5.4.4 allows. The verifier now
rejects the other transforms the same way.

These transforms can no longer run, but every registered transform is
reachable through one virtual call in the JDK XML signature code, so the
XSLT compiler and the XPath engine were still compiled into the native image.
Substitutions cut them out.

* chore(sts): cover the exclusive canonicalization with comments transform

AWS accepts a SAML signature whose reference uses the enveloped signature
transform with exclusive canonicalization with comments.

* fix(sts): check SAML signature transforms before unmarshalling the signature

In the native image, unmarshalling an XPath Filter 2.0 transform throws
MissingReflectionRegistrationError for XPathType[], so AssumeRoleWithSAML
returned 500 instead of InvalidIdentityToken "Response signature invalid".
The transform algorithms are now read from the DOM before the JDK parses
their parameters.
2026-09-25 10:45:51 -04:00
lex00 fde0688ef3 fix(ec2): reject a DescribeVpcs filter name the service does not serve (#4366)
* fix(ec2): reject a DescribeVpcs filter name the service does not serve

matchesFilters answers true for a name it does not recognise, so an
unsupported filter matched every VPC in the account rather than narrowing
anything. A caller reading that result gets a wrong answer with nothing saying
it is wrong, which is worse than an error. Real EC2 refuses the name.

VPC_FILTERS is the set DescribeVpcs documents, plus the undocumented
cidr-block alias matchesFilters already honours and real EC2 accepts.
describeVpcs now runs requireSupportedFilters, the same helper the
egress-only gateway and VPN gateway describes already use.

* fix(ec2): match the three VPC filters the check newly accepted

VPC_FILTERS admitted dhcp-options-id, owner-id and
ipv6-cidr-block-association.ipv6-pool, and matchesFilters had no arm for any of
them, so each fell to the catch-all and matched every VPC. Accepting a name the
matcher does not implement is worse than refusing it, because the filter is
then taken and silently matches everything. All three have backing data on the
model, so they are matched rather than dropped from the set.

The test asserted only a 200, which is why it did not catch this. It now
creates a VPC and checks each accepted name narrows away from it on a value
nothing can carry, and still finds it on a value it does.

The javadoc claimed one undocumented alias. There are three: cidr-block,
isDefault and tag-value.

Also imports ValidatableResponse rather than qualifying it inline.
2026-09-25 10:43:38 -04:00
Hector Ventura a777879518 fix(cloudformation): reconcile a named secret in place on UpdateStack (#4299)
* fix(cloudformation): reconcile a named secret in place on UpdateStack

SecretsManagerCfnProvisioner called CreateSecret on every provision, so an
identical UpdateStack of a named AWS::SecretsManager::Secret rolled back with
"A secret with the name ... already exists", the failure mode of #2134. The
provisioner now adopts the prior secret: a same-named secret (or a generated
name, kept stable) is reconciled where it stands, description and KMS key
through UpdateSecret, tags driven to the template, an explicit SecretString that
differs from the current value as a new version, and a GenerateSecretString
value left alone so a no-op update does not rotate it. A changed Name is the
replacement the registry schema defines. Tags and KmsKeyId now reach the create
call too.

CloudFormationNamedResourceIdenticalUpdateIntegrationTest runs create, an
identical update and a delete for 36 resource types that carry an explicit
create-only name, so a named type cannot regress this quietly; the secret was
the one of the 36 that did.

Closes #2134

* fix(cloudformation): generate a secret value when an update switches from SecretString to GenerateSecretString

Provisioning with SecretString removed FlociSecretGenerateIdentity, so the next update could not tell a pre-upgrade record from an explicit value and skipped generation. Record "none" instead; only an absent attribute is treated as a legacy record that keeps its value.

* fix(cloudformation): generate for a pre-upgrade secret switching to GenerateSecretString

Records persisted before FlociSecretGenerateIdentity existed cannot say whether the prior template used SecretString. Keep the current value only when it has the shape the GenerateSecretString config produces; otherwise generate, as main did through createSecret.

* fix(cloudformation): always generate for a pre-upgrade secret with GenerateSecretString

The current value cannot show whether a legacy record's prior template used SecretString or a different generation policy, so the length and template-shape check could keep a value that should have been regenerated. Generate on the first update instead; main never kept such a value across an update, since it called createSecret each time.
2026-09-25 10:36:06 -04:00
Aniket Shukla 09276c75dc fix(lambda): honor alias async destination configuration (#4348)
* fix: route Lambda async destinations by invoked alias

* test: verify qualified Lambda ARN executor calls

* test: cover real alias destination routing
2026-09-25 10:28:52 -04:00
Hector Ventura 6fcfc0450a fix(core): refuse a SigV4 scope region that no AWS partition publishes (#4393)
* fix(core): refuse a SigV4 scope region that no AWS partition publishes

P2b of the multi-partition plan. RegionResolver.resolveRegionFromAuth took the
credential-scope label with no membership test, so polygondwanaland-west-1
became a region with its own storage namespace and its own ARNs. A label that
no partition publishes or admits by its regionRegex is now refused with a 400:
S3-signed requests get S3's XML AuthorizationHeaderMalformed ("the region '...'
is wrong", the S3 and minio wording), everything else InvalidSignatureException.
The pattern rule is the AWS SDKs' own, so a region launched after the vendored
data was refreshed (eu-south-9) is still served. moto
(MOTO_ALLOW_NONEXISTENT_REGION) and LocalStack (ALLOW_NONSTANDARD_REGIONS)
refuse the same way by default; floci.partitions.allow-unknown-regions
(FLOCI_PARTITIONS_ALLOW_UNKNOWN_REGIONS) restores the old any-label behaviour.

* fix(core): answer an unknown scope region in the caller's protocol, including presigned POST

A form-encoded request now gets a Query ErrorResponse instead of JSON, which Query SDKs cannot parse, and an S3 presigned POST's form credential is checked for an unknown region with S3's AuthorizationHeaderMalformed, as minio does.
2026-09-25 10:12:46 -04:00