* fix(apigateway,appsync): sandbox VTL rendering with SecureUberspector and execution limits
VtlTemplateEngine and AppSyncVtlEngine rendered templates with Velocity's
default UberspectImpl introspector, which allows arbitrary reflection
through any context object (e.g. $util.getClass().forName('java.lang.Runtime')),
and had no cap on #foreach iterations, output size, or execution time,
making them vulnerable to both sandbox escapes and denial of service via
runaway loops or #set string doubling.
Add a shared VtlSandbox helper that both engines call to switch to
SecureUberspector and restrict introspection on java.lang.Class,
ClassLoader, Runtime, ProcessBuilder, System, Thread, java.io.File and
related reflection/scripting/process packages, plus three independent
limit layers: a native #foreach loop cap that truncates the loop without
failing the template, a cooperative execution deadline checked from a new
SandboxedForeach directive before each loop iteration, and a BoundedWriter
output-size cap. The latter two throw the new VtlLimitExceededException,
an unchecked RuntimeException that flows through each engine's existing
error handling exactly like any other Velocity evaluation failure, with
no new error shape. Limits are configurable via EmulatorConfig
(vtlMaxLoops, vtlMaxOutputChars, vtlTimeoutMillis; application.yml keys
vtl-max-loops, vtl-max-output-chars, vtl-timeout-millis), mirroring the
project's existing per-service numeric-tunable config pattern, and
documented in api-gateway.md and appsync.md.
The classpath-shadowed velocity.properties resource is kept for any
embedding that resolves it normally, but is not the actual enforcement
point: under this project's test/runtime classloader, Velocity's own
getResourceAsStream lookup for that exact resource path can resolve to
the copy bundled inside the velocity-engine-core jar instead of this
project's shadowed copy, silently leaving the insecure UberspectImpl
active even with a correct properties file on disk. VtlSandbox configures
SecureUberspector and swaps in SandboxedForeach directly via the
VelocityEngine Java API instead, which is unaffected by that ambiguity.
* docs(apigateway): correct foreach registration documentation
* fix(s3): support virtual-hosted routing via X-Forwarded-Host and prevent unintended bucket creation
- Respect X-Forwarded-Host when resolving host for reverse proxy compatibility
- Support tail-agnostic .s3.<region>.<domain> qualifier and fallback lookup against existing buckets
- Reroute misplaced single-segment object/multipart uploads or reject with InvalidBucketName/MalformedXML
- Add unit and integration tests for virtual-hosted requests forwarded through proxies
* docs(s3): translate virtual host routing comment
* fix(apigateway): reject method request parameter names AWS refuses
API Gateway restricts a method request parameter name to
^[a-zA-Z0-9:._$-]+$. floci applied no validation, so a spec that real AWS
refuses imported cleanly against the emulator and only failed on deploy,
which is the direction that costs the most to discover.
The limitation is undocumented. Measured against real AWS (us-west-2),
both entry points reject a name outside the set:
PutMethod
BadRequestException: Invalid mapping expression specified:
Validation Result: warnings : [], errors : [Parameter name should
match the following regular expression: ^[a-zA-Z0-9:._$-]+$]
ImportRestApi
BadRequestException: Errors found during import: Unable to put
method 'GET' on resource at path '/items': <the message above>
$ : . _ - are inside the set, so a JSON:API style filter[a] cannot be
imported while filter.a can, which is the workaround applications adopt.
The rule covers query string, header and path parameters alike, and
applies whether or not the parameter is required.
Validation lives in putMethod, the choke point both entry points share.
The import path rethrows it under the envelope AWS uses there, naming the
method and resource path.
Only the declared name is restricted. At runtime a request carrying
?filter[a]=1 reaches a proxy integration with the brackets intact, so
this is not a general ban on the character in a query string, and nothing
on the execute path changes.
* docs(apigateway): attach the parameter-name javadoc to the method it describes
The javadoc for validateRequestParameterNames sat above
importParameterNameFailure, which carried its own javadoc directly
beneath it. Move it down onto the method it documents.
No behavior change.
* fix(ec2): honor RunInstances dry run before provisioning
* fix(ec2): validate launch input before dry-run success
* fix(ec2): validate dry runs through the launch service
The ten /v2/email/contact-lists endpoints and their six helpers move out
of SesController into SesContactController. Every one of them is a
single-domain call, so the new controller injects SesContactService only
and never touches the facade; SesUnsubscribeController switches to the
same service for its one call. SesService drops its twelve contact
delegations and keeps the send-path opt-out collection and the ARN tag
dispatch. The contact and dedicated-IP endpoints were interleaved in the
monolith, so the move is per method and the two contact section headers
go, leaving the dedicated-IP methods under their own headers.
SesServiceTestBuilder exposes the contact service it builds so the
list-management unit test seeds contacts through it. The new class is
registered on the SES descriptor. No wire behavior changes.
The six /v2/email/templates endpoints move byte-for-byte out of
SesController into SesTemplateController, which calls SesTemplateService
directly and keeps only DeleteEmailTemplate on the facade for its
tenant-association guard. SesQueryHandler's template actions and the
facade's own templated send read the service the same way, and the
residual SesController resolves a stored template for SendBulkEmail
through it too, so the facade drops its five pure template delegations.
The new class is registered on the SES descriptor. No wire behavior
changes.
Moves the last type that answered in the dispatcher's update-cleanup hooks out of
the monolith. Monolith 4,521 to 3,886 lines, legacy types 28 to 27, and no
reference to StepFunctions or StateMachine remains in the class.
The prize is the five hooks. Each one delegated to the provisioner that owns the
type and then fell through to a StepFunctions arm for the types that had none.
StepFunctions was the last of those, so all five collapse to plain delegation:
completeUpdate 60 lines to 6, rollbackUpdate 79 to 5, updateCleanupPhysicalId 28
to 8, hasReplacementUpdate 18 to 5, clearUpdate 5 to 4. A replacement's
bookkeeping, its retry budget and its rollback now live beside the code that
creates the replacement.
The provisioner wraps three collaborators rather than one. StepFunctionsService is
its own. ObjectMapper reads and writes the update snapshot. S3Service is there
because a state machine's definition may arrive as DefinitionS3Location rather
than DefinitionString, so resolving it means fetching and parsing the object;
s3Service stays in the monolith as well, since ApiGateway and Lambda also read
from S3.
Two constants are copied rather than moved: NAME_MODE_EXPLICIT and
NAME_MODE_GENERATED are also used by Lambda, and GENERATED_NAME_SUFFIX_LENGTH by
generatePhysicalName. Copying is what keeps this move behaviour-preserving.
CloudFormationYamlParser's constructor becomes public. The parser is already a
public class, but its constructor was package-private and the provisioners live
in a subpackage, so the definition-from-S3 path could not reach it.
Tests: 2,862 green across the cloudformation, provisioners and stepfunctions
packages. The rollback path is the one worth proving rather than assuming, since
a status-only assertion would not notice its loss: neutralising rollbackUpdate to
return false fails five integration tests across three classes, with the stack
reporting UPDATE_ROLLBACK_FAILED and naming InitialStateMachine.
Add the PutGatewayResponse / GetGatewayResponse / GetGatewayResponses /
UpdateGatewayResponse / DeleteGatewayResponse family, keyed per REST API by
responseType across the 21 AWS types. Uncustomised types are reported with
defaultResponse=true, their AWS default statusCode and the default
{"message":$context.error.messageString} template; UpdateGatewayResponse
patches /statusCode, /responseParameters/<name> and
/responseTemplates/<content-type>, and DeleteGatewayResponse restores the
default.
ImportRestApi and PutRestApi read the x-amazon-apigateway-gateway-responses
extension, and AWS::ApiGateway::GatewayResponse is provisioned by a new
CloudFormation provisioner whose Ref / Fn::GetAtt Id is
<restApiId>-<responseType>.
On the execute plane every gateway-generated answer (unmatched path or
method, AWS_IAM and Lambda authorizer rejections, missing API key, request
validation, unsupported media type, integration configuration errors and
Lambda proxy failures) resolves the customisation for its type, then
DEFAULT_4XX / DEFAULT_5XX, and applies the configured statusCode, the
gatewayresponse.header.* parameters (static, method.request.*, context.*,
stageVariables.*) and the response templates, with $context.error.* exposed
to VTL. An expired SigV4 signature selects EXPIRED_TOKEN and a malformed or
mismatching one INVALID_SIGNATURE, as AWS keeps those two contracts apart.
This is what puts Access-Control-Allow-Origin on a browser-visible
401/403/400 so the frontend can read the real status instead of a CORS
failure. Without a customisation every answer is unchanged.
Closes#3326
* feat(bedrock-agentcore): implement InvokeHarness
InvokeHarness was the last gap keeping an application's agent chat on real
AWS. #3556 added the Memory event data plane, so conversation history works
locally, but the invoke call itself had nothing to answer it.
There is no agent loop here and no model. What is emulated is the wire
contract an application integrates against: POST /harnesses/invoke returns
an application/vnd.amazon.eventstream response carrying messageStart,
contentBlockStart, one contentBlockDelta per chunk, contentBlockStop,
messageStop and metadata, in that order. The reply echoes the caller's last
user message, which makes a chat client visibly work end to end and leaves
a request that failed to parse obvious rather than hidden behind a fixed
string.
The wire bindings are the part worth knowing, and they are not what the
request model suggests. harnessArn and qualifier are query parameters,
runtimeSessionId and runtimeUserId are headers
(X-Amzn-Bedrock-AgentCore-Runtime-Session-Id / -User-Id), and only
messages, model and tools travel in the JSON body. Reading them from the
body compiles, passes a hand-written test, and then fails against the real
SDK with "harnessArn is required".
A request carrying no user message is legitimate rather than an error: a
caller whose memory already holds the current turn sends none, so that case
answers with a canned line. harnessArn is not resolved, because the
emulator models no harness resource; InvokeAgentRuntime is permissive for
the same reason.
BedrockStreamEncoder moves to core/common as AwsEventStreamWriter and
becomes public, next to the AwsEventStreamEncoder it already delegates to.
Both services now share one frame writer rather than duplicating the
header-map wrapper. bedrock-runtime keeps its behaviour and its streaming
tests are the regression guard.
Tool execution, skills and multi-turn iteration are not emulated, so no
tool-use block is produced even when a request supplies tools.
* fix(bedrock-agentcore): validate the InvokeHarness request contract
messages is a required member. Treating a missing or non-array field the
same as an empty array made an omitted required member indistinguishable
from a legitimate empty one, so the two are now separated: an empty array
still gets the canned reply, an absent member is a ValidationException.
harnessArn and runtimeSessionId were only checked for being non-blank.
Both carry modelled constraints, taken from the bundled botocore service
model rather than guessed:
harnessArn arn:...:bedrock-agentcore:<region>:<account>:harness/
<name>-<10 alphanumerics>
runtimeSessionId 33 to 100 characters, [a-zA-Z0-9][a-zA-Z0-9-_]*
Real AgentCore enforces the ARN shape before anything else: an ARN of
harness/h-1 comes back as "Invalid harness ARN format" even when the rest
of the request is wrong too, which is why the test values in this branch
had to change.
The ARN's shape is checked but the harness is still not resolved, because
the emulator models no harness resource. A well formed ARN naming nothing
is accepted, and has a test saying so.
* fix(bedrock-agentcore): report a malformed harness ARN before a missing session id
The ARN shape was checked after both presence checks, so a request carrying a
malformed ARN and no runtimeSessionId header came back as "runtimeSessionId is
required" rather than the ARN error AWS returns. No test exercised two bad
fields at once.
The ARN is now validated whole, presence and shape together, before
runtimeSessionId is read.
* feat(sfn): apply ItemBatcher to distributed Map children
ItemBatcher was parsed and then ignored: every child execution received one
item regardless of MaxItemsPerBatch, so a state machine that batches ran with a
different payload shape locally than on AWS, silently.
Items are now grouped into batches and each child execution receives
{"BatchInput": ..., "Items": [...]}. A batch closes on MaxItemsPerBatch or
MaxInputBytesPerBatch, in their literal, Path and JSONata expression forms, and
with neither set every item lands in one batch. ItemSelector still runs per item
before grouping, so the transform sees $$.Map.Item as it did before.
MaxConcurrency now bounds concurrent batches, and DescribeMapRun separates the
two counters it used to share: itemCounts counts items, executionCounts counts
child executions.
* fix(sfn): cap a batch at the 256 KiB child-input ceiling
MaxInputBytesPerBatch being optional let MaxItemsPerBatch alone build a child
input larger than Step Functions would ever start, and the byte count measured
the items alone, so a declared cap could still be exceeded by the envelope,
BatchInput and separators.
Batching now measures the serialized child payload and closes a batch at the
declared limit or at 256 KiB, whichever is smaller.
* fix(sfn): fail an item too large to start a child execution
An item whose serialized batch input already exceeded 256 KiB was added anyway,
because the split branch is skipped while the batch is empty, producing a child
input AWS would refuse to start.
Such an item now fails the state with States.DataLimitExceeded, naming its size
and pointing at ItemSelector as the way to reduce it.
* refactor(sfn): resolve every integer Map field through one helper
MaxConcurrency and the ItemBatcher limits read the same three forms, literal,
Path and JSONata expression, through two near-identical methods. The batcher one
already parameterized the field name, so the pair collapses into a single
resolver with a minimum: 0 for MaxConcurrency, where it means the service
ceiling, and 1 for a batch limit, where it is meaningless.
The shared resolver also clamps an oversized value to Integer.MAX_VALUE, which
only the MaxConcurrency copy did before.
* feat(glue): implement partition indexes
CreatePartitionIndex and DeletePartitionIndex were missing, and
GetPartitionIndexes was a stub that resolved the table and then always
returned an empty list. A client could create an index and read back
nothing, and Terraform's aws_glue_partition_index could not apply at all.
Behaviour captured against real Glue in us-west-2, on a table partitioned
by tenant/year/month/day:
- an index key must name a partition column, else InvalidInputException
"IndexKeys not a part of PartitionColumns. Verify the indexKeys : [x]"
- keys need not be a prefix of the partition keys, and need not be in
partition order: [year] and [month, tenant] are both accepted
- a repeated index name gives AlreadyExistsException "... already exists
with the same name."
- a repeated key list under a new name is refused too: "... already
exists with the same keys." The comparison is order sensitive, so
[year, month] and [month, year] are distinct indexes
- a fourth index gives ResourceNumberLimitExceededException "Partition
index limit exceeded. Maximum: 3", and the cap is evaluated before the
duplicate checks
- deleting an unknown index gives EntityNotFoundException "Index with the
given indexName : x does not exist."
- a read resolves each key to its name and type from the table's
partition keys, while a create carries names only
Indexes live in their own store keyed by the table key, so the existing
deleteTable cascade sweeps them and a recreated table starts clean.
One deliberate divergence: an index is stored ACTIVE immediately. Real
Glue creates asynchronously, reports CREATING while it backfills, and
refuses a concurrent create on the same table. Settling immediately keeps
tests free of polling, and a client that waits for ACTIVE (the Terraform
provider does) completes on its first read.
Verified end to end against a local floci: the SDK round-trips create,
read and delete, every error above matches the capture, and a real
aws_glue_partition_index applies and destroys cleanly.
* feat(glue): expose the partition index lifecycle
The first cut stored an index ACTIVE on create and removed it on delete,
treating the lifecycle as an internal detail. It is not: a caller reads
IndexStatus from GetPartitionIndexes and can branch on it, so collapsing
the states changed an AWS-visible contract.
Captured against real Glue in us-west-2:
- a new index reports CREATING for roughly 12 seconds, then ACTIVE
- a deleted index reports DELETING before it disappears
- while either is in progress, another create on the same table gives
ResourceNumberLimitExceededException "Index <name> is in <STATE>
state. Only 1 index can be created or deleted simultaneously per
table."
- an index that is still CREATING cannot be deleted: Glue reports
EntityNotFoundException "Index with the given indexName : <name> does
not exist." even while a read lists it as CREATING. Measured in
isolation, with nothing else in flight
The transitions are driven by reads rather than wall-clock time, so they
stay deterministic and tests need no sleeps: each GetPartitionIndexes
reports the current state and settles it, so the next read sees the
outcome. A client that polls converges on its second call.
FAILED is not emulated; it only arises from a backfill failure.
Verified with a real aws_glue_partition_index against a local floci:
apply polls CREATING to ACTIVE and completes, a refresh reports no drift,
and destroy passes through DELETING.
Also replaces var with explicit types and drops inline fully-qualified
names in the tests, per the AGENTS.md rule.
* docs(glue): correct two javadocs left behind by the index lifecycle
Both still said an index is stored ACTIVE immediately, which stopped being
true when createPartitionIndex started storing CREATING and letting
GetPartitionIndexes settle it.
* fix(glue): serialize partition index writes against their own reads
createPartitionIndex reads the stored indexes, checks the cap and the duplicate
rules, then writes, with nothing holding that together. Two concurrent creates
on a table at two indexes both saw room under the cap of three and both wrote,
leaving four. Nothing repairs that afterwards.
create, delete and the settling loop in getPartitionIndexes now carry the same
synchronized treatment updateTable already uses for its own check-then-write.
* perf(iam): cache parsed policy documents in IamPolicyEvaluator
Every evaluate call parsed each policy document with Jackson again. A caller
with a large managed policy such as ReadOnlyAccess (94 KB) paid that parse
on every request under IAM enforcement.
The evaluator now keeps the parsed statements per document text in a
ConcurrentHashMap. Parsing is a pure function of the text, so entries never
go stale. The map is bounded at 2048 entries and cleared when the bound is
reached, which only matters for many distinct session policies. A document
that fails to parse is cached as failed, so the warning is logged once
instead of on every request.
AWS managed policy catalog has 1566 documents. All 1566 parsed take about
9.5 MB of heap, and AWS caps a customer managed policy at 6144 characters
and a session policy at 2048, so 2048 entries stay within tens of MBs in
the worst case.
* perf(iam): store policy patterns lowercased in the parsed statement cache
Action and Resource matching is case-insensitive. globMatches lowercased
both the pattern and the request value on every comparison, which for a
policy like ReadOnlyAccess meant about 5800 new strings per request.
The patterns are now lowercased once when the document is parsed and
cached, and the request action and resource are lowercased once per
evaluation. The public globMatches helper used by the trust policy and S3
public access evaluators is unchanged.
* fix(iam): compare resource ARNs case-sensitively
AWS documents the Action element as case-insensitive, but the Resource
element is not: the IAM user name in a Resource ARN is case sensitive, and
so are S3 object keys. The evaluator lowercased both sides of every
Resource and NotResource comparison, so a grant on user/Bob also matched
user/bob and a grant on bucket/Private/* also matched bucket/private/*.
Resource and NotResource patterns are now kept as written in the parsed
statement cache and the request resource is compared as is. Action and
NotAction patterns stay lowercased once at parse time.
BcmDataExportsService and CurService each carried identical
requireValidBucketName and requireSafeKeySegment helpers used to validate
an export configuration's S3 destination. Move them into a new
core.common.S3DestinationValidation utility and have both services
delegate to it instead of maintaining two independent copies.
Fixes#3651
CreateDBProxy/AWS::RDS::DBProxy rejected EndpointNetworkType/TargetConnectionNetworkType
outright for anything other than IPV4 ("Floci currently exposes IPv4 proxy networking only").
Both fields are now accepted and stored on the DbProxy record:
- EndpointNetworkType: IPV4, IPV6, or DUAL
- TargetConnectionNetworkType: IPV4 or IPV6 (no DUAL, matching AWS's own constraint)
They round-trip through DescribeDBProxies and CloudFormation the same way the proxy's other
control-plane settings (pool sizing, TLS, idle timeout) already did.
AWS's RDS Proxy network prerequisites require both the VPC and every selected subnet to carry
an associated IPv6 CIDR block for IPV6/DUAL. floci already modeled VPC-level IPv6 CIDR
associations; subnet-level association is now modeled too (Subnet.ipv6CidrBlockAssociationSet,
CreateSubnet's Ipv6CidrBlock parameter, and the DescribeSubnets/CreateSubnet response), and
createDbProxy validates both the VPC and every VpcSubnetIds entry before accepting a non-IPV4
network type, rejecting with InvalidParameterValue otherwise. Genuinely invalid enum values are
still rejected at both the RDS Query API and CloudFormation provisioner layers.
The CloudFormation update path now also refuses a changed EndpointNetworkType or
TargetConnectionNetworkType the same way it already refused a changed DBProxyName, EngineFamily,
or VpcSubnetIds: both are createOnlyProperties in the AWS::RDS::DBProxy registry schema, and
ModifyDBProxy has no such parameters, so silently accepting a changed value on UpdateStack would
report UPDATE_COMPLETE while the proxy's actual network type stayed put.
Added a Terraform compatibility scenario (rds-proxy-network-type-tf) with a genuinely
dual-stack VPC and subnets, plus negative cases for an IPv4-only VPC and for a dual-stack VPC
whose subnets lack an IPv6 CIDR block.
TagResource/UntagResource/ListTagsForResource rejected a snapshot ARN
outright ("not yet implemented by Floci"), and CreateDBSnapshot
silently dropped its Tags parameter even though DbSnapshot already had
a tags field. Both are now wired up: CreateDBSnapshot stores Tags, the
generic tag-resource dispatch resolves a "snapshot" ARN type against
the snapshot store, and DescribeDBSnapshots echoes DBSnapshotArn and
TagList like the other tagged resource types already do.
Snapshots are now region-scoped the same way DB instances and clusters
already are: CreateDBSnapshot/DescribeDBSnapshots/DescribeDBSnapshot-
Attributes/ModifyDBSnapshotAttribute/RestoreDBInstanceFromDBSnapshot
all thread the request's signed region through to snapshot storage and
lookup (via the same dbResourceKey/hasRdsResourceIdentity scoping the
instance/cluster stores use), so DBSnapshotArn reflects the request's
actual region and a snapshot created in one region is not visible to
Describe/Tag calls signed for another.
Verifying this live against a real floci instance via Terraform
surfaced two more gaps blocking any use of aws_db_snapshot at all,
regardless of tagging: DescribeDBSnapshotAttributes (called on every
read of the resource) and ModifyDBSnapshotAttribute were both
completely unimplemented. Added minimal support for both (the
"restore" attribute, i.e. cross-account copy/restore authorization,
modeled as plain in-memory state, no real cross-account sharing).
DeleteDBSnapshot is also unimplemented and was not added here — a
snapshot can be created and tagged but not destroyed via Terraform.
Noted in docs/services/rds.md as a follow-up, along with the other
resource types the original gap report mentioned (Aurora cluster
snapshots, reserved instances) that aren't modeled in Floci at all, so
tagging doesn't apply to them either.
Added a Terraform compatibility scenario (aws_db_snapshot with tags,
verifying create, tag read-back, a clean second plan, and an in-place
tag update) and ran it against a live floci instance before
committing, including a re-run after the region-scoping fix.
ExecuteApiSigV4Authorizer (API Gateway execute-api IAM auth) and
IamAuthValidator (AppSync GraphQL IAM auth) each carried an identical
CredentialScope record and identical signing-key/HMAC/hash/log-sanitizing
helpers. Move CredentialScope into core.common.auth and widen
SigV4RequestValidator (introduced in #3581) with the crypto and
normalizeHeaderValue helpers both verifiers already relied on, so both
delegate to one shared copy instead of two independently-maintained ones.
Fixes#3650
DocDbQueryHandler, NeptuneQueryHandler, and RdsQueryHandler each carried their own
byte-for-byte identical handleDescribeGlobalClusters: global clusters aren't modeled by
any of the three, so all three validate MaxRecords/GlobalClusterIdentifier/Marker the
same way and always answer with an empty GlobalClusters list, since DocumentDB and
Neptune both accept the RDS-family wire protocol and claim compatibility for this
operation.
Extracted into a new RdsFamilyQuerySupport under core.common (a static utility, not a
CDI-injected sibling handler like RdsQueryHandler's existing DocDbQueryHandler/
NeptuneQueryHandler dependencies: those exist for real cross-service data composition,
this operation has no state to share, just identical logic). Each handler's own
handleDescribeGlobalClusters is now a one-line delegation, keeping its own LOG so log
lines still attribute to the right service.
Scope note: CPD also flagged the two other pairwise overlaps this issue names (33-line
DocDb/RDS, 26-line Neptune/RDS), but those turned out to be the same
handleDescribeGlobalClusters match window overlapping into neighboring methods, not a
separate duplicate; this extraction covers them too. A much larger set of CPD matches
between DocDbQueryHandler and NeptuneQueryHandler (cluster/instance CRUD, tag parsing,
XML builders, effectively most of both handlers) is a separate, pre-existing
architectural duplication between those two services well beyond what this issue asks
for, and is not touched here.
No behavior change. Full docdb, neptune, and rds test suites pass unchanged (one
NeptuneOpenCypherIntegrationTest Bolt-protocol timeout is a pre-existing environmental
flake, confirmed by reproducing it identically against unmodified main).
Moves the last CloudFront type out of the monolith switch and into the provisioner that
already owns the four configuration types a distribution references by id. Monolith 4,702
to 4,521 lines, legacy types 29 to 28. No new class: the type joins an existing
provisioner that already injects CloudFrontService and is already wired into
CfnProvisionerFixture.
Nine private helpers move with it, every one exclusive to the distribution: cfnOrigins,
cfnDefaultCacheBehavior, cfnCacheBehaviors, cfnCustomErrorResponses, putIfPresent,
cfnStringList, cfnText, cfnTextOrDefault and cfnBool. cfnText shows 21 references in the
monolith and looks shared until each is resolved to its enclosing method: they are all
CloudFront. All nine are carried over byte for byte.
The provision method itself changes in exactly two places. It takes a ProvisionContext
rather than a bare engine, and it decides create versus update from ctx.isUpdate() and
ctx.priorPhysicalId() rather than reading the physical id off the resource, which is what
AGENTS.md asks for because provision assigns the new id as it runs. The two are the same
value on the same call: the engine sets resource.setPhysicalId(existingPhysicalId) and
passes that same variable into the context.
Delete keeps the monolith's behaviour. removeDistribution is the stack-level delete, with
no disable or If-Match guard, and it tolerates an id that is already gone, so unlike the
policy arms beside it there is no not-found code to list.
Also deletes blankToNull, which #3582 left behind with no caller. It had 9 references
before that PR and 1 after, its own definition.
Tests: three cases added to the existing CloudFrontCfnProvisionerTest covering create with
the exact Fn::GetAtt keys, an in-place update under the prior id, and the stack-level
delete. servesTheFourConfigTypes pinned the served set at four types and is renamed and
widened to five, which is the assertion doing its job rather than an inconvenience.
Registration is proved rather than assumed: removing the type from resourceTypes(), which
is what a missed registration looks like, fails both CfnResourceInventoryTest and the
provisioner test. Without that, the dispatcher's stub arm reports CREATE_COMPLETE with a
synthetic ARN and the suite stays green.
SubmitJob previously rejected arrayProperties/nodeProperties/nodeOverrides
outright. Array jobs now fan out real child jobs (<parentId>:<index>) that
run through the existing single-job pipeline; the parent's status and
arrayProperties.statusSummary are computed live from its children on every
DescribeJobs/ListJobs call instead of being stored and incrementally
updated, which avoids a race between concurrently finishing children.
Multi-node parallel jobs are supported via a new "multinode" job
definition type (numNodes/mainNode/nodeRangeProperties, validated for full
node coverage). SubmitJob runs one Docker container per node concurrently;
per AWS's documented MNP semantics, the job's status, retry decision, and
started/stoppedAt/statusReason are all determined solely by the main node,
not by any node that happens to fail. nodeOverrides.numNodes is supported
with AWS's real validation (requires an open-ended node range).
ListJobs gains arrayJobId and multiNodeJobId support.
dependsOn (job dependencies), CancelJob/TerminateJob (not implemented at
all, pre-existing), EventBridge forwarding of these new fields, and
CloudFormation-provisioned multinode job definitions remain out of scope
and are noted in docs/services/batch.md.
Floci could run exactly one web console, the image it ships. This publishes the contract
between Floci and a console so any image can take that slot, and an operator gets there by
setting one image name rather than by configuring seven fields.
Three things make a console a Floci console: it listens on the port in PORT, it serves
GET /api/health, and it talks to Floci at AWS_ENDPOINT_URL. Everything else is detail the
contract spells out, including the AWS baseline every launched container already receives,
so a console built on any AWS SDK is configured by that SDK's ordinary endpoint and
credential discovery.
Floci learns a console's shape from three sources, in order. The image's own
io.floci.console.* labels come first, so a console describes itself and needs no operator
input at all. A built-in profile covers the consoles Floci already knows. The contract
defaults (/api/health, port 4500, status: ok) cover the rest. Configuration overrides all
three, for a console that describes itself neither way.
That ladder is why the new config keys ship commented out in application.yml. They exist for
the console that fits none of the three sources, and setting one silently disables the
discovery that would otherwise just work. Every accessor is Optional or OptionalInt, so
nothing is required and the test configuration needs no entry.
A malformed label is ignored rather than fatal: a console that declares port="banana" starts
on the default instead of failing the emulator, and the reason is logged.
Docs: docs/ui/console-contract.md is the contract itself, written for console authors, and
docs/ui/index.md is the operator's page. Both are in the mkdocs nav.
Tests: 608 lines. ConsoleProfileResolverTest covers the resolution ladder including the
precedence between its three sources; ContainerLifecycleManagerImageLabelsTest covers reading
labels off an image; FlociUiManagerTest grows to cover the manager against the contract.
Neutralising the label arm fails 5 of the 13 resolver tests, so the ladder is genuinely
exercised rather than the tests only asserting defaults.
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
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.
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.
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.
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.
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>
* 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>
* 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
* 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.
* 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
* 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.
* 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
* 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
* 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>
* 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
* 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
* fix(stepfunctions): resolve state machine alias arns
* docs(stepfunctions): list alias actions
* fix(stepfunctions): paginate state machine aliases
* ci: rerun compatibility checks
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.
* 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>