Commit Graph
1825 Commits
Author SHA1 Message Date
Amogh Bhat Nagri ea88947865 fix(ssm): apply every DescribeParameters filter and page the results (#3646)
DescribeParameters honoured only Key=Name, Option=Equals and silently
dropped every other ParameterFilters entry. With no Name/Equals filter
left it returned every parameter in the region, so a Path, Type or
Name BeginsWith filter widened the result instead of narrowing it.

The filters now follow the ParameterStringFilter reference: Name, Type,
KeyId, Path, Tier, DataType and tag:<key>, with Equals and BeginsWith
(Name also Contains, Path OneLevel and Recursive). Filters combine with
AND and a filter's values with OR. The deprecated Filters shape matches
Name, Type and KeyId exactly. An unsupported key, option or value is
InvalidFilterKey, InvalidFilterOption or InvalidFilterValue instead of
being ignored, and MaxResults/NextToken page through the shared cursor.

Closes #3642
2026-09-14 22:49:15 -04:00
Kenshin Okinaka 190c556940 refactor(ses): extract the shared v2 JSON helpers and guard controller registration (#3640)
SesController's 13 request-parsing helpers that more than one URL group
uses (body and member shape checks, the Tags array, the v1-to-v2 error
remapping) move byte-for-byte into a package-private static SesV2Json so
the per-domain controllers that follow can share them without
inheriting from or duplicating the monolith; readOptionBody now takes the
caller's ObjectMapper. SesV2JsonTest pins each helper's accept/reject
split and wording directly, and SesV2ControllerRegistrationTest asserts
that every /v2/email resource class in the package is registered on the
SES descriptor, since an unregistered controller still serves signed SDK
calls and only silently loses the service-enabled gate and the
x-amzn-errortype header for unsigned requests. No endpoint moves and no
wire behavior changes.
2026-09-14 22:30:09 -04:00
Priamo Germosen efdef71527 refactor(cloudfront): extract repeated marker/maxItems pagination into the existing paginate helper (#3586)
CloudFrontService.java already has a private generic paginate(List<T>, marker, maxItems, keyFn)
helper, used by seven of its list* methods (functions, continuous deployment policies, public
keys, key groups, realtime log configs, field-level encryption configs/profiles). Six older
list* methods (listDistributions, listInvalidations, listCachePolicies,
listOriginRequestPolicies, listOriginAccessControls, listCloudFrontOriginAccessIdentities)
were never migrated to it and kept their own inline copy of the same 18-line marker-lookup and
maxItems-truncation block, the duplication CPD flagged.

Wired all six onto the existing helper. listResponseHeadersPolicies keeps its own inline
version untouched: unlike the others, it treats an unmatched marker as InvalidArgument instead
of silently starting from the beginning, a genuine behavioral difference from paginate() that
this issue does not ask to change.

No behavior change for the six migrated methods. Full CloudFront and CloudFront CloudFormation
test suites pass unchanged.
2026-09-14 21:55:25 -04:00
Priamo Germosen bd13c7f9ce refactor(s3): point PreSignedUrlFilter at the shared SigV4RequestValidator crypto helpers (#3596)
S3's PreSignedUrlFilter carried its own private copy of deriveSigningKey/hmacSha256/
sha256Hex/hexEncode, the same SigV4 signing-key derivation block that SigV4Validator
(ElastiCache) and RdsSigV4Validator (RDS) used to carry independently before #3581
consolidated those two into core.common.auth.SigV4RequestValidator. S3's copy was out
of scope there and left as a third independent copy of the same crypto logic.

S3's canonical-request construction is real REST SigV4 (method/path/headers/payload
hash), a different shape from SigV4RequestValidator's own validate() method, which
handles the simplified query-token form ElastiCache/RDS presigned URLs use. So this
doesn't reuse validate() itself, only the four low-level crypto primitives, now made
public on SigV4RequestValidator for exactly this kind of reuse. PreSignedUrlFilter's
own copies are removed and its one call site now delegates to the shared methods.

S3HeaderSignatureFilter, which reused PreSignedUrlFilter's helpers directly (they were
package-private), is updated to call the shared class as well.

Adds SigV4RequestValidatorTest: the shared crypto primitives were previously only
exercised indirectly through each caller's own request flow. Now that they're public
specifically for cross-service reuse, this pins them directly against an independently
computed value (cross-checked with Python's hmac/hashlib, not derived from this code).

No behavior change otherwise. Full S3 test suite (over 1000 tests across all S3 files)
and the ElastiCache/RDS/Redshift SigV4 validator tests pass unchanged.
2026-09-14 21:54:13 -04:00
Priamo Germosen 3c96327ac4 refactor(bedrock-agentcore): extract shared error/JSON helpers into BedrockAgentCoreControllerSupport (#3637)
BedrockAgentCoreControlController, GatewayController, GatewayRuleController,
IdentityController, MemoryController, ResourcePolicyController, and ToolsController each
carried their own byte-for-byte identical copy of error(Exception, String) (AwsException
maps to a structured JSON body with an X-Amzn-Errortype header, anything else falls back
to a 400 ValidationException), the single most duplicated area CPD found across src/main.
Three of them (Control, Gateway, Memory) also carried an identical stringMap(JsonNode)
JSON-object-to-map helper, and four (Control, Gateway, Identity, Memory) carried an
identical text(JsonNode, String) field-extraction helper found along the way.

Extracted all three into a new package-private BedrockAgentCoreControllerSupport. Each
controller keeps its own private error/stringMap/text methods as one-line delegations
(error still takes the caller's own LOG so log lines keep attributing to the right
controller), so no call site elsewhere in any of the seven files needed to change.

putInstant deliberately stays out: it's duplicated too, but it's two genuinely different
behaviors (ISO-8601 strings for runtimes and gateways, epoch seconds for workload
identities and memories) wearing the same method name, not one shared behavior. Merging
it would risk conflating the two.

While here, also finished what #3556 started delegating: BedrockAgentCoreMemoryController
had its own separate awsError(AwsException) doing the exact same thing as error(), added
for the new event endpoints. Routed those four call sites through the existing error()
method instead and removed the duplicate. Also fixed BedrockAgentCoreMemoryController's
import block, which had non-java/java.util imports interleaved into the jakarta.ws.rs
group.

No behavior change. Removing AwsErrorResponse/AwsException/HashMap imports that became
unused after the extraction where applicable. Full bedrockagentcorecontrol and
bedrockagentcore test suites (95 tests) pass unchanged. Three of the seven controllers
(GatewayRule, ResourcePolicy, Tools) have no existing test coverage at all; manually
verified the delegated error() renders identical ValidationException/ResourceNotFoundException
responses on ResourcePolicyController before removing the verification test, since adding
permanent coverage for previously-untested controllers is a separate concern from this
issue's scope.
2026-09-14 21:53:06 -04:00
Matheus Oliveira 4707d4d3a8 fix(sfn): enforce the alias and published version quotas per state machine (#3580)
CreateStateMachineAlias rejects the 101st alias, and publishing rejects the
1001st version, with ServiceQuotaExceededException.

* Fix #3575
* Fix #3614

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-09-14 20:55:32 -04:00
hisham-coderandHisham Mohammed d45a437122 fix(rds): persist PubliclyAccessible on Create/ModifyDBInstance and echo it on Describe (#2484)
DescribeDBInstances hard-coded <PubliclyAccessible>false</PubliclyAccessible>
regardless of what CreateDBInstance or ModifyDBInstance were sent. Clients
that persist the response saw drift; terraform-provider-aws re-issued
ModifyDBInstance on every apply for an instance with publicly_accessible =
true (same class as the defaults fixed in #2420).

The flag now lives on DbInstance (AWS default false when omitted), is parsed
on both Create and Modify through the existing strict parseOptionalBoolean
(a malformed value is InvalidParameterValue, never silently false), and is
echoed on every describe.

Co-authored-by: Hisham Mohammed <hisham.ma.mohammed@gmail.com>
2026-09-14 18:32:37 -04:00
Anmol Mishraandanmolxlight 064f302ab1 fix(ecr): join the ECR API with the backing registry (#2466)
* fix(ecr): join the ECR API with the backing registry

Hostname-style ECR repository URIs resolve to loopback and hit the raw
registry:2 container directly, so a docker push stores the image under
the bare repository name while every API lookup (ListImages,
DescribeImages, BatchGetImage, BatchDeleteImage, best-effort tag
listing) only ever resolved the namespaced (account/region/repo) form.
Name mismatch meant pushed images were silently invisible, no error.

Adds resolveRegistryRepoName(): prefers the namespaced form, falls back
to the bare name when nothing is stored there, with a cross-account/
cross-region ambiguity guard using the storage backend's unfiltered
scan so the guard sees other scopes' claims in production, not just
the calling account. Wired into every read path above.

Force-delete resolves the name first (bare vs namespaced) and routes
storage cleanup through #2982's filesystem-cleanup mechanism
(EcrRegistryManager.deleteRepositoryStorageByInternalName) instead of
its own per-tag HEAD-then-DELETE loop, so hostname-style bare-name
content is actually removed instead of #2982's original code silently
missing it. Tag/catalog/digest discovery during force-delete uses
strict variants that throw on a genuine registry error (ServerException,
matching service-2.json); any failure (unreachable registry included)
now aborts the delete with metadata intact rather than assuming the
repository empty, except when no HTTP client is wired at all (a pure
test double with no backing registry to clean up). Catalog pagination
follows the registry's Link header rather than assuming a single page.

Closes #2444.

* fix(ecr): explicit type and no em dashes per AGENTS.md

hasOtherScopeClaim used var for the cast to
AccountAwareStorageBackend<Repository>; AGENTS.md requires explicit
types (KenkoGeek review). Also replaced a few em dashes introduced in
new comments across the review's final round of tests, which AGENTS.md
forbids repo-wide and CI enforces.

---------

Co-authored-by: anmolxlight <anmolxlight@users.noreply.github.com>
2026-09-14 16:31:51 -04:00
Chris Jovanovski 6ce3fbbd2e fix(cloudwatchlogs): bound stored events and enforce retention (#3611)
* fix(cloudwatchlogs): cap stored log events and enforce retention on ingest

* docs(cloudwatchlogs): document max-stored-events and the slower log flush interval

* fix(cloudwatchlogs): scope eviction to the ingesting account

Use explicit account storage operations for retention and capacity eviction.

* docs(cloudwatchlogs): note the stored-event ceiling applies per account

* docs(cloudwatchlogs): document that the stored-event ceiling is best-effort under concurrent ingest
2026-09-14 16:18:45 -04:00
Allen Sanborn 1482d45b6e fix(sqs): match AWS queue attribute defaults and MaximumMessageSize range (#3626)
* fix(sqs): match AWS queue attribute defaults and MaximumMessageSize range

A new queue reported MaximumMessageSize 1048576, four times the AWS default
and above the AWS maximum, and nothing rejected an out-of-range value on
CreateQueue or SetQueueAttributes. GetQueueAttributes with All also omitted
SqsManagedSseEnabled, which AWS returns for every standard queue.

Default max-message-size is now 262144, values outside 1024 to 262144 are
rejected with InvalidAttributeValue, and All returns the AWS attribute set
including SqsManagedSseEnabled (true unless KmsMasterKeyId is set). Raising
FLOCI_SERVICES_SQS_MAX_MESSAGE_SIZE above the AWS maximum widens the accepted
range with it, so the configured default stays settable explicitly.

* fix(sqs): address review findings

Cover the shipped default itself: ApplicationDefaultsTest now reads
src/main/resources/application.yml and the EmulatorConfig @WithDefault, so
reverting either one fails a test rather than passing on the explicit value in
src/test/resources/application.yml.

Report the MaximumMessageSize that SendMessage enforces. A queue persisted by a
build that allowed 1 MB advertised a payload the send path would then reject;
GetQueueAttributes and the size check now share parseMaxMessageSize, which also
trims like the validation path does.

Pin the SNS fan-out size boundary. SNS accepts a publish up to 262144 bytes and
SQS accepts a message up to the same 262144, so a non-raw sqs subscriber whose
notification envelope pushes the body past the limit is dropped with a warn.
That mirrors AWS, and SnsSqsFanoutMessageSizeTest now holds it in place from
both sides.

Trim the InvalidAttributeValue message to the bare AWS form used elsewhere in
the file.

* fix(sqs): keep SqsManagedSseEnabled consistent when KmsMasterKeyId changes

Creating a queue with a KmsMasterKeyId stored SqsManagedSseEnabled=false. That
value outlived the key: clearing KmsMasterKeyId left the stored false behind,
and the read path, which only fills the attribute in when absent, kept
reporting managed SSE as disabled for a queue that no longer had a KMS key.

Stop storing the derived value at all. CreateQueue no longer writes
SqsManagedSseEnabled, so anything stored under that name is a value the user
set, and it survives. GetQueueAttributes derives the answer on every read: a
KMS key wins, an explicit setting stands, and a queue with neither reports the
AWS default of true. There is no derived state left to go stale.

AWS does not document crisply what happens to SSE-SQS when a KMS key is
cleared, so returning to the default is a deliberate choice; the code and
docs both say so rather than implying it is copied behaviour.

* fix(sqs): raise MaximumMessageSize bounds to the AWS value of 1 MiB

The previous commits on this branch set MaximumMessageSize to a default and
maximum of 262144 bytes. That was wrong: it is SNS's Publish limit, not SQS's.
AWS raised both the SQS maximum and the SQS default from 262144 to 1048576
bytes in August 2025, so the valid range is 1024 to 1048576 with a default of
1048576.

Corrected AWS_MAXIMUM_MESSAGE_SIZE, the EmulatorConfig fallback, both
application.yml files and the docs. The reject-out-of-range path in
validateMaximumMessageSize is unchanged apart from its bounds, as are the
SqsManagedSseEnabled derive-on-read behaviour and the DelaySeconds,
ReceiveMessageWaitTimeSeconds, MessageRetentionPeriod and VisibilityTimeout
backfills.

Several tests had been shrunk to fit the wrong ceiling and are restored to the
payload sizes they had before this branch. getQueueAttributes now stores an
above-ceiling 2097152 so the clamp path stays covered, and a new test pins the
ceiling itself: with a lowered configured maximum, a queue may still be set to
1048576, which the old constant rejected.

Deleted SnsSqsFanoutMessageSizeTest. Its premise was that an SNS notification
envelope reliably pushes a body past the queue's MaximumMessageSize, which no
longer holds for the ordinary text it published: SNS caps a publish at 262144
bytes and SQS now accepts 1048576, so the envelope overhead alone does not
cross the limit. The boundary has not disappeared, it has moved somewhere the
test did not look. Because the envelope is serialized as JSON, escaping expands
every control character below 0x20 to six bytes, and publish validates size
without inspecting character classes, so a publish made largely of control
characters can still overflow a 1 MiB queue. That case is untested; covering it
needs a test built around the expansion rather than around envelope overhead.

The SNS comment that asserted SQS shared the 262144 ceiling is corrected, and
states the escaping caveat rather than claiming the envelope can never cross
the queue limit.
2026-09-14 15:57:18 -04:00
Niels Kootstra d167cc5bf3 fix(codedeploy): fail closed on unreachable, erroring, or timed-out lifecycle hooks (#3563)
* fix(codedeploy): fail closed on unreachable, erroring, or timed-out lifecycle hooks

CodeDeploy lifecycle hooks failed open in several cases: a missing SSM
instance, an SSM execution exception, a Lambda invoke() error, and a hook
callback timeout were all silently treated as a successful hook. This
makes all of those cases finish the lifecycle event as Failed with an
AWS-compatible Diagnostics.errorCode and ErrorInformation.code
(HEALTH_CONSTRAINTS for Server, HOOK_EXECUTION_FAILURE for Lambda/ECS),
instead of swallowing the error and continuing.

invokeHook now polls a stop flag while waiting on a hook callback, so
StopDeployment interrupts that wait promptly instead of only after the
one-hour callback timeout elapses. A hook function that returns cleanly
without ever calling PutLifecycleEventHookExecutionStatus no longer
succeeds implicitly; it must explicitly call back, matching AWS's
documented AppSpec hooks contract.

* fix(codedeploy): poll SSM hook scripts for their declared timeout

* chore: rerun CI
2026-09-14 15:54:49 -04:00
sheldon-nadarajah-sft 5b4d1aff60 fix: serialize GetRecords ApproximateArrivalTimestamp as a plain decimal (#2359)
* fix: serialize GetRecords ApproximateArrivalTimestamp as a plain decimal

GetRecords (and SubscribeToShard's event payload) convert ApproximateArrivalTimestamp
from epoch milliseconds by dividing through a double, so Jackson may serialize the
resulting JSON number in scientific notation. AWS SDK for Java v2 then fails to
unmarshal values such as 1.786959659083E9, despite the response returning HTTP 200 -
the same defect as #2099, against a different field/endpoint.

A real, practical consequence: any client that creates a fresh AT_TIMESTAMP shard
iterator for a record that already exists (rather than waiting for a new one to
arrive after polling starts) never finds it - GetRecords's own AT_TIMESTAMP
resolution correctly locates the record server-side, but the client can't parse
the corrupted timestamp on what comes back.

Fix mirrors #2173's approach: a private epochSeconds(Instant) helper returning an
exact BigDecimal (millisecond precision, no exponent notation) instead of a double,
applied at both call sites. Adds focused handler coverage (KinesisJsonHandlerTest)
and an integration test (KinesisIntegrationTest) asserting the raw response body's
timestamp lexeme contains no exponent notation.

Closes #2358

* fix: don't NPE serializing GetRecords when ApproximateArrivalTimestamp is null

KinesisRecord is @RegisterForReflection with a no-arg constructor, so it round-trips
through hybrid/persistent JSON-backed storage - a record persisted by an older Floci
version (or otherwise missing the field) deserializes with a null
approximateArrivalTimestamp. epochSeconds(null) would NPE and fail the whole
GetRecords/SubscribeToShard response over one record. Omit the field instead when
the timestamp is missing, matching how AWS SDKs treat an absent optional field.
2026-09-14 15:51:18 -04:00
Niels Kootstra 9da589568d fix(route53): require exact match for ChangeResourceRecordSets DELETE (#3565)
* fix(route53): require exact match for ChangeResourceRecordSets DELETE

DELETE validation only compared record name and type, so a DELETE
naming the wrong TTL, values, alias target, routing fields or set
identifier could remove an existing record set as long as the name
and type happened to match. AWS requires a DELETE to specify every
value used to create the record; a mismatch on any of them fails
with InvalidChangeBatch, using one of two different messages, with
no trailing period: "not found" when no record shares the same
name, type and set identifier, or "the values provided do not match
the current values" when one does but another field differs. Both
messages include the set identifier when the deleted record
specifies one.

Add an exact-match comparison covering TTL, resource record values
(order-independent), alias target, weight, region, failover, health
check ID and set identifier, and use it for both the DELETE
existence check and the removal itself.

Batch changes are now validated and applied sequentially against a
running copy of the zone's records, rather than validated as a whole
against the pre-batch snapshot and then applied. This matches two
documented AWS behaviors: deleting the same record set twice in one
batch now fails with InvalidChangeBatch, and a DELETE followed by a
CREATE of the same name and type in one batch (the standard replace
pattern) now succeeds. The batch is still applied atomically: the
running copy is a local list and the stores are only written once
every change in the batch has succeeded.

Also stop silently swallowing ChangeBatch parsing errors: malformed
XML, a Change missing its Action or ResourceRecordSet, an action
outside CREATE/DELETE/UPSERT, and a non-numeric TTL or Weight now
fail with InvalidInput instead of being ignored or dropped. A
ResourceRecordSet must also specify exactly one of AliasTarget or
TTL and ResourceRecords, matching AWS's structural requirement: real
AWS only rejects a ResourceRecordSet as having more than one shape
when AliasTarget and ResourceRecords are both present, so AliasTarget
combined with TTL alone remains valid. A ChangeBatch with no Changes
is rejected with InvalidInput instead of returning success and
applying nothing, using AWS's own schema-validation wire message for
an empty Changes element, built from the same Route53 namespace
constant used elsewhere in these responses.

* fix(route53): reject AliasTarget combined with TTL
2026-09-14 15:18:53 -04:00
XuJianandxujiantop-crypto 2f76640aa8 fix(iam): distinguish cross-account resource grants (#3590)
* fix(iam): distinguish cross-account resource grants

* fix(iam): honor exact principal ARN resource grants

* fix(s3): persist cross-account object metadata to owner

---------

Co-authored-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
2026-09-14 15:13:23 -04:00
Niels Kootstra 494bab4b30 fix(kms): protect ciphertext blobs with an AES-GCM envelope (#3544)
* fix(kms): protect ciphertext blobs with an AES-GCM envelope

Symmetric CMK ciphertext was base64(plaintext) dressed up with a
cosmetic nonce and context fingerprint: anyone holding a CiphertextBlob
could read the plaintext, and any bit flip still "decrypted" to the
same value. Encrypt now builds a versioned AES-256-GCM envelope backed
by real per-CMK key material, binding the key id, backing key id and
canonicalized EncryptionContext as GCM additional authenticated data.
Decrypting with the wrong key, the wrong context, or any tampered byte
in the header, IV, ciphertext or tag now fails as
InvalidCiphertextException instead of leaking or silently accepting
corrupted ciphertext.

RotateKeyOnDemand mints a new backing key rather than replacing the
old one, so ciphertext encrypted before a rotation keeps decrypting
after it, matching AWS KMS's own retention of prior backing keys.
Legacy v1/v2 blobs already persisted keep decrypting read-only for
back-compat; Encrypt never produces them again. Keys persisted before
this change generate their backing key material lazily on first use
and persist it from then on.

Only SYMMETRIC_DEFAULT keys reach this path: SM2 Encrypt/Decrypt is
already unreachable via the existing key-usage/algorithm validation,
and RSA keeps its existing, already-real RSAES-OAEP handling untouched.

* fix(kms): serialize legacy backing key generation under a lock

Two concurrent first uses of a key persisted before the AES-GCM
envelope existed could each generate a different backing key and both
call keyStore.put; the loser's backing key, and any ciphertext already
encrypted under it, would become unreachable. Guard the generate-and-persist
step with a dedicated lock that re-reads and re-checks the key before
minting one, so only one backing key is ever created for a given legacy
key, and return the resolved instance so callers use the persisted
object. The unsynchronized fast path for already-healed keys is
unchanged.

Add a test that resolves a legacy key concurrently from a dozen
threads and asserts they converge on one backing key whose ciphertexts
all still decrypt.

* fix(kms): back EXTERNAL symmetric keys with their imported material

The envelope resolved every SYMMETRIC_DEFAULT key through the lazy backing
key generator, including Origin=EXTERNAL keys. A PendingImport key was
given random material before ImportKeyMaterial ran, Encrypt then used that
material instead of the imported one, and deleting or expiring the import
left the generated key able to open ciphertext.

EXTERNAL keys now skip generation, ImportKeyMaterial installs the imported
material as the backing key under its KeyMaterialId, and delete or expiry
removes it. Decrypt of such ciphertext answers with the key's PendingImport
state, and re-importing the same material reinstates the backing key id
that earlier ciphertext names.

* fix(kms): synchronize backing material access
2026-09-14 14:04:58 -04:00
Daniel ZwickerandPriamo Germosen 530717e8e0 fix(cognito): serialize attribute verification updates (#2535)
* fix(cognito): serialize attribute verification updates

* fix(cognito): serialize AdminDeleteUser against the same per-user lock

hectorvent's review: the per-user lock introduced here covered five
verification-related operations, but AdminDeleteUser removed the whole
user record without acquiring it. A verification finishing after a
concurrent admin deletion could resurrect the just-deleted user, since
its locked path re-fetches, mutates, and writes back the record with
no way to know the record had been deleted out from under it.

Wraps AdminDeleteUser in the same lock stripe, following the existing
resolve-then-lock-then-mutate pattern used by the other admin paths.
Adds a regression test mirroring the PR's existing latch-based style,
covering a verification that finishes after a concurrent admin user
deletion.

* fix(cognito): serialize every user-record mutation on the per-user lock

hectorvent's review: the per-user lock introduced here covered only the
verification-related operations (plus AdminDeleteUser, added separately).
Storage is a plain whole-object get/put/delete with no version or CAS
primitive, so any two of the remaining ~19 methods that read, mutate, and
write back a user record could still race each other, or race one of the
locked operations, and silently lose an update.

Wraps every remaining user-mutating path in the same per-user lock stripe,
following the existing resolve-then-lock-then-mutate pattern:
AdminCreateUser, the internal migrated-user creation path, AdminSetUserPassword,
AdminEnableUser, AdminDisableUser, AdminResetUserPassword,
AdminLinkProviderForUser (nested inside its existing identityLinkLock, which
serializes a pool-wide uniqueness check that a single user's lock can't),
AdminAddUserToGroup, AdminRemoveUserFromGroup, DeleteGroup and DeleteUserPool
(each user locked individually inside the loop, one at a time, never more
than one stripe held at once), SignUp, ConfirmSignUp, AdminConfirmSignUp,
ChangePassword, AdminSetUserMFAPreference, and SetUserMFAPreference.

AdminCreateUser and SignUp lock on the requested username/alias rather than
a resolved canonical id, since an alias pool has no canonical id until
creation succeeds; locking the requested value is what actually prevents two
concurrent requests for the same identifier from both passing the existence
check and creating duplicates.

ConfirmForgotPassword and self-service DeleteUserAttributes needed no
changes: both fully delegate their mutation to an already-locked method
(AdminSetUserPassword, AdminDeleteUserAttributes respectively) rather than
writing the user record themselves.

Also replaced a pre-existing `var` in ConfirmSignUp (now moved into its
locked helper) with the concrete DeliveryTarget type per AGENTS.md.

---------

Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
2026-09-14 14:03:30 -04:00
Niels Kootstra f1bbe12d62 fix(dynamodb): re-check TTL under item lock before sweeper deletes (#3562)
* fix(dynamodb): re-check TTL under item lock before sweeper deletes

The TTL sweeper found expired items and removed them without taking the
per-item lock normal writes use, and without re-reading the item or
re-checking its TTL at delete time. A PutItem/UpdateItem that refreshed
or replaced an item between the sweeper's scan and its delete was
silently lost.

Split the sweep into scanExpiredItems (read-only) and deleteScannedItems,
which now takes the same per-account item lock as normal writes, re-reads
the item, and re-checks isExpired before removing it. If a concurrent
write made it no longer expired, the delete is skipped and no REMOVE
event is emitted on DynamoDB Streams or the Kinesis CDC forwarder.

* refactor(dynamodb): use explicit type in TTL sweep delete
2026-09-14 14:00:46 -04:00
Vũ Thế Huy 7981e23dcd refactor(tagging): deduplicate tag-dispatch logic across tag controllers (#3594) (#3619)
* refactor(tagging): deduplicate tag-dispatch logic across tag controllers (#3594)

* fix(docs): support superclass REST method extraction in regen_action_docs

- Read inherited JAX-RS methods from superclass when a REST controller extends a base class
- Add test_extract_rest_inherits_methods_from_superclass test
2026-09-14 12:52:37 -04:00
Aniket Shukla e82836348b fix(stepfunctions): resolve state machine alias ARNs (#3607)
* fix(stepfunctions): resolve state machine alias arns

* docs(stepfunctions): list alias actions

* fix(stepfunctions): paginate state machine aliases

* ci: rerun compatibility checks
2026-09-14 12:42:56 -04:00
BingEdward 73ef15f6e2 fix(codedeploy): default server hook timeout to one hour (#3606)
* fix(codedeploy): default server hook timeout to one hour

Signed-off-by: 7487 <1042653432@qq.com>

* fix(codedeploy): handle null and invalid hook timeouts

Signed-off-by: 7487 <1042653432@qq.com>

---------

Signed-off-by: 7487 <1042653432@qq.com>
2026-09-14 12:18:43 -04:00
Daniel Zwicker a704f731aa fix(cognito): clear stale pending admin updates (#2533) 2026-09-14 12:16:52 -04:00
Vũ Thế Huy 5ae3ed8976 refactor(rdsdata,redshiftdata): deduplicate sql parameter parsing logic (#3570) (#3577)
* refactor(rdsdata,redshiftdata): deduplicate sql parameter parsing logic (#3570)

* refactor(rdsdata,redshiftdata): preserve dialect quoting rules in sql parameter parser (#3570)
2026-09-14 12:12:22 -04:00
Simone Primarosa 95079965a8 fix(ecr): enforce immutable image tags (#3009)
Route Docker Distribution traffic through Floci so repository mutability applies to manifest writes. Keep legacy registry storage reachable while moving public ECR endpoints to the guarded listener.
2026-09-14 12:07:40 -04:00
Daniel ZwickerandPriamo Germosen a03c4d6160 feat(cognito): support pending user attribute verification (#2531)
* feat(cognito): support pending attribute verification

* fix(cognito): omit UserAttributeUpdateSettings when a pool never configured it

DescribeUserPool/CreateUserPool/UpdateUserPool always serialized
UserAttributeUpdateSettings as an empty object for pools that never set it,
where AWS omits absent optional members entirely. UserPoolAddOns right above
it already handles this correctly (an unconfigured pool omits the key rather
than returning {} or null, confirmed by Terraform re-planning the block into
and out of existence); UserAttributeUpdateSettings now follows the same
pattern.

* test(cognito): replace var with explicit AWS SDK response types

AGENTS.md's Types and names rule bans var in local declarations; the compat
test used it for four locals whose concrete AWS SDK type is the thing under
review here (CodeDeliveryDetailsType, UpdateUserAttributesResponse).

---------

Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
2026-09-14 11:50:16 -04:00
Mohamed Amine ALOUINI 52bafb7e5c fix(s3): honor x-amz-tagging query parameter on presigned PutObject and CreateMultipartUpload (#3615)
* fix(s3): honor x-amz-tagging query parameter on presigned PutObject and CreateMultipartUpload

SDK presigners hoist x-amz-tagging into the query string and sign only
host, so the uploader sends no tagging header at all. Floci read the
tags only from the header and silently dropped them: the PUT returned
200 and GetObjectTagging came back with an empty TagSet, while real S3
applies both forms.

Fall back to the x-amz-tagging query parameter when the header is
absent, for PutObject and for CreateMultipartUpload. The signed header
still wins when both are present. JAX-RS decodes the query value once,
which yields the same URL-encoded k=v&k=v string the header carries, so
the existing parser is reused unchanged.

Closes #3608

* test(s3): verify the presigned x-amz-tagging query fallback under SigV4 enforcement

The tests added with the fix run with signature validation off and append
x-amz-tagging to an already generated URL, so they show the fallback works
but not that a genuinely SigV4-signed presigned request reaches it.

Add an enforce-auth companion class that builds URLs the way SDK presigners
do, with every query parameter in the canonical query string and only the
listed headers covered by the signature, and checks that:

- a presigned PUT with x-amz-tagging in the signed query applies the tags
- a presigned CreateMultipartUpload with x-amz-tagging in the signed query
  applies the tags to the completed object
- a signed x-amz-tagging header wins over the query parameter
- a tag parameter appended after signing is rejected with
  SignatureDoesNotMatch
2026-09-14 11:47:06 -04:00
Daniel ZwickerandPriamo Germosen 36c3ee4e22 feat(cognito): implement VerifyUserAttribute (#2018)
* feat(cognito): implement VerifyUserAttribute

* fix(cognito): align attribute verification with AWS

* fix(cognito): require access-token scope on VerifyUserAttribute

verifyUserAttribute() extracted username/pool/jti from the caller's token
but never checked token_use or scope, so a valid ID token could reach the
same code-consuming, attribute-mutating path as an access token. AWS
requires an access token carrying the aws.cognito.signin.user.admin scope
for this operation (API_VerifyUserAttribute.html).

Adds a token_use check (unconditional) and a scope check that only rejects
a token when it explicitly carries a scope list missing the required
scope. Most access tokens this simulator issues carry no scope claim at
all (scopes are only modeled through the V2 Pre-Token-Generation Lambda
override), so treating an absent claim as unrestricted keeps every normal
login flow working, while an access token with an explicit, non-conforming
scope list is now rejected.

Adds unit coverage for all three cases (ID token rejected, access token
missing the scope rejected, access token with the scope accepted) plus a
wire-level regression for the ID-token case.

* fix(cognito): scope consumed-code tombstone to attribute verification

VerificationCodeService.consume() retained a consumed-code tombstone for
every purpose, so a reused code answers ExpiredCodeException instead of
the original CodeMismatchException. That behavior was validated against a
real Cognito pool for VerifyUserAttribute, but the service is shared with
ConfirmSignUp (SIGNUP_CONFIRMATION) and ConfirmForgotPassword
(PASSWORD_RESET), so the same change silently altered their reused-code
error too, without the same validation.

Scopes the tombstone to EMAIL_ATTRIBUTE_VERIFICATION and
PHONE_ATTRIBUTE_VERIFICATION only. SIGNUP_CONFIRMATION and PASSWORD_RESET
go back to deleting on consume, restoring their original, previously
validated NOT_FOUND/CodeMismatchException behavior on reuse.

---------

Co-authored-by: Priamo Germosen <6233424+pgermosen@users.noreply.github.com>
2026-09-14 11:05:25 -04:00
XuJianandxujiantop-crypto 166b13a82f fix(apigateway): prefer path parameters in VTL lookups (#3560)
Co-authored-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
2026-09-14 10:53:33 -04:00
Niels Kootstra 1987bf0c96 fix(rds): bound RDS/Redshift auth proxy connections and handshakes (#3545)
Cap concurrent proxy connections with a per-proxy semaphore, apply
configurable handshake and backend-connect timeouts to both the
client and backend sockets, and defer backend PostgreSQL connects
until after client auth completes. Close leaked backend sockets
defensively on every exit path, including a RuntimeException thrown
between authenticate() returning a session and the bridge finishing
its own cleanup, and bound backend-side reads during the handshake
so a silent backend that accepts TCP but never answers cannot pin a
handler thread and its connection permit forever.

New EmulatorConfig keys under services.rds and services.redshift:
proxy-handshake-timeout-millis (default 10000),
proxy-backend-connect-timeout-millis (default 5000),
proxy-max-connections (default 100).
2026-09-14 10:48:48 -04:00
Franklin G. Mendoza ffd2488f02 fix(codepipeline): poll S3 source changes (#3525)
* fix(codepipeline): poll S3 source changes

* fix(codepipeline): serialize source polling baselines
2026-09-14 10:11:15 -04:00
Sam Fakhreddine 5648be79c4 fix(ec2): let dnf swap curl-minimal for curl when installing the IMDS proxy (#3284)
public.ecr.aws/amazonlinux/amazonlinux:2023, the fallback image
AmiImageResolver uses for any unrecognized AMI ID, ships curl-minimal by
default. metadataProxyInstallCommand()'s dnf branch asked for the full
curl package alongside iproute and socat; curl and curl-minimal both
provide /usr/bin/curl and can't coexist, so dnf aborted the whole
transaction on that conflict. iproute and socat never installed either,
even though neither of them conflicts with anything.

The failure was only ever logged as a WARN by Ec2ContainerManager and the
instance still reported running, so a caller had no signal the link-local
IMDS endpoint was dead. Reproduced against the real image: dnf reported
dozens of "package curl-minimal-... conflicts with curl provided by
curl-..." lines for every curl-minimal version in the repo.

--allowerasing lets dnf swap curl-minimal for curl instead of aborting.

Closes floci-io/floci#3281
2026-09-14 09:58:45 -04:00
Ovidiu (Ovi) fb82fb29ae fix(apigateway): answer an unmatched REST request with 403, not 404/405 (#3547)
* fix(apigateway): fall back to a parameterised sibling on method mismatch

A literal resource that declares some methods but not the requested one
returned 405 even when a parameterised sibling could serve it. Resource
candidates are ordered exact, then parameterised, then greedy, and the
selection loop stopped at the first candidate with any methods configured.

For /users/me declaring only PATCH, GET /users/me therefore returned 405
instead of resolving against /users/{userId}, where "me" is an ordinary
parameter value. Adding a literal child for one method silently removes
every other method a parameterised sibling already served, so this surfaces
as a regression in an application that was working.

The stop was there for a narrower reason, which the existing tests pin: a
method mismatch on a concrete resource must not be absorbed by a greedy
/{proxy+} catch-all. That rule is kept. Only the concrete-to-concrete case
changes, so a literal now yields to a parameterised sibling that can serve
the method, while /devices declaring POST still returns 405 for GET rather
than falling through to /{proxy+}.

Extends ApiGatewayRoutingFallthroughIntegrationTest, which already covers
the greedy cases, with /users/{userId} GET alongside a literal /users/me
PATCH: GET /users/me resolves to the parameterised resource, PATCH still
prefers the literal, and an ordinary id is unaffected.

* fix(apigateway): resolve the method against every matching resource

The selection loop stopped considering less specific siblings once a
resource declaring methods had been passed, so a method mismatch on a
concrete resource was terminal for the greedy half of the rule.

Captured against a real REST API in us-west-2: AWS picks the most
specific resource that can serve the requested method, searching
literal, then path parameter, then greedy {proxy+}, and refuses the
request only when no candidate declares it.

Drop concreteWithMethodsSeen and the greedy break so both fallbacks
follow that single rule. /users/me declaring only PATCH no longer hides
GET /users/{userId}, and /devices declaring only POST now falls through
to GET /{proxy+}.

getDevicesReturns405 pinned the greedy half of the old behaviour and is
updated to assert the fallthrough. Adds compatibility coverage for the
sibling and greedy fallbacks from the same AWS repro.

The no-match response is unchanged: AWS returns 403 Missing
Authentication Token where floci returns 405, tracked separately.

* fix(apigateway): answer an unmatched REST request with 403, not 404/405

A REST request that reached no method returned 404 "Not Found" when the
path matched nothing and 405 "Method Not Allowed" when it matched
resources declaring no usable method. AWS returns neither.

Captured against a real REST API in us-west-2 with /users/{userId} GET
and a literal /users/me PATCH deployed. POST /users/me, DELETE
/users/abc123, GET /zzz, GET /users/a/b/c and GET / all answered:

    403  {"message":"Missing Authentication Token"}
    x-amzn-ErrorType: MissingAuthenticationTokenException

AWS resolves the path and the method as one step, so an unknown path and
a known path carrying no usable method are the same failure and share one
response. This is the well-known "Missing Authentication Token" result of
calling a REST API with the wrong verb, which callers match on.

Route both branches through restNoMatch(), rendering the status, body and
error-type header AWS pairs with this failure, alongside the existing
AWS_IAM MISSING rejection that already returns that shape.

HTTP APIs are untouched: they answer an unmatched route with 404
{"message":"Not Found"}, which the v2 dispatch path continues to do.

* test(apigateway): expect 403 for a path that reaches no resource

ApiGatewayGreedyPathParameterIntegrationTest arrived on main after this
branch was cut, and pinned the old 404 for a REST path matching no
resource. This branch changes that contract to 403 "Missing Authentication
Token", so the assertion was stale rather than a real regression.

The test's intent is unchanged: /other/img/logo.png must not be swallowed
by the greedy resource. Only the no-match response it asserts moves.

HTTP API v2 is untouched and still answers an unmatched route with 404
"Not Found".
2026-09-14 09:42:36 -04:00
Matheus Oliveira 1ae779a9d9 fix(ec2): build the instance AWS_ENDPOINT_URL from the shared container endpoint (#3579)
Use ContainerReachableEndpoint like Lambda and ECS instead of the raw Floci container IP and a fixed 4566 port.

* Fix #3578

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-09-14 09:37:11 -04:00
Kenshin Okinaka c6b736ad60 refactor(ses): retire the receipt-rule delegations from the SesService facade (#3618)
The receipt-rule family (rule sets, rules, filters) was the one domain the
facade only forwarded: 14 one-line delegations plus create/update rule, which
merely bound the verified-sender predicate. SesQueryHandler now injects
SesReceiptRuleService and SesIdentityService directly and binds that
predicate itself, so the facade drops the field, both constructor
parameters and the 16 methods, and SesServiceTestBuilder no longer
assembles a receipt-rule service with S3/SNS/Lambda mocks. No wire
behavior changes; the v1 integration tests and the SDK compat suite cover
every action.
2026-09-14 09:05:07 -04:00
TATSUNO “Taz” Yasuhiro a5ab1672f9 perf(s3): drop unused hashes on S3Object creation (#3589)
* perf(s3): stop computing an unused SHA-256 for each stored object

The S3Object constructor hashed the whole body with SHA-256.
storeObjectInternal replaces that checksum before the object is published,
and delete markers never return a checksum, so nothing read the value.

* perf(s3): pass the composite ETag in when completing a multipart upload

CompleteMultipartUpload stored the object with an MD5 of the whole body
under the bucket lock, then replaced it with the composite ETag. Passing
the composite ETag in skips that hash.

The composite ETag is now also on the first write. WAL storage logs a
record when it is put, so the version record used to keep the plain MD5,
and a restart after a crash returned that MD5 for the version.

* test(s3): check the stored composite ETag without counting storage keys

The test pinned how many object store puts a completion makes. It now
checks that every stored ETag is the composite one, which still fails
when nothing was stored.
2026-09-14 00:18:00 -04:00
Ovidiu (Ovi) 3003f05953 feat(bedrock-agentcore): implement AgentCore Memory events (#3556)
* feat(bedrock-agentcore): implement AgentCore Memory events

The Memory control plane was emulated but the event data plane was not:
CreateEvent, ListEvents, GetEvent and DeleteEvent were all absent, so an
application that reads a conversation's history had nothing to call.

Rather than answer ListEvents with a fixed empty list, the events are
stored, so a read returns what was written. An empty session is then empty
because nothing wrote to it, not because the answer is hardcoded.

Behaviour captured against real AgentCore in us-west-2:

  - events are returned newest first, and the event id is a zero-padded
    epoch-millisecond prefix plus a random suffix, so ids sort
    chronologically as plain strings
  - includePayloads=false omits the payload key rather than emptying it
  - maxResults accepts 1 to 100; 101 is a ValidationException quoting the
    constraint
  - a malformed memory id is a ValidationException ("Invalid memoryId: not
    a valid memory ID or ARN") while a well-formed but unknown one is a
    ResourceNotFoundException ("Memory not found: <id>"). A memory id is a
    name followed by exactly ten alphanumerics: a nine or eleven character
    suffix is rejected as malformed before any lookup
  - an unknown actor or session is an empty list, not an error
  - sessionId is optional on create, and AgentCore assigns a UUID when it
    is omitted
  - an empty payload is accepted, and a new event lands on the main branch
  - DeleteEvent echoes the deleted id rather than returning an empty body

The endpoints live on the memory controller rather than the data-plane one
because a JAX-RS request is matched against a single root resource class:
the class rooted at "/memories" owns that subtree, and a class rooted at
"/" never gets a look in. The behaviour stays in the data-plane service.

Verified with the same AWS SDK an application would use, pointed at a local
floci: create, list, get and delete round-trip, eventTimestamp parses back
to the exact Date, and each error above arrives as its typed exception.

Memory records (extraction and retrieval) remain unimplemented; they need
an extraction engine rather than stored events.

* fix(bedrock-agentcore): satisfy the docs and native-image CI gates

Three CI failures on this branch, all mine.

The action tables under docs/services are generated, not hand written. I
edited bedrock-agentcore.md directly and put the new event rows in the
wrong position, so `make docs-check` reported the table stale. Regenerated
with `make docs-sync`, which orders actions by registration and therefore
keeps ListMemories ahead of the event family.

BedrockAgentCoreEventService holds a static SecureRandom for event ids.
GraalVM captures such an instance in the image heap unless the class is
initialized at run time, so NativeImageRuntimeInitializationTest failed and
took both native image builds with it. Registered the class under
--initialize-at-run-time alongside the other services that hold one.

* fix(bedrock-agentcore): correct the event wire contract

Three gaps against the modelled contract, all confirmed in the bundled
botocore service model rather than taken on trust.

CreateEvent answers 201, not 200. The operation's HTTP trait says so, and
the test was pinning the wrong status.

payload is a required member of CreateEvent whose valid values include the
empty list. Turning a null into an empty list made an omitted member
indistinguishable from a valid empty array, so presence now travels
separately from the value and an omitted payload is a ValidationException.
The model also caps the list at 100 items, which is now enforced.

ListEvents is paginated. The default page size is 20 rather than the 100
this used, and the request and response carry a nextToken. The token is the
last event id of the previous page rather than an offset: ids sort with
time and the order is stable, so resuming cannot be shifted by a concurrent
write. No token is emitted on the final page, which is what ends a caller's
loop.

Verified with the real SDK against a local floci: five events traverse in
three pages of two, two and one with the token absent on the last, and an
omitted payload comes back as ValidationException.

* fix(bedrock-agentcore): match AWS wording for the maxResults range error

AWS quotes the submitted value and cites only the bound that was breached.
The message always cited the upper bound and dropped the value, so
maxResults=0 reported "less than or equal to 100". Add a test for the
lower bound, which had none.
2026-09-14 00:01:40 -04:00
Priamo Germosen 7a228c5325 refactor(apigateway,appsync): extract shared VTL $util functions into a common utility (#3583)
VtlTemplateEngine.UtilVariable (API Gateway) and AppSyncUtil (AppSync) each
independently implemented the same ~49-line block of AWS $util VTL functions
(escapeJavaScript, urlEncode, urlDecode, base64Encode, base64Decode, parseJson),
flagged as duplicated by CPD. AWS specifies $util identically across both services'
VTL mapping-template docs, so the two floci implementations risked silently
disagreeing on edge cases over time.

Extracted the shared functions into VtlUtilFunctions under core.common.vtl; both
$util implementations now delegate to it. base64Encode keeps two overloads
matching each service's real AWS signature: API Gateway's $util.base64Encode takes
a string, AppSync's takes a Blob (byte[] in the Java model), so both overloads are
preserved rather than collapsed into one.

No behavior change. All existing VtlTemplateEngine and AppSyncUtil tests, plus the
full ApiGateway and AppSync suites, pass unchanged.
2026-09-13 21:18:43 -05:00
Priamo Germosen 8d3fdbdd56 refactor(elasticache,rds): extract shared SigV4 request validation into a common utility (#3581)
SigV4Validator (ElastiCache proxy) and RdsSigV4Validator (RDS proxy, also reused by
Redshift) each reimplemented the same ~60-line AWS SigV4 presigned-URL verification
algorithm (query parsing, expiry check, secret resolution, canonical request, signing
key derivation, signature comparison), flagged as duplicated by CPD. Extracted the
shared algorithm into SigV4RequestValidator under core.common.auth; both validators now
delegate to it, parameterized only by their genuine differences: the identity query
parameter (User vs DBUser), whether that parameter is required to be present at all
(RDS always requires DBUser; ElastiCache does not require User), and the exact string
each signs as the canonical host header (cluster ID for ElastiCache, host:port for RDS).

No behavior change. Public constructors and validate(...) signatures on both
SigV4Validator and RdsSigV4Validator are unchanged, since existing unit tests construct
them directly with an IamService and reflect on a declared sanitizeForLog method on each
class; that method is kept (identically implemented, not delegated) on both wrapper
classes specifically so those tests keep working unmodified. All existing SigV4
validator, ElastiCache, RDS, and Redshift tests pass unchanged.
2026-09-13 21:10:44 -05:00
Priamo Germosen d1892e18a1 refactor(elasticache,memorydb): extract shared auth-proxy logic into a common base class (#3574)
ElastiCacheAuthProxy and MemoryDbAuthProxy each implemented their own copy of the
RESP AUTH handshake, accept loop, and client/backend relay, ~87 duplicated lines
flagged by CPD. MemoryDB's proxy is modeled on ElastiCache's (same wire protocol,
same IAM-auth mechanism), so both now extend AbstractRedisAuthProxy, which owns
the shared accept/handshake/relay plumbing behind two small hooks (authRequired,
authenticate) that each subclass implements against its own validators. No
behavior change: closeQuietly stays per-subclass since the two implementations
genuinely differ (ElastiCache shuts down the socket's output side and logs at
debug; MemoryDB just closes), and every other extracted method reproduces the
original logic byte for byte.

Also adds integration coverage for a path that existed before this refactor but
had no automated test either way: a client that sends an explicit AUTH command
on a connection where auth isn't required must still get +OK and stay usable,
rather than being rejected.
2026-09-13 21:05:04 -05:00
Vũ Thế Huy 7d6e9588cd fix: support SSM PutParameter tags and ECS container healthCheck (#2567) (#3550)
* fix(ssm): support Tags and preserve tags on Overwrite in PutParameter (#2567)

* fix(ecs): round-trip containerDefinition healthCheck (#2567)

* style(ecs): replace em-dash with comma in test doc per AGENTS.md

* fix(ssm,ecs): address review feedback on description, ARN parsing and ECS healthCheck command

* test(ecs): pass HostVolumePolicy to EcsJsonHandler in healthCheck tests
2026-09-13 21:23:52 -04:00
XuJianandxujiantop-crypto 19917ed9ed fix(s3): enforce source resource policies on object copies (#3539)
* fix(s3): enforce source resource policies on object copies

* fix(s3): combine source identity and resource policies

---------

Co-authored-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
2026-09-13 19:44:02 -05:00
Hector Ventura 0f7df0fd19 refactor(cloudformation): move the AutoScaling types into a per-service provisioner (#3582)
Moves AWS::AutoScaling::AutoScalingGroup and AWS::AutoScaling::LaunchConfiguration out
of the monolith switch into AutoScalingGroupCfnProvisioner. Monolith 4,988 to 4,702
lines, legacy types 31 to 29. The monolith side of the diff is pure deletion: nothing
in it was edited, only removed.

autoScalingService was exclusive to these two types, so the field and its constructor
parameter leave with them. Seven private helpers leave too, having no caller left
behind: sameNameExistingResource, deleteRenamedResource, parseIntProp, resolveAsgTags,
resolveAsgTagPropagation, resolveMixedInstancesPolicy and parseOptionalInt. The first
three were shared with RDS until batch 7 took RDS out, which is why they could not move
before now.

Reading the name and the prior entity goes through ProvisionContext rather than a copied
helper: stablePhysicalName for the create-only name, reusesPriorEntity for the
update-versus-replace decision, and resolveOptional and resolveStringList for the
properties. That is behaviour-preserving because the engine sets the resource's physical
id and the context's priorPhysicalId from the same value on the same call.

Two gaps close with the move, each proved by a test that fails without it.

AWS::AutoScaling::AutoScalingGroup declares exactly one readOnlyProperty in the registry
schema, AutoScalingGroupARN, but the monolith recorded the ARN only under the key "Arn".
Fn::GetAtt for the documented name therefore resolved to the literal string
"LogicalId.AutoScalingGroupARN" and the stack still reported CREATE_COMPLETE. Both keys
are now set: "Arn" stays because templates and an existing integration test read it.
AWS::AutoScaling::LaunchConfiguration declares no readOnlyProperties, so it adds no
attribute surface.

#3494 added DesiredCapacityType, CapacityRebalance, MaxInstanceLifetime and
DefaultInstanceWarmup to AutoScalingService but left the CloudFormation path passing
AsgOptionalFields.none(), noting in its own description that the wiring belonged in a
per-service provisioner rather than in the monolith. All four are registry schema
properties, so a template setting them was silently dropped. They are read now, and
absent stays null rather than false or zero, so an update overwrites only what the
template set, matching applyToExistingGroup and the Query handler.

Delete keeps the monolith's behaviour and does not wrap the calls in
CfnDeletes.safeDelete. AutoScalingService raises ValidationError at 28 sites and only one
of them means "not found", so tolerating that code would be the catch-all AGENTS.md rules
out, swallowing a real delete failure and reporting DELETE_COMPLETE over it.

Tests: 8 unit tests against a mocked service, plus the existing AutoScaling integration
test extended to assert the schema attribute and the four fields end to end. Reverting
each change makes the matching assertions fail, checked separately because RestAssured
stops at the first failed expectation and one would otherwise mask the other.
2026-09-13 19:43:42 -05:00
XuJianandxujiantop-crypto 809ce40f1e fix(cloudformation): identify unsupported SAM Cognito authorizers (#3535)
Co-authored-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
2026-09-13 19:22:27 -05:00
Matheus Oliveira 36c8396f25 fix(cloudformation): validate WAFv2 WebACL and Config rule required properties (#3576)
Fail fast on missing required properties, read WebACL tags via ListTagsForResource,
delete Config rules by name through CfnDeletes and keep absent ComplianceResourceTypes unset.

* Fix #2711

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-09-13 19:09:56 -05:00
TATSUNO “Taz” Yasuhiro 569f9f55e4 perf(build): replace quarkus-jdbc extensions with plain JDBC drivers (#3465)
* perf(build): replace quarkus-jdbc extensions with plain JDBC drivers

The RDS Data API and Redshift Data API open connections with
DriverManager. They never used Agroal, Narayana or the datasource
layer that quarkus-jdbc-mysql and quarkus-jdbc-postgresql pull in.
Depend on mysql-connector-j and postgresql directly and hand-supply
the native image config the extensions provided.

* perf(build): cut unused JDBC driver paths from the native image

Substitute driver code that cannot be reached against the databases
Floci provisions, mirroring what quarkus-jdbc-mysql did for JMX and
going a step further for authentication and multi-host URLs.

* perf(build): keep the MySQL cleanup thread disabled in JVM mode

quarkus-jdbc-mysql set com.mysql.cj.disableAbandonedConnectionCleanup
at startup in JVM mode as well as at native build time. The first
commit carried only the native build argument and a surefire copy, so
quarkus:dev and the JVM Docker image started Connector/J's abandoned
connection cleanup thread on the first MySQL Data API call. In dev mode
that thread is recreated with every restart and pins the old
classloader.

* fix(rdsdata): reject PostgreSQL result types the Data API does not support

Aurora PostgreSQL answers a result set that holds a point, interval,
money, box, circle, line, lseg, path or polygon column with
UnsupportedResultException and the message "The result contains the
unsupported data type POINT." Floci returned the driver's toString of
the value instead. Check the column type names before reading the rows
and raise the same error. json and jsonb stay supported, and a column
cast to text still reads as a string, which is the workaround AWS
documents.

* perf(build): drop the PGobject reflection entries

pgjdbc builds point, interval, money and the geometric types through
reflection only when a result set holds such a column. The Data API now
rejects those columns before reading a row, and json and jsonb values
are plain PGobject instances the driver creates directly, so none of
the ten entries can be reached.

* chore(rdsdata): name the tolerated ClassNotFoundException in OpenTelemetryUnavailable

* perf(build): keep PGInterval registered for the Redshift Data API

Redshift tables can hold INTERVAL YEAR TO MONTH and INTERVAL DAY TO
SECOND columns and the Redshift Data API returns them as strings. Floci
serves that path from a PostgreSQL container through pgjdbc, which
builds an interval value by reflection, so the entry stays. The Redshift
Data compat test now reads two interval columns on the native image.

* perf(build): keep the geometric reflection entries for the Redshift Data API

Redshift refuses point, box, circle, lseg, path and polygon as column
types but evaluates them in a select, and its Data API returns the
values as strings, checked on a real ra3.large cluster. Floci serves
that path through pgjdbc, which builds those values by reflection, so
the six entries stay. line stays out because Redshift rejects it, and
money never reaches PGmoney because pgjdbc reads it as a double.

The Redshift Data compat test selects those expressions and expects
the strings Redshift returned. JdbcDriverNativeSupportTest resolves
every registered class name.

* fix(redshiftdata): fail statements that produce line, json or jsonb like Redshift

Redshift has none of these types. A select that names one fails with
"ERROR: type "line" not yet implemented" or "ERROR: type "json" does
not exist", checked on a real cluster. The PostgreSQL container behind
Floci's Redshift evaluates them, so the Data API now checks the result
column types and fails the statement with the same text.
2026-09-13 20:08:25 -04:00
Matheus André 589b1aba9c fix(cloudformation): replace AWS RDSDBCluster when EngineMode or StorageEncrypted changes (#3555)
Signed-off-by: Matheus André <matheusandr2@gmail.com>
2026-09-13 18:59:01 -05:00
Vũ Thế Huy e5bd8be405 feat(redshift): provision AWS::Redshift::Cluster through CloudFormation (#3427)
* feat(cloudformation): provision AWS::Redshift::Cluster (create path)

* feat(cloudformation): AWS::Redshift::Cluster update and replacement

* feat(cloudformation): force replacement on Redshift cluster createOnly property change

* feat(cloudformation): force replacement on Redshift cluster DBName change

* feat(cloudformation): provision Redshift parameter, subnet and security groups

* chore(cloudformation): register Redshift provisioner in inventory and docs

* test(cloudformation): end-to-end AWS::Redshift::Cluster stack

* docs(redshift): document CloudFormation cluster provisioning

* test(cloudformation): assert ClusterSubnetGroupNotFound error code on subnet group deletion

* fix(cloudformation): correct attribute handling for Redshift security group provisioning

* fix(cloudformation): apply Redshift parameter group Parameters and fix docs

ClusterParameterGroup silently dropped Properties.Parameters on both
create and update instead of calling ModifyClusterParameterGroup, and
did not replace the entity when Description or ParameterGroupFamily
changed, even though AWS marks both as replacement properties.

Also remove the Id GetAtt claim from the Cluster docs: neither the
provisioner nor AWS's own schema expose it for AWS::Redshift::Cluster.
2026-09-13 18:45:40 -05:00
Anders Wasen 55ada9b8a3 feat(cloudformation): provision the AppSync resource types (#3424)
Adds AppSyncCfnProvisioner, serving AWS::AppSync::GraphQLApi, GraphQLSchema, DataSource,
FunctionConfiguration, Resolver and ApiKey. Without it a template's AppSync resources fall
to the dispatcher's stub arm, which reports CREATE_COMPLETE while creating nothing and
resolves Fn::GetAtt to the literal "LogicalId.Attr".

Two things are not simple property mapping. The AppSync control plane is REST-JSON with
camelCase members, so every property is lower-camelised on the way in, with DynamoDBConfig
as the one member that does not follow the rule (it is dynamodbConfig). And schema creation
is asynchronous: while it is PROCESSING every other call for that API is refused with a 409,
so the GraphQLSchema resource waits for a terminal status before completing, as CloudFormation
does.

Also carries the service-layer changes the provisioner needs: a PIPELINE resolver reaches its
data through pipelineConfig and names no data source, which createResolver refused outright;
CreateFunction and UpdateFunction now keep the runtime a JS resolver declares; and
UpdateFunction applies a new name, which a CloudFormation rename goes through.
2026-09-13 18:45:32 -05:00
Anders Wasen 10becc593f feat(cloudformation): provision AWS::Lambda::Url (#3423)
A function URL in a template was falling to the stub arm, so a stack exported the literal
string "LogicalId.FunctionUrl" in place of a URL and nothing was listening on it.

The physical id is the FunctionArn the URL is attached to, the alias ARN when Qualifier names
one, which is the registry schema's primary identifier and enough to address the config again
since a qualified ARN parses back into function and qualifier. TargetFunctionArn and Qualifier
are create-only, so an update that moves the URL creates against the new function and removes
the one it displaced.
2026-09-13 18:45:25 -05:00
Ovidiu (Ovi) e8edc3d4b1 fix(apigateway): take the last value of a repeated query string parameter (#3548)
A REST proxy event built queryStringParameters from the FIRST value of a
repeated parameter, so ?x=1&x=2&x=3 reached the integration as "1".

Captured against a real REST API in us-west-2 with a Lambda proxy
integration: AWS collapses a repeated parameter to the LAST value,
yielding {"x":"3"}, while multiValueQueryStringParameters keeps every
value in order as ["1","2","3"]. A trailing empty value still wins, so
?x=1&x= yields "".

This is the same rule putSingleValueHeaders already applies to duplicate
request headers one method above, where the comment notes that taking the
first value diverged from AWS. Query strings were left on the old
behaviour; they now match.

Also pins two properties that were already correct, so they stay that
way: a bracketed name such as filter[status]=open reaches the integration
unchanged, and an absent query string nulls both maps.

putQueryStringParameters and putMultiValueQueryStringParameters become
package-private for the unit test, matching putSingleValueHeaders and
putMultiValueHeaders next to them.

HTTP APIs are untouched. Their payload formats join duplicates with a
comma rather than taking one value, which is a different rule and is not
measured here.
2026-09-13 18:41:22 -04:00
David bfe2b71587 fix(s3): verify the SigV4 header signature when enforce-auth is enabled (#3573)
With FLOCI_SERVICES_S3_ENFORCE_AUTH=true, a request signed in the
Authorization header, which is how every AWS SDK and the CLI sign ordinary
calls, was authenticated by access key existence alone: isKnownAccessKey
checked that the key id was registered and the Signature value was never
recomputed. The presigned placements already had real verifiers (#1842 for
the query string, #3081 for browser POST); this was the remaining one, so a
fabricated signature naming a known key was accepted for any request.

Add S3HeaderSignatureFilter beside PreSignedUrlFilter. It runs only with the
flag on, for requests routed to S3Controller, and rebuilds the canonical
request from the request as it arrived: raw path, canonical query string,
the SignedHeaders with host resolved through S3VirtualHostFilter, and the
signed x-amz-content-sha256. The signature is derived from the resolved
secret and compared in constant time; when the declared hash is a real
digest the body is hashed too and handed back unchanged. Rejections mirror
S3's codes and order: AuthorizationHeaderMalformed for a structurally bad
header or scope, AccessDenied for a missing date, InvalidRequest for a
missing content hash, InvalidAccessKeyId for an unknown key or a temporary
key without its session token, RequestTimeTooSkewed beyond fifteen minutes,
SignatureDoesNotMatch for an unsigned host or a signature that does not
verify, and XAmzContentSHA256Mismatch for a body that differs from its
declared hash. PreSignedUrlFilter's crypto helpers go package-private so
the new filter shares them.

The entity stream is read directly rather than gated on hasEntity(), which
RESTEasy Reactive implements as "has a Content-Type"; the AWS CLI sends
bucket configuration bodies and put-object --body without one, and the
first cut rejected those as hash mismatches.

The enforce-auth tests all sent a fabricated Signature=test, which is the
bug running green. A new testutil S3RequestSigner signs each request at
send time the way an SDK does; the 103 fabricated headers become filter
attachments with no assertion changed, and three new tests pin the forged,
wrong-secret, unbound-host, tampered-body, stale-date, missing-hash,
missing-date and malformed-header cases. Verified live with the flag on
against the unmodified AWS CLI 2.36 (including an 8 MB multipart round
trip) and the AWS Java SDK v2 compat suite, 143/143 across every S3 class.

Closes #2332
2026-09-13 18:39:34 -04:00