Commit Graph
885 Commits
Author SHA1 Message Date
Ed Jeffreys 37f37d1292 fix(s3): implement TaggingDirective=COPY default in CopyObject (#1049)
* fix(s3): implement TaggingDirective=COPY default in CopyObject
2026-05-26 21:37:37 -05:00
Kenshin Okinaka 4aea1c7c37 fix(elbv2): offload Lambda invocation to a worker thread (#1034)
* fix(elbv2): offload Lambda invocation to a worker thread

ElbV2DataPlane.invokeLambdaTarget called lambdaService.invoke(...)
synchronously inside req.bodyHandler, which runs on a Vert.x
event-loop thread. The invocation blocks for seconds while a cold
Lambda container warms and polls the Runtime API. The Runtime API
itself is a Vert.x HttpServer, so blocking the listener's event loop
starved the runtime — every ALB → Lambda request hung until the
function timed out and returned 502.

Wrap the invocation in vertx.executeBlocking and shape the response
on the resulting Future, mirroring WebSocketHandler.invokeIntegration.

Add ElbV2LambdaTargetDataPlaneIntegrationTest, which deploys a real
Node.js Lambda, sends an HTTP request through the listener port, and
asserts the Lambda's response shape. The existing
ElbV2LambdaTargetIntegrationTest only covered the control plane and
ran with floci.services.elbv2.mock=true, which is why this bug went
undetected. The new test uses @TestProfile to disable the ELBv2
mock so the data plane is exercised end-to-end.

* fix(elbv2): address review feedback on ALB→Lambda fix

- Pass ordered=false to vertx.executeBlocking so independent ALB
  requests run in parallel on the worker pool instead of being
  serialized per context.
- Use StandardCharsets.UTF_8 when encoding the Node.js handler source
  so the generated zip is byte-deterministic across platforms.
- Make cleanup robust to partial failures by null-guarding each
  delete and accepting 404 for the Lambda function delete. Cleanup
  stays as a final ordered @Test (rather than @AfterAll) because
  the Quarkus REST endpoint is torn down before JUnit's @AfterAll
  runs; an HTTP-based teardown there would fail with connection
  refused. Bumped the order to Integer.MAX_VALUE so the cleanup
  step keeps running last regardless of future test additions.

* test(elbv2): align ALB→Lambda dataplane test with the bug repro

Switch the test Lambda from nodejs20.x to python3.11 so it mirrors
the reproduction script in the bug report verbatim. The handler now
returns {"statusCode": 200, "body": "ok"} and the assertion drops
the path-echo and content-type checks — status 200 plus body "ok"
is still a tight enough signal that the entire ALB → Lambda data
plane round-trip succeeded.

* test(elbv2): bump dataplane test runtime to python3.14

Match the latest Python runtime supported by Floci's image map
and keep alignment with the bug repro.
2026-05-26 21:22:50 -05:00
Matt Lishman ec948fe3a8 fix(cloudformation): implement nested stack deployment via AWS::CloudFormation::Stack (#1052)
Previously AWS::CloudFormation::Stack was stubbed — it returned a synthetic
stack ID but never fetched or deployed the child template, so all resources
defined in nested stacks were silently skipped.

Intercept AWS::CloudFormation::Stack in CloudFormationService.executeTemplate()
before delegating to the provisioner. Resolve TemplateURL via the template
engine, fetch the child template from the bootstrap S3 bucket, create a child
Stack, and execute it recursively on the same thread. Child outputs are surfaced
as Outputs.X attributes on the parent resource so Fn::GetAtt cross-stack
references resolve correctly.

Removes the provisionNestedStack stub from CloudFormationResourceProvisioner.

Closes #1051
2026-05-26 21:21:46 -05:00
Steve b07c9ef28b fix(lambda): Lambda WarmPool timeout when stopping multiple containers; run in parallel (#1055) 2026-05-26 18:14:10 -05:00
Shubham Srivastava 89d405316d feat(opensearch): support OpenSearch 3.x, validate engine versions, real ES 7.10 OSS image (#1025)
Centralizes engine versions in a new OpenSearchVersions catalog and
threads them through CreateDomain / UpdateDomainConfig / UpgradeDomain
validation plus per-version Docker image resolution.

- Adds OpenSearch 3.0–3.6 and 2.15 / 2.17 / 2.19 to the supported list;
  default version is now OpenSearch_2.19 (was 2.11).
- EngineVersion now maps to a concrete image tag at start time, so
  CreateDomain --engine-version=OpenSearch_3.6 actually pulls
  opensearchproject/opensearch:3.6.0 instead of always pulling the
  default 2.x rolling tag.
- Elasticsearch_7.10 / 7.9 / 7.8 now resolve to their OSS images on
  docker.elastic.co; previously these versions were advertised but the
  service silently ran an OpenSearch 2.x container under the hood.
- OpenSearch 2.12+ start scripts require OPENSEARCH_INITIAL_ADMIN_PASSWORD
  even when the security plugin is disabled. Set automatically.
- The Elasticsearch OSS distribution ships without x-pack, so any xpack.*
  setting is rejected as an unknown setting at boot. Don't touch xpack
  env on Elasticsearch_* domains.
- CreateDomain / UpdateDomainConfig / UpgradeDomain now reject unknown
  engine versions and unsupported upgrade hops with ValidationException.
- GetCompatibleVersions returns the full source→targets matrix when
  domainName is omitted and a single domain-scoped row when set, matching
  AWS's documented behavior.
- INSTANCE_TYPES catalog gains Graviton2/3 (m6g, r6g, c6g, m7g, r7g, c7g)
  and or1.* OpenSearch-optimized families that AWS now exposes.

Tests: 44 OpenSearch tests pass (31 integration + 13 new
OpenSearchVersionsTest unit tests). All four engine version paths
exercised live against Docker (OS 3.6, OS 2.11, ES 7.10 OSS, unknown
version rejection).
2026-05-25 11:47:06 -05:00
Hector Ventura a33ce857bb fix(s3): remove shadowed hasQueryParam that misrouted presigned PUT with x-amz-tagging header (#1023) 2026-05-24 16:44:50 -05:00
Simon B. LaursenandSimon B. Laursen 9056f80028 fix(iam): honour 12-digit access key in IAM resource ARNs (#1017)
IamService constructed its accountId once at startup from
config.defaultAccountId() (always '000000000000'), so every CreateRole,
CreateUser, CreateGroup, CreatePolicy and CreateInstanceProfile call
returned an ARN with the wrong account — identical to the STS bug fixed
in #983.

Inject RegionResolver and call regionResolver.getAccountId() per request
inside iamArn(), so the ARN reflects the caller's account when a 12-digit
AKID is used.

Add integration tests iamCreateRoleHonoursTwelveDigitAccessKey and
iamGetRoleHonoursTwelveDigitAccessKey to cover the fix.

Co-authored-by: Simon B. Laursen <sls@bankdata.dk>
2026-05-24 16:13:15 -05:00
Dixit R Jain 7e43b015e6 feat(lambda): Lambda layer support (PublishLayerVersion, GetLayerVersion, ListLayerVersions, DeleteLayerVersion) (#1015)
* feat: support PublishLayerVersion, GetLayerVersion, ListLayerVersions, DeleteLayerVersion and layer attachment

Implements full Lambda Layer lifecycle:
- PublishLayerVersion: POST /2018-10-31/layers/{name}/versions
- GetLayerVersion: GET /2018-10-31/layers/{name}/versions/{ver}
- ListLayerVersions: GET /2018-10-31/layers/{name}/versions
- DeleteLayerVersion: DELETE /2018-10-31/layers/{name}/versions/{ver}
- ListLayers: GET /2018-10-31/layers (now returns real data)

Layer content is extracted to disk and copied into Lambda containers
at /opt during launch, matching real AWS behavior where layers are
available at /opt/nodejs/node_modules/ etc.

CreateFunction and UpdateFunctionConfiguration already stored layer
ARNs; this commit makes the layer data actually resolvable and
mountable at runtime.

Closes #875

* feat: add Node SDK compatibility tests for Lambda Layers

Adds lambda-layers.test.ts covering:
- PublishLayerVersion (version 1 and 2)
- GetLayerVersion (success and 404)
- ListLayerVersions
- ListLayers
- DeleteLayerVersion (success, idempotent for non-existent)
- Layer attachment on CreateFunction
- Layer round-trip via GetFunctionConfiguration
- Layer update/removal via UpdateFunctionConfiguration
2026-05-24 15:05:56 -05:00
Juano Morello 1dfa7bfcab feat(elbv2): add listener attribute and capacity reservation actions (#1021)
@pulumi/aws 6.66+ calls DescribeListenerAttributes and
DescribeCapacityReservation when refreshing Listener and LoadBalancer
resources. Floci returned UnsupportedOperation for both, which crashes
the AWS provider.

Implement DescribeListenerAttributes and ModifyListenerAttributes
(mirroring the existing load balancer / target group attribute handlers,
backed by the Listener.attributes map) and DescribeCapacityReservation
(reports an empty reservation, since Floci does not reserve load balancer
capacity). Add integration coverage for all three actions and their
not-found error paths.
2026-05-24 14:59:00 -05:00
Matt Lloyd 8af3611d7a fix(cognito-idp): include user attributes in ID token claims (#984) (#985)
ID tokens were missing all standard user attributes (e.g. given_name,
family_name, email_verified) and every custom:* attribute, leaving only
the AWS-internal claims. Copy the stored user attributes into the ID
token (id_token only, not access_token) and coerce email_verified,
phone_number_verified, and updated_at to their OIDC-spec JSON types
instead of leaving them as strings.
2026-05-24 14:58:16 -05:00
kyounghoonJang 255b41bca8 feat(kms): add RotateKeyOnDemand support (#990) 2026-05-24 14:34:51 -05:00
opcode-secandHector Ventura 8fb07d2654 fix(s3): persist inline x-amz-tagging header on PutObject (#987)
* fix(s3): persist inline x-amz-tagging header on PutObject

PutObject silently dropped tags supplied via the x-amz-tagging request header — the controller did not read the header and tags never reached the object store. Adds a header parameter, parses the URL-encoded key=value tag set (with 10-tag and 8 KB limits), and persists via the existing putObjectTagging path so behavior matches real AWS S3.

* test(s3): add negative-path tests for inline x-amz-tagging header

Cover malformed pair, empty key, duplicate key, >10 tags, and oversized header. Note in S3Controller that the InvalidArgument and BadRequest codes match observed real-AWS behavior even though they are not in the S3 Smithy service model

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
2026-05-24 14:30:50 -05:00
iam-ssrivastav 2da06840e9 fix(apigateway): implement V1 deleteDeployment endpoint and return correct JSON 404 error (#1019) 2026-05-24 14:12:53 -05:00
Albert Einshutoin b7cf8b6ebe fix(rds): register DbEndpoint for native reflection (#1014) 2026-05-24 14:11:58 -05:00
Dixit R Jain 5772e49470 feat(apigateway): add Lambda REQUEST authorizer support for HTTP API v2 routes (#1011)
Implement Lambda REQUEST authorizer invocation for HTTP API routes
configured with authorizationType=CUSTOM. Previously, Floci silently
skipped authorization for these routes.

Supports:
- Payload format version 1.0 (REST API-compatible event shape)
- Payload format version 2.0 (HTTP API-native event shape)
- Simple responses (isAuthorized: true/false) when enableSimpleResponses=true
- IAM policy document responses (policyDocument with Allow/Deny)
- Identity source validation ($request.header.X, $request.querystring.X)
  returning 401 without invoking Lambda when sources are missing

Closes #812
2026-05-24 09:38:17 -05:00
Juano Morello c7317c1626 fix(ecr): release registry port when container start fails (#1010)
ensureStarted() reserved a port from the 5100-5199 pool but never
released it when the registry container failed to start. Because
PortAllocator is @ApplicationScoped, each failed start leaked a port
permanently, eventually exhausting the pool and masking the real
failure with "No free port available in range 5100-5199".

Widen the try to cover spec building and addPersistenceMounts (the
first Docker call in named-volume mode) and release the port on
failure unless the container started, mirroring the existing pattern
in RuntimeApiServerFactory and Ec2ContainerManager.
2026-05-23 22:40:50 -05:00
Ben Younes 214d404733 feat(apigateway): persist UpdateStage methodSettings patch operations on v1 stages (#1004)
UpdateStage patch paths of the form /<resourcePath>/<httpMethod>/<settingKey>
(e.g. /*/*/metrics/enabled, /*/*/throttling/burstLimit, /pets/GET/caching/enabled)
were silently accepted but discarded, so GetStage returned no methodSettings
field and the Terraform aws_api_gateway_method_settings resource failed with
"empty result" when read after apply.

Adds a MethodSetting POJO with the AWS-documented fields, stores them on
Stage in a Map keyed by "<resourcePath>/<httpMethod>", parses the patch path
suffix against the canonical setting keys (metrics, logging, throttling,
caching), and serialises the map under "methodSettings" in toStageNode so
GetStage round-trips the values the patch wrote.

New ApiGatewayStageMethodSettingsIntegrationTest covers the three Terraform
scenarios (wildcard throttling + logging, wildcard caching, and per-method
overrides); verified failing on main and passing with this change.
2026-05-23 22:39:23 -05:00
3a31c792fa fix(apigateway): populate full APIGatewayRequestAuthorizerEvent for REQUEST authorizers (#1002)
* fix: populate full APIGatewayRequestAuthorizerEvent for REQUEST authorizers

Closes #807.

Previously, REQUEST-type Lambda authorizers received only 'type' and
'methodArn'. This commit populates the complete event shape matching
real AWS behavior:

- headers, multiValueHeaders
- queryStringParameters, multiValueQueryStringParameters
- pathParameters (empty object when none, not null)
- stageVariables (from Stage config, null when unconfigured)
- requestContext with accountId, apiId, resourceId, resourcePath,
  path, httpMethod, stage, requestId, requestTimeEpoch
- requestContext.identity with sourceIp, userAgent, apiKey, clientCert

Also enriches the AWS_PROXY integration event (buildProxyEvent) with:
- Full identity object (all null fields matching AWS wire format)
- domainName, domainPrefix, protocol, requestTime, extendedRequestId
- stageVariables from Stage configuration
- API key resolution from usage plan keys

Refactors shared logic into reusable helpers:
- putSingleValueHeaders, putMultiValueHeaders
- putQueryStringParameters, putMultiValueQueryStringParameters

Resolves API key once per request (not duplicated across authorizer
and proxy event builders).

* fix: remove AWS SDK deps from main pom, rewrite test with RestAssured

Addresses review feedback: AWS SDK dependencies should not be in the
main Floci project. Rewrites ApiGatewayRequestAuthorizerIntegrationTest
to use only RestAssured for management-plane and execute-api calls,
matching the established pattern of all other @QuarkusTest tests.

---------

Co-authored-by: Dixit R Jain <dixitrjain@Dixits-MacBook-Pro.local>
Co-authored-by: Dixit R Jain <dixitrjain@Mac.lan>
2026-05-23 22:38:09 -05:00
nblomquist 894b39f446 fix(s3): avoid misrouting presigned PUTs with tagging (#932) (#995) 2026-05-23 22:33:30 -05:00
Ben Younes f5dba627be fix(sns): return per-entry failures from PublishBatch instead of aborting whole batch (#1008)
Real AWS SNS PublishBatch surfaces an attribute parsing error
(e.g. invalid base64 in a BinaryValue) as a Failed entry with
InvalidParameterValue + SenderFault=true, and continues publishing
the remaining valid entries.

Both SnsQueryHandler and SnsJsonHandler used to let the AwsException
from parseMessageAttributes propagate out of the batch loop, returning
a 400 (Query) or letting the exception bubble (JSON) and aborting the
whole batch. They now catch the per-entry parse failure, record it as
a Failed entry, and merge it with the regular batch result.

Fix #992
2026-05-23 22:27:50 -05:00
Arthur Tristram 6434fc91f7 fix(Cognito): implement CloudFormation provisioning for UserPool and UserPoolClient (#1007) 2026-05-23 15:32:23 -05:00
Hector Ventura bf093ce0f4 fix: init shows wrong status when tls is enabled and adding app config (#1006)
* fix(lifecycle,appconfig): TLS startup readiness and listHostedConfigurationVersions

Fixes two independent issues:
is enabled, Quarkus binds the HTTP backend on port 4510 and the HttpServerStart
event fires with that port, so markStartCompleted/markReadyCompleted were never
called and /_floci/init always returned ready=false. Fix: derive the expected
port from config.tls().enabled() at observer time.

/applications/{appId}/configurationprofiles/{profileId}/hostedconfigurationversions.
Unmatched requests fell through to S3Controller's catch-all and returned a
NoSuchBucket XML error. Fix: add HostedConfigurationVersionSummary model,
listHostedConfigurationVersions service method, and the missing GET route.

* fix(commit-checks): fix action that check commit format
2026-05-23 15:31:42 -05:00
Ben Younes 71d00613db fix(s3): unblock .well-known/* object keys hijacked by Cognito routes (#1003)
S3 object keys under .well-known/ (e.g. bucket/.well-known/jwks.json) were
being routed to CognitoWellKnownController instead of S3Controller. The
controller threw ResourceNotFoundException ("User pool not found"), masking
the S3 object even though list-objects-v2 and head-object returned it.

Real Cognito UserPool IDs always contain an underscore (region prefix +
underscore + random suffix, e.g. us-east-1_xxx); AWS S3 bucket names forbid
underscores. Constraining the {poolId} path parameter to "[^/_]+_[^/]+"
ensures that any first path segment without an underscore falls through to
S3Controller, restoring the documented S3 behaviour without affecting
existing Cognito tests.

Adds S3WellKnownKeyIntegrationTest covering both jwks.json and
openid-configuration object keys; verified failing on main and passing with
this fix.
2026-05-23 09:04:59 -05:00
Stuart Lang 27d72f119c fix(sns): preserve binary message attributes through publish and fan-out (#989)
* fix(sns): preserve binary message attributes through publish and fan-out

Parse BinaryValue on Publish/PublishBatch in both JSON and Query handlers,
and base64-encode binary attributes in the SNS-to-SQS and Lambda JSON
envelopes so binary attributes survive fan-out instead of being dropped.

Closes #988

* fix(sns): return AWS-style 400 for invalid base64 and align DataType default

Address Copilot PR feedback:

- Catch IllegalArgumentException from Base64 decoding in both Publish and
  PublishBatch attribute parsing (JSON + Query handlers) and surface an
  InvalidParameterValue / HTTP 400 error consistent with other SNS errors.
- Default DataType to "Binary" in SnsJsonHandler when only BinaryValue is
  provided, matching SnsQueryHandler behavior.
- Extract a shared parseMessageAttributes helper in each handler to remove
  duplication between Publish and PublishBatch.

* fix(sns): give new tests distinct @Order values and drop Base64 FQN

Address maintainer review feedback:

- Move new binary-attribute tests off @Order(9) (already used by
  publish_fanOutToSqsSubscriber) to @Order(18)/@Order(19) so their
  drainQueue calls don't race with other order-9 tests.
- Import java.util.Base64 in SnsQueryHandler, SnsJsonHandler, and
  SnsService and drop the fully-qualified references.
2026-05-22 18:03:32 -05:00
iam-ssrivastav ba04ec4eee feat(cognito): implement UpdateGroup, ListUsersInGroup, and AdminConfirmSignUp actions (#998) 2026-05-22 17:51:42 -05:00
ram-sarf f4a534c943 fix(s3): handle PutBucketRequestPayment instead of falling through to CreateBucket (#994)
PUT /{bucket}?requestPayment was not recognised as a sub-resource by
S3Controller, so the request fell through to the bucket-creation
handler. For any pre-existing bucket that returned
BucketAlreadyOwnedByYou (HTTP 409) — which broke real workloads such as
Terraform's aws_s3_bucket_request_payment_configuration on every
re-apply.

Add explicit handling for the requestPayment sub-resource, mirroring
the existing OwnershipControls / Acl flow:

- Bucket model gains a requestPaymentPayer field.
- S3Service.putBucketRequestPayment validates the bucket exists
  (NoSuchBucket / 404) and the payer value (BucketOwner | Requester);
  invalid payers return MalformedXML / 400 to match real S3.
- S3Service.getBucketRequestPayment returns the canonical
  RequestPaymentConfiguration XML, defaulting to BucketOwner when never
  set — real S3 never returns 404 for GetBucketRequestPayment.
- Controller dispatches PUT and GET ?requestPayment to the new methods.
  No DELETE handler is added; AWS does not expose one.

Regression test asserts the original Terraform-breaking case (a second
PUT on an existing bucket must return 200, not 409) along with default
GET, MalformedXML on invalid payer, and NoSuchBucket on missing bucket.
2026-05-22 17:51:15 -05:00
Eduardo Lugo Vela 9286dd7602 fix(s3): restore object on delete marker removal and add missing version headers (#966)
* fix(s3): restore object on delete marker removal and add missing version headers
* fix(s3): use millisecond precision for version ordering to avoid same-second race condition
* test(s3): add regression tests for versioned delete behaviors and response headers
2026-05-22 17:49:47 -05:00
Stuart Lang 788ddf751f fix(sts): honour 12-digit access key as account ID in STS responses (#983)
* fix(sts): honour 12-digit access key as account ID

GetCallerIdentity, AssumeRole, AssumeRoleWithWebIdentity,
AssumeRoleWithSAML, and GetFederationToken now resolve the account ID
from the request-scoped RegionResolver instead of the static IAM
default, so ARNs match the per-account namespace used by SNS, SQS, S3,
etc. Closes #981.

* fix(sts): derive AssumedRoleUser account from RoleArn

AssumeRole, AssumeRoleWithWebIdentity, and AssumeRoleWithSAML now build
AssumedRoleUser.Arn using the account ID parsed from the supplied
RoleArn, falling back to the caller's account only when the ARN is
missing or unparseable. This matches AWS cross-account assume-role
behaviour: the resulting ARN belongs to the target role's account, not
the caller's.
2026-05-21 20:36:28 -05:00
dagrammy ff40a2fc0a fix(sqs): accept bare queue name in QueueUrl field (#980)
AWS SQS resolves a plain queue name (e.g. "TestQueue") to the full queue URL transparently. Floci required the full URL, causing  NonExistentQueue errors for clients that pass only the name - a pattern common in AWS SDK for Java v2 applications.

Add normalizeQueueUrl() which expands bare names to the canonical {baseUrl}/{accountId}/{queueName} form before storage-key computation, covering all SQS operations that accept a QueueUrl parameter.
2026-05-21 20:35:12 -05:00
Stuart Lang be4eba1c20 fix(s3): accept region-qualified virtual-host form bucket.s3.<region>.<host> (#978)
* fix(s3): accept region-qualified virtual-host form bucket.s3.<region>.<host>

AWS SDKs may send Host: bucket.s3.<region>.<host> for virtual-hosted
style requests. Recognize this form against both the configured base
hostname and the localhost fallback so the bucket is extracted correctly.

Closes #977

* test(s3): add integration coverage for region-qualified virtual-host

Exercise Host: <bucket>.s3.<region>.localhost end-to-end: HEAD returns
404 for a missing bucket, PUT creates it, HEAD then returns 200, and
PUT/GET on an object roundtrips.
2026-05-21 18:22:50 -05:00
Arthur Tristram 1cdb4389a6 fix(sqs-sns): add ContentBasedDeduplication and SNS Subscription provisioning (#974) 2026-05-21 18:19:37 -05:00
Hector Ventura 4edb6f93f6 fix(s3): return ObjectLockConfigurationNotFoundError for non-lock buckets (#971)
GetObjectLockConfiguration was returning a 200 with ObjectLockEnabled=Enabled
for every bucket regardless of whether object lock was enabled at creation time.

Real AWS returns ObjectLockConfigurationNotFoundError (HTTP 404) when the bucket
was not created with x-amz-bucket-object-lock-enabled: true.

Added an isObjectLockEnabled() guard in S3Service before returning the retention
configuration. The controller's existing try-catch routes the AwsException to
the XML error response with no additional changes needed.

Fixes #960
2026-05-20 23:43:56 -05:00
Hector Ventura b200280a83 feat(cloudfront): implement CloudFront service emulation (#969)
* feat(cloudfront): implement CloudFront service emulation

Adds full CloudFront emulation covering both core and extended operations using the REST XML protocol (2020-05-31 API).

Core resources:
- Distributions (CRUDL, copy, enable/disable, ETag concurrency)
- Cache Behaviors (default + ordered)
- Invalidations (create, get, list)
- Origin Access Controls and Origin Access Identities
- CloudFront Functions (create, update, publish, test, describe)

Extended resources:
- Continuous Deployment Policies
- Public Keys and Key Groups
- Realtime Log Configs (non-standard POST-based get/delete)
- Streaming Distributions (legacy RTMP, enforces disabled before delete)
- Field-Level Encryption Configs and Profiles
- Monitoring Subscriptions

Infrastructure:
- Registers CloudFrontController in ResolvedServiceCatalog as REST_XML
- Adds CloudFrontServiceConfig and CloudFrontStorageConfig to EmulatorConfig
- Adds CLOUDFRONT namespace constant to AwsNamespaces
- Registers CloudFrontService for GraalVM runtime initialization to avoid SecureRandom heap-baking in native builds
- Wires storage through StorageFactory with per-resource JSON files
- Adds cloudfront.md documentation page

* docs: revert docker-compose.yml
2026-05-20 23:12:03 -05:00
Hector Ventura eda92677dd fix(cbor): lowercase smithy-protocol response header casing (#968)
The Smithy RPC v2 CBOR protocol spec requires the response header to be
sent as `smithy-protocol` (lowercase). The previous casing `Smithy-Protocol`
caused SDK clients that perform a case-sensitive check on the response header
to fail protocol negotiation.
2026-05-20 22:20:02 -05:00
Darrell Draney 70958b1091 fix(s3): omit body-description headers and user metadata from PutObject response (#948)
## Summary

S3 `PutObject` was echoing the object's `Content-Encoding` (and `Content-Disposition`, `Cache-Control`, `x-amz-meta-*`) onto a response whose body is always empty. Real AWS S3 omits all of those on PutObject — they only belong on `GetObject` / `HeadObject`, where there is a body to describe.

The user-visible symptom is `Content-Encoding: gzip` on the PutObject response: AWS SDK for Java v2's `Crc32Validation.decompressing` interceptor sees the header, wraps the empty stream in `GZIPInputStream`, and throws `EOFException` from `readHeader`. The object is stored correctly server-side, but every gzip-encoded `PutObject` through the SDK fails before returning — breaking, for example, Spring Cloud AWS's `S3Template.upload(...)` with gzip metadata.

`S3Controller#putObject` now calls a new `appendPutObjectResponseHeaders(resp, obj)` that emits only the headers AWS returns on PutObject (storage-class when set, SSE when set, checksum, object-lock) and intentionally omits `Content-Encoding`, `Content-Disposition`, `Cache-Control`, `Content-Language`, `Expires`, and `x-amz-meta-*`. The shared `appendObjectHeaders` is untouched, so GET / HEAD / CopyObject — including the persistence behavior added by #56 / PR #57 — are unchanged.

Closes #944

## Type of change

- [x] Bug fix (`fix:`)
- [ ] New feature (`feat:`)
- [ ] Breaking change (`feat!:` or `fix!:`)
- [ ] Docs / chore

## AWS Compatibility

Incorrect behavior: PutObject's response copied the object's persisted `Content-Encoding` / `Content-Disposition` / `Cache-Control` / `x-amz-meta-*` headers onto a response that has no body.

Verified against real AWS S3 (`us-west-2`) with AWS CLI v2 (`aws-cli/2.27.58`) and AWS SDK for Java v2 (`software.amazon.awssdk:s3:2.42.24`). Eight `PutObject` scenarios were captured from botocore's `--debug` response-headers log, each with one additional request header. For every header this PR changes Floci's behavior on, the post-PR response matches AWS:

| Request includes | Pre-PR Floci response | Real AWS response | Post-PR Floci response |
|---|---|---|---|
| `Content-Encoding: gzip` | emits `Content-Encoding: gzip` | omits | omits |
| `Cache-Control: max-age=…` | emits `Cache-Control` | omits | omits |
| `Content-Disposition: …` | emits `Content-Disposition` | omits | omits |
| `x-amz-meta-owner: team-a` | emits `x-amz-meta-owner` | omits | omits |

(`Content-Language` and `Expires` exist in the old `appendObjectHeaders` only via `ResponseHeaderOverrides`, and the PutObject path passes `ResponseHeaderOverrides.NONE`, so they were never actually emitted on PutObject responses.)

Regression coverage, both layers:

- New SDK-level test `compatibility-tests/sdk-test-java/S3Test#putObjectWithContentEncodingDoesNotBreakSdkDecompression` uses a real `S3Client` to `PutObject` a gzip-encoded object. Before the fix it throws the exact `EOFException → Crc32Validation.decompressing → DefaultS3Client.putObject` stack from #944; with the fix it passes.
- Existing in-process `S3IntegrationTest#putObjectWithContentEncoding` gains assertions that `Content-Encoding`, `Content-Disposition`, and `Cache-Control` are absent from the PutObject response. Adjacent tests (`getObjectReturnsContentEncoding`, `headObjectReturnsContentEncoding`, `copyObjectPreservesContentEncoding`, and the Cache-Control / Content-Disposition equivalents) continue to assert those headers ARE returned on GET / HEAD / CopyObject — protecting the behavior fixed by #56 / PR #57.

## Checklist

- [x] `./mvnw test` passes locally (4700 tests, 0 failures, 0 errors, 8 skipped)
- [x] New or updated integration test added (RestAssured regression assertions in `S3IntegrationTest#putObjectWithContentEncoding`, plus new SDK test `S3Test#putObjectWithContentEncodingDoesNotBreakSdkDecompression` in `compatibility-tests/sdk-test-java`)
- [x] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/)
2026-05-20 18:03:54 -05:00
Marvelous Ikponmwosa 5f4dd43b5a feat(apigatewayv2): forward HTTP API requests through ALB listener (#941)
* feat(apigatewayv2): forward HTTP API requests through ALB listener
* implemented copilot feedbacks
* refactor(apigatewayv2): apply maintainer feedback
2026-05-20 18:00:30 -05:00
Albert Einshutoin 0a8732b349 fix(rds): persist metadata across storage-backed restarts (#945) 2026-05-20 17:36:54 -05:00
Federico Mariani 96a6fa6517 feat(config): add AWS Config service emulation (#934)
* feat(config): add AWS Config service emulation (#913)

* docs: add AWS Config service page and align service counts across all docs

Add docs/services/config.md with all 20 supported actions, CLI examples,
and configuration reference. Add 5 services that had doc pages but were
missing from the service matrix (Textract, Pricing, Cost Explorer, CUR,
BCM Data Exports). Reconcile service count to 51 across README,
docs/index.md, and docs/services/index.md.
2026-05-20 17:15:38 -05:00
Stuart Lang 9bdb5436f0 feat(sqs): persist and return AWSTraceHeader system attribute (#909)
* feat(sqs): persist and return AWSTraceHeader system attribute

SendMessage's MessageSystemAttributes parameter is restricted by AWS
to AWSTraceHeader (the X-Ray trace context). Both the JSON and Query
handlers were silently dropping it, so a subsequent ReceiveMessage
with MessageSystemAttributeNames=["All"] returned only the four
auto-derived attributes instead of the expected five.

Add awsTraceHeader to the Message model, parse it from the
MessageSystemAttributes.AWSTraceHeader.StringValue location on the
wire (both JSON 1.0 and Query protocol), thread a new sendMessage
overload through SqsService, and surface it as a system attribute
when "All" or "AWSTraceHeader" is requested on receive. The existing
overloads remain so internal callers (SNS delivery, ESM polling, etc.)
are unaffected.

* feat(sqs): parse AWSTraceHeader on SendMessageBatch entries and add wire tests

Review feedback on #909:

- SendMessageBatch (both JSON 1.0 and Query) was still ignoring per-entry
  MessageSystemAttributes, so AWSTraceHeader was dropped in batched
  sends even after the single-SendMessage fix. Parse it the same way as
  the single-message path on both protocols and pass it through to the
  existing sendMessage overload.

- Coverage was service-level only. Add wire-level tests that assert
  AWSTraceHeader is parsed off MessageSystemAttribute(s) and emitted
  under Attributes.AWSTraceHeader on ReceiveMessage for both single
  SendMessage and SendMessageBatch on both protocols.

- Reword the awsTraceHeader field comment to make clear the value is
  caller-supplied via MessageSystemAttributes, not server-generated.
2026-05-20 17:13:56 -05:00
Mike Mangino ce1f565003 Fix ListObjects v1 marker pagination (#939)
When listing with a prefix and a marker, the v1 ListObjects API was
ignoring the marker entirely, causing the same page to be returned on
every paginated call. Pass the marker as startAfter to
listObjectsWithPrefixes for v1 requests so pagination advances
correctly. Also emit <Marker> and <NextMarker> in the v1 XML response.
2026-05-19 21:55:19 -05:00
nblomquist 6819bce493 feat(kms): implement GenerateMac and VerifyMac (#927)
* feat(kms): implement GenerateMac and VerifyMac
* fix(kms): remove unused MAC message type handling
* test(kms): add MAC JSON handler integration coverage
* fix(kms): avoid duplicate MAC key resolution
2026-05-19 21:53:30 -05:00
Stuart Lang 24bbd81988 fix(sqs): reject SendMessageBatch when combined payload exceeds MaximumMessageSize (#907)
* fix(sqs): validate SendMessageBatch total payload size up-front

The batch handlers processed entries one at a time and only caught
per-entry size errors, so a batch whose combined payload exceeded the
queue's MaximumMessageSize landed in the response Failed collection
instead of triggering the batch-level BatchRequestTooLong error the
AWS SDK expects (and the BatchRequestTooLongException it surfaces).

Sum each entry's size up-front (using the same body + attribute
accounting as SendMessage), then call a new
SqsService.validateBatchPayloadSize that throws BatchRequestTooLong
when the total exceeds the queue's configured MaximumMessageSize.
Per-entry processing is unchanged -- individual entries that violate
other rules still surface as Failed entries.

* test(sqs): protocol-level coverage for oversized SendMessageBatch

Review feedback on #907: the new validateBatchPayloadSize path was only
exercised by direct SqsService unit tests. Add wire-level tests against
both protocols so the parse/sum/error path can't regress:

- SqsJsonProtocolTest: oversized JSON 1.0 batch returns 400 with
  __type containing BatchRequestTooLong.
- SqsIntegrationTest: oversized Query/form batch returns 400 with
  the BatchRequestTooLong code in the body.

Both confirm the top-level error is emitted before any per-entry
Successful results.
2026-05-19 21:49:38 -05:00
Yoshiyuki Ohta 4c156df10b fix(apigatewayv2): include corsConfiguration on Api management responses (#933)
`Api` does not currently model `corsConfiguration`, so neither
`ApiGatewayV2Service.createApi` / `updateApi` accept the field from the
inbound request nor do the two response builders
(`ApiGatewayController.toV2ApiNode` and `ApiGatewayV2JsonHandler.toApiNode`)
emit it. Terraform's `aws_apigatewayv2_api.cors_configuration` is therefore
always perceived as drift on every plan against a correctly-configured
emulator.

Introduces a nested `Api.Cors` record mirroring the `Authorizer.JwtConfiguration`
pattern (six AWS-documented sub-fields: allowOrigins, allowMethods, allowHeaders,
exposeHeaders, maxAge, allowCredentials). Adds request extraction via a shared
`toCors(Map)` helper (boolean uses the same defensive
`Boolean.parseBoolean(String.valueOf(...))` style as `Stage.autoDeploy`) and
emits the value from both REST and JSON 1.1 response paths.

Covered by a focused regression test (`ApiCorsConfigurationResponseTest`)
exercising create/get/list, PATCH update, omitted-when-null, the
containsKey-guard against future regression on PATCH-other-field, and a
JSON 1.1 round-trip via `X-Amz-Target` dispatch.

Same Terraform-drift class as #887 (`Route.authorizerId`) and #931
(`Integration.connectionType`, `Authorizer.enableSimpleResponses`).
2026-05-19 21:45:41 -05:00
Mike Mangino c6928128ff Fix crash when request Content-Type header is empty string (#940)
JAX-RS's ContainerRequestContext.getMediaType() parses the Content-Type
header value and throws IllegalArgumentException when the value is an
empty string (as opposed to null/absent). Some S3 clients (e.g.
Paperclip) send 'Content-Type: ""' for uploads without a detected type,
which caused every such request to fail with a 500 error.

Replace ctx.getMediaType() with ctx.getHeaderString("Content-Type") so
the raw value is used for protocol detection without triggering the
JAX-RS media-type parser.
2026-05-19 18:09:48 -05:00
Steve 60c4edda55 fix(lambda): log actionable hint when concurrency pool is exhausted (#935)
When PutFunctionConcurrency hits the regional reservation cap, the
LimitExceededException response is AWS-correct but the cause is
invisible in floci logs. Operators see only terraform retrying for
minutes (AWS SDK Go v2 plus the provider's MaxAttempts=25) while the
underlying reason (total reservations exceed regionLimit minus
unreservedMin) sits silently in the limiter.

Emit a WARN on every limit hit with the offending numbers and the
env var to raise the cap. Error code, body and status remain
identical to real AWS; this is observability only.
2026-05-19 18:08:12 -05:00
Federico Mariani 291a201efa fix: DynamoDB DeleteTable status and PartiQL scan, add SecretsManager RestoreSecret (#915)
* fix(dynamodb): return current table status on DeleteTable and support PartiQL scan pagination

DeleteTable now builds the response before removing the table, returning
the ACTIVE status that AWS documents. PartiQL SELECT without a WHERE
clause performs a full table scan with Limit/NextToken pagination support.

* feat(secretsmanager): implement RestoreSecret operation

Cancels a scheduled deletion by clearing the deletedDate on a
soft-deleted secret, matching the AWS RestoreSecret API contract.
2026-05-19 18:05:06 -05:00
Steve 040ef033b4 fix(lambda): make PortAllocator a checkout/release pool (#936)
* test(lambda): assert PortAllocator never reuses a port still in use

* fix(lambda): make PortAllocator a checkout/release pool

The previous modular counter (basePort + offset % range) wrapped
silently when allocations exceeded the configured range, handing the
same port to two RuntimeApiServers. The second listen() either failed
with EADDRINUSE or bound on top of a draining socket (in both cases
producing a runtime API the Lambda bootstrap could not reach).

PortAllocator now tracks in-use ports in a Set and throws
IllegalStateException on exhaustion. RuntimeApiServerFactory releases
the port on start failure; ContainerLauncher releases it after the
server is stopped.
2026-05-19 18:01:19 -05:00
Dixit R JainandDixit R Jain c0d6b71eb1 fix(apigatewayv2): raise Vert.x WebSocket frame size limit to 256 KB (#938)
Vert.x defaults maxWebSocketFrameSize to 64 KB. The Node.js ws library
sends messages as a single frame (no fragmentation), so payloads at or
above 128 KB are silently rejected at the transport level before reaching
the application-level size check in WebSocketHandler.

This caused the sdk-test-node compatibility tests for payload size limits
to timeout waiting for the 'Message too long' error response that never
arrived.

Raise both maxWebSocketFrameSize and maxWebSocketMessageSize to 256 KB
so that oversized frames reach the handler, which then enforces the AWS
128 KB limit and returns a proper error frame.

Co-authored-by: Dixit R Jain <dixitrjain@Mac-1086.lan>
2026-05-19 17:58:04 -05:00
Yoshiyuki Ohta 43332cef77 fix(apigatewayv2): include connectionType and enableSimpleResponses on Integration/Authorizer responses (#931)
Two HTTP API v2 fields are silently dropped on serialization, causing
Terraform to report drift on every plan even when the resources are
correctly configured:

- Integration.connectionType (INTERNET / VPC_LINK) — exposed by
  `aws_apigatewayv2_integration.connection_type`. Neither persisted from
  the inbound request by `ApiGatewayV2Service.createIntegration` /
  `updateIntegration` nor emitted by `toV2IntegrationNode` /
  `toIntegrationNode`.

- Authorizer.enableSimpleResponses (HTTP API Lambda authorizer payload
  v2.0) — exposed by `aws_apigatewayv2_authorizer.enable_simple_responses`.
  Same gap across `createAuthorizer` / `updateAuthorizer` and both
  response builders.

Adds the missing model fields, request extraction (Boolean uses the same
defensive `Boolean.parseBoolean(String.valueOf(...))` pattern as
`Stage.autoDeploy`), and emits the values from both the REST and JSON 1.1
response paths. Covered by a focused regression test exercising
create/get/list, the PATCH update path, omitted-when-null behaviour, and
JSON 1.1 round-trip via `X-Amz-Target` dispatch.

Same Terraform-drift class as #887 (`Route.authorizerId`).
2026-05-19 00:52:35 -05:00
ram-sarf e54a8e502c fix(sns): preserve per-entry MessageAttributes in PublishBatch (#891)
The Query-protocol handler for sns:PublishBatch was extracting Id,
Message, Subject, MessageGroupId and MessageDeduplicationId per entry
but skipped the per-entry MessageAttributes parsing loop that the
single-entry sns:Publish handler already had. As a result every batched
message reached subscribers (SQS, HTTP, Lambda) with an empty attribute
map, even though the AWS API contract treats MessageAttributes as a
first-class field on PublishBatchRequestEntry.

This caused consumers that rely on attributes for metadata (e.g.
CloudEvents binary content-mode: ce-type, ce-id, ce-source, …) to
discard the messages because the routing headers were missing.

Mirror the loop from handlePublish, parsing
PublishBatchRequestEntries.member.N.MessageAttributes.entry.M.* per
entry, and only attach the attributes map when non-empty so the
SnsService receives the same shape as the single-Publish path.

Adds:
 - Handler unit regression test covering attribute forwarding and
   per-entry isolation (entry without attrs must not inherit from
   sibling entries).
 - AWS SDK v2 compatibility test asserting end-to-end fan-out.

Existing single Publish behaviour is unchanged.
2026-05-19 00:49:01 -05:00