* feat(ses): add v2 suppression list endpoints
Implements the v2 SES suppression list management plane at
/v2/email/suppression/addresses:
- PUT /v2/email/suppression/addresses PutSuppressedDestination
- GET /v2/email/suppression/addresses/{EmailAddress} GetSuppressedDestination
- DELETE /v2/email/suppression/addresses/{EmailAddress} DeleteSuppressedDestination
- GET /v2/email/suppression/addresses ListSuppressedDestinations
(repeated Reason filter)
Entries are persisted per region in ses-suppression.json. A repeat Put for
the same EmailAddress updates the existing entry's Reason and LastUpdateTime.
List responses are sorted by LastUpdateTime then EmailAddress for stable
output across runs.
Behaviour aligned with real AWS responses:
- EmailAddress is silently trimmed of leading/trailing whitespace on Put
/ Get / Delete; whitespace-only is rejected with BadRequestException.
- Reason validation errors use the AWS-canonical "1 validation error
detected: Value at '<field>' failed to satisfy constraint: Member must
satisfy enum value set: [BOUNCE, COMPLAINT]" wording, with the nested
"Member must satisfy constraint: [...]" wrapping AWS emits for the
list-typed reasons filter.
- ListSuppressedDestinations accepts a repeated Reason query param (the
Java SDK's .reasons(...) varargs serialise this way) and applies
OR-semantics across the supplied values.
- GetSuppressedDestination and DeleteSuppressedDestination return
NotFoundException with "Email address <X> does not exist on your
suppression list." for unknown addresses — Delete is not idempotent
on AWS so floci matches.
SendEmail integration is intentionally out of scope: suppressed addresses
are still delivered locally so that existing send tests remain unaffected.
A follow-up PR can wire suppression checks into the send path along with
the PutAccount/ConfigurationSetSuppressionOptions configuration endpoints.
Tests:
- SesSuppressionV2IntegrationTest covers Put/Get/Delete lifecycle, List
sort order, single- and multi-Reason filter (with OR semantics), Put
updates, trim-on-Put, idempotent-Get-on-known, and validation errors.
- SesSuppressionListTest exercises the same surface through the Java SDK
v2 SesV2Client.
* fix(ses): reject null and non-object bodies on PutSuppressedDestination
Jackson's NullNode.asText("default") returns the literal string "null"
rather than the default, so a body like
{"EmailAddress": null, "Reason": "BOUNCE"}
silently stored an entry under the email address "null". Validate the
body is a JSON object via requireJsonObject and require both
EmailAddress and Reason to be present and textual via a new
readRequiredStringField helper.
SesSuppressionV2IntegrationTest gains three cases covering null
EmailAddress, null Reason, and a non-object root body.
* fix(sqs): omit Messages field from empty ReceiveMessage JSON response
Real AWS SQS omits the Messages field entirely when a ReceiveMessage
call returns no messages. With AWSConfigs.InitializeCollections=false
(the modern AWS SDK default) the SDK leaves the response collection as
null in that case, which several parity tests assert.
Floci was emitting "Messages": [] instead, so the SDK deserialized it
to a non-null empty list. This broke the StartMessageMoveTask family
of tests (which drain a freshly-created queue and assert null) and
~12 other tests in the .NET conformance sweep.
Refs #768.
* test(pipes): handle empty AWS CLI output in stopped-pipe assertion
After the SQS ReceiveMessage fix, an empty queue response is `{}` instead
of `{"Messages": []}`. The AWS CLI may emit an empty string in that case,
which makes `jq` fail and leaves msgs as empty, breaking the assertion.
Default $out to `{}` so the .Messages // [] fallback applies cleanly.
CloudFormationResourceProvisioner.provisionEventBridgeRule was reading
only Id/Arn/Input/InputPath from each target node and dropping
SqsParameters. EventBridge then delivered to FIFO SQS queues without a
MessageGroupId, which AWS rejects with:
The request must contain the parameter MessageGroupId.
The same target works when registered via the direct events PutTargets
API path, which already parses SqsParameters.MessageGroupId in
EventBridgeHandler. The CFN provisioner now mirrors that logic so
CloudFormation-managed FIFO targets behave identically to direct ones.
Closes#787
*.s3.localhost.floci.io, *.localhost.localstack.cloud, and
*.s3.localhost.localstack.cloud as virtual-hosted style regardless of
FLOCI_HOSTNAME — fixes 405 when SDK uses endpointOverride("http://localhost:4566")
without forcePathStyle (closes#801)
- EmbeddedDnsServer ships localhost.localstack.cloud and localhost.floci.io
as built-in suffixes so spawned containers resolve these domains to Floci's
IP without extra config
- Compatibility test S3VirtualHostStyleTest covers the full virtual-host path
end-to-end; TestFixtures.s3VirtualHostClient() prefers s3.localhost.floci.io,
falls back to s3.localhost.localstack.cloud, or uses FLOCI_S3_VHOST_ENDPOINT
in Docker
- run-docker-tests.sh and compatibility.yml inject --dns <floci-ip> and
FLOCI_S3_VHOST_ENDPOINT=http://floci:4566 into test containers
- S3 and migrate-from-localstack docs updated with virtual-hosted style details
* fix(sqs): honor MaximumMessageSize attribute on SendMessage
SendMessage previously enforced a hard-coded 256 KiB limit regardless
of the queue's MaximumMessageSize attribute, and the error text always
referenced 262144 bytes. Two behavioral problems:
- Queues created with MaximumMessageSize=1048576 still rejected
payloads over 256 KiB.
- The size check only inspected the message body (in chars), not body
bytes plus message attribute name/type/value bytes, the formula AWS
uses to compute total message size.
Both are now fixed: SendMessage reads the queue's MaximumMessageSize
attribute (clamped to AWS's 1024..1048576 range), computes total size
as UTF-8 body bytes + per-attribute (name + type + value) bytes, and
reports the queue's configured limit in the error message.
Refs #768.
* fix(sqs): clamp MaximumMessageSize to AWS range, rename test var
Address PR review feedback:
- parseMaxMessageSize now clamps out-of-range values to [1024, 1048576]
instead of silently falling back to the service default, matching the
PR description and avoiding surprising behavior for queues configured
with values just outside the AWS range.
- Rename misleading test variable halfMeg (300 KiB body) to body.
* fix(sns): enforce message size limits on Publish and PublishBatch
Real AWS SNS rejects oversized publish payloads:
- Publish: message + Subject + message attributes must not exceed
262144 bytes, otherwise InvalidParameterException with "Invalid
parameter: Message too long".
- PublishBatch: total bytes across all entries (message + Subject +
attributes per entry) must not exceed 262144, otherwise
BatchRequestTooLong.
Floci was silently accepting both, which broke the .NET conformance
tests asserting these limits. Size accounting matches AWS: UTF-8 bytes
for message and subject, plus per-attribute (name + type + value)
bytes, with the binary-value byte length used directly for Binary
attributes.
Refs #768.
* fix(sns): address review — apply size limit to SMS, fix batch attr cast
Move the Publish size check before the SMS short-circuit so oversized
SMS payloads are also rejected.
Normalize PublishBatch MessageAttributes in SnsJsonHandler to
MessageAttributeValue objects so SnsService.publishBatch's cast no
longer risks a ClassCastException.
CloudFormationResourceProvisioner had no case for AWS::ApiGateway::Authorizer
so the resource fell through to the default stub and never reached
ApiGatewayService. Stacks reported CREATE_COMPLETE while
`get-authorizers` returned an empty list.
provisionApiGatewayMethod additionally ignored AuthorizerId on the
template, so CUSTOM/COGNITO_USER_POOLS methods were registered with a
null authorizerId. The combined effect was a CloudFormation-managed
TOKEN authorizer flow that silently behaved as `AuthorizationType: NONE`.
This change adds a dedicated provisionApiGatewayAuthorizer that maps the
CFN PascalCase properties (Name, Type, AuthorizerUri, IdentitySource,
AuthorizerResultTtlInSeconds) onto the existing
ApiGatewayService.createAuthorizer request shape, and threads
AuthorizerId through provisionApiGatewayMethod so `!Ref MyAuthorizer`
resolves correctly.
Closes#788
* fix(ses): allow SendRawEmail without Source when MIME From is present
AWS SES SendRawEmail treats the Source parameter as optional — when
absent, the From: header in the raw MIME message acts as the source
identity. A previous validation pass added a null/blank check that
rejected such requests, breaking the AWS-spec fallback and surprising
applications migrating from real AWS or LocalStack.
The downstream SmtpRelay path already falls back to the MIME From
header when source is null, so removing the validation is sufficient.
* test(ses): use unique @Order value for new SendRawEmail regression test
The new sendRawEmail_withoutSource_acceptedWhenMimeFromPresent test was
inserted with @Order(20), which conflicted with an existing test later
in the same class. With OrderAnnotation, equal order values make
execution order ambiguous. Bump it past the current max (28) to keep
ordering deterministic.
* fix(tests): Enhance ElastiCache test reliability and optimize thread handling
Introduced configurable socket timeout and retry logic in integration tests to handle stalling under load. Updated relay threads in the proxy to use platform daemon threads, preventing scheduling issues and improving response delivery in high-load scenarios. These changes improve test robustness and backend-client communication stability.
* fix(tests): Add readiness probe for ElastiCache backend connections
Introduce a retry-based readiness probe to ensure that ElastiCache handles backend availability before connecting. This prevents issues with premature connections, such as blocking on PONG responses, and improves stability of the container lifecycle process.
Automatically detect the Docker network of the running Floci container and use it for spawned containers when no explicit Docker network is configured. This lets Lambda containers reach Floci’s Runtime API in Docker Compose setups without requiring users to manually set FLOCI_SERVICES_LAMBDA_DOCKER_NETWORK.
Also update Lambda/Docker docs to clarify the automatic network inheritance behavior.
Tested with:
./mvnw -q -Dtest=ContainerBuilderTest,CurrentContainerNetworkResolverTest,DockerHostResolverTest,ContainerLauncherTest test
- Parse MessageAction in CognitoJsonHandler#handleAdminCreateUser.
- Add a new 5-arg CognitoService#adminCreateUser overload that accepts MessageAction.
- Keep the existing 4-arg adminCreateUser signature and delegate it to the new overload to preserve existing callers.
- Handle RESEND for FORCE_CHANGE_PASSWORD users by refreshing lastModifiedDate and returning the existing user instead of throwing UsernameExistsException.
- Treat RESEND as a no-op invitation refresh because Floci does not have email transport.
- Keep RESEND behavior consistent with other notification-bearing APIs in the emulator.
- Throw UserNotFoundException when RESEND is requested for a missing user.
- Throw UnsupportedUserStateException when RESEND is requested for a CONFIRMED user.
- Align RESEND error behavior with real AWS Cognito.
- Add 3 unit tests in CognitoServiceTest.
- Add 1 wire-level test in CognitoIntegrationTest.
* feat: optional TLS/HTTPS support with self-signed certificate generation
- Add TlsConfigSource (MicroProfile ConfigSource SPI) that injects Quarkus
TLS properties before the HTTP server starts
- Auto-generate self-signed certificates with correct SANs including custom
hostnames from FLOCI_HOSTNAME and FLOCI_BASE_URL
- Persist certificate metadata for change detection across restarts
- Fix CertificateGenerator to encode IP addresses as iPAddress SANs (RFC 5280)
- Serve HTTP + HTTPS simultaneously (LocalStack parity)
- Support user-provided certificates via FLOCI_TLS_CERT_PATH/KEY_PATH
- Add TLS configuration documentation
- Add Node.js SDK compatibility test for HTTPS connectivity
- Add comprehensive unit and integration tests (79 test cases)
Closes#711
* feat(tls): add TLS proxy server and WebSocket-over-TLS tests
- Add TlsProxyServer: TCP proxy on port 4566 that detects TLS ClientHello
and routes to HTTPS (4511) or HTTP (4510) backend accordingly
- Add apigatewayv2-websocket-tls.test.ts: WSS compatibility tests covering
connect/disconnect, route selection, broadcast, authorization,
@connections API, binary frames, and payload size limits
- Update CI workflow to enable FLOCI_TLS_ENABLED=true for compat tests
- Update sdk-test-node Dockerfile with NODE_TLS_REJECT_UNAUTHORIZED=0
- Update tls.test.ts for HTTPS SDK client tests
- Update README with WebSocket-over-TLS test documentation
* fix(tls): address review comments — LocalStack parity and floci.io SANs
- Add USE_SSL and CUSTOM_SSL_CERT_PATH mappings to localstack-parity.sh
- Add localhost.floci.io and *.localhost.floci.io to default certificate SANs
- Update affected tests and documentation
---------
Co-authored-by: Dixit R Jain <dixitrjain@Mac-379.lan>
Co-authored-by: Dixit R Jain <dixitrjain@Mac.lan>
* feat(ses): extend tag endpoints to v2 EmailIdentity ARNs
Adds support for arn:aws:ses:<region>:<account>:identity/<email-or-domain>
ARNs across TagResource / UntagResource / ListTagsForResource. Behaviour
was verified against real AWS via aws sesv2 commands and matches the
EmailTemplate routing exactly:
- Tag region mismatch -> BadRequestException "Failed to tag resource"
- Untag region mismatch -> BadRequestException "Failed to untag resource"
- List region mismatch -> Tags resolved against the signing region
- Missing identity -> NotFoundException with "No EmailIdentity present
with name: <identity>"
Identity gains a tags field. CreateEmailIdentity accepts an optional
Tags array (validated via the existing validateTag()) and persists it
on the freshly verified Identity record. GetEmailIdentity surfaces
stored tags in the existing Tags response field.
Tests:
- SesTagsV2IntegrationTest gains identity lifecycle, identity-not-found,
and identity-specific region-mismatch / signing-region-lookup cases.
- SesIdentityAttributesV2IntegrationTest covers create-with-tags ->
Get/ListTagsForResource round-trip.
- SesTagResourceTest (Java SDK compat) exercises CreateEmailIdentity
with Tags and the Tag/Untag lifecycle on the identity ARN.
* test(ses): move identity tags round-trip test next to other createEmailIdentity cases
The Tags-on-create round-trip case fits better next to the existing
createEmailIdentity_* cases at the top of SesV2IntegrationTest than
it does in the attributes-focused SesIdentityAttributesV2IntegrationTest,
where DKIM / MAIL FROM / Feedback validation lives.
* chore(ses): drop dead identity.setTags call after CreateEmailIdentity
setIdentityTags already persists the tag list on the stored Identity,
and CreateEmailIdentity does not surface Tags in its response per the
AWS spec, so the in-memory mutation that followed had no observable
effect.
Adds support for arn:aws:ses:<region>:<account>:template/<name> ARNs
across TagResource / UntagResource / ListTagsForResource. Behaviour
was verified against real AWS via aws sesv2 commands and aligned where
it diverged.
- EmailTemplate gains a tags field. CreateEmailTemplate accepts an
optional Tags array; tag validation reuses validateTag().
- UpdateEmailTemplate intentionally preserves the existing tags so
that AWS-style "tags only mutated via Tag/UntagResource" semantics
hold.
- GetEmailTemplate response surfaces stored tags.
- Missing templates return NotFoundException with the AWS-canonical
"No Template present with name: <name>" message — AWS uses the bare
"Template" (not "EmailTemplate") for tag-endpoint lookups even
though the SDK type is EmailTemplate.
Resource-type-specific routing in the tag endpoints:
- TagResource on a template ARN strictly validates ARN/signing region
match (BadRequestException "Failed to tag resource" on mismatch),
matching the existing ConfigurationSet behaviour.
- UntagResource on a template ARN strictly validates ARN/signing
region match (BadRequestException "Failed to untag resource"),
whereas ConfigurationSet's lenient ARN-region lookup is preserved.
AWS treats the two resource types asymmetrically here.
- ListTagsForResource on a template ARN ignores the ARN region and
resolves the template against the signing region. ConfigurationSet
continues to route by ARN region.
Three small refactors that fall out naturally from adding a second
taggable resource:
- Tag is promoted from ConfigurationSet.Tag to a top-level
services/ses/model/Tag so EmailTemplate and the shared helpers no
longer reference a Configuration-scoped name. JSON serialization is
unchanged.
- A private mergeTags(existing, incoming) helper centralizes the
LinkedHashMap merge previously duplicated between
tagConfigurationSet and tagEmailTemplate.
- A private parseTagsArray(JsonNode) helper centralizes the JSON Tags
array parse previously duplicated across createConfigurationSet,
createEmailTemplate, and tagResource. The helper returns null for
missing/null nodes; the required caller (tagResource) treats null
as BadRequestException.
Tests:
- SesTagsV2IntegrationTest gains a template lifecycle case, a
template-not-found assertion, and the two template-specific
region-mismatch / signing-region-lookup cases.
- SesTemplateV2IntegrationTest covers create-with-tags, list-via-tags
endpoint, and update-preserves-tags round-trips.
- SesTagResourceTest (Java SDK compat) exercises CreateEmailTemplate
with Tags and the Tag/Untag lifecycle on the template ARN.
* fix(s3): parse copy-source versionId for CopyObject and part copy issue-748
* fix(s3): support versionId in CopyObject and UploadPartCopy sources - issue-748
* fix(s3): added new line at the end of class S3Controller - issue-748
Introduces multi-account isolation so that requests authenticated with
different AWS account IDs operate on completely separate resources,
with no cross-account data leakage.
- Add `RequestContext` (@RequestScoped CDI bean) to hold the current
account ID for the duration of each HTTP request
- Add `AccountResolver` to extract a 12-digit numeric account ID from
an AWS access key (AKID[4..15]), falling back to `defaultAccountId`
for non-numeric or legacy keys
- Add `AccountContextFilter` (JAX-RS ContainerRequestFilter) to populate
`RequestContext` on every incoming request
- Add `AccountAwareStorageBackend<V>` that transparently prefixes every
storage key with the current account ID; provides explicit-account
overloads (`getForAccount`, `putForAccount`, `scanAllAccounts`,
`scanAllAccountsAsMap`, `keysForAccount`) for use by background
workers that run outside request scope
- Update `StorageFactory` to always wrap created backends in
`AccountAwareStorageBackend`, making isolation the default for all
services with no per-service wiring required
- Update `RegionResolver.getAccountId()` to read from `RequestContext`,
falling back to `defaultAccountId` outside request scope
Store `accountId` on model objects at creation time and use explicit-
account overloads in background pollers and schedulers to prevent
account overloads in background pollers and schedulers to prevent
cross-account data access:
- **SQS** — queue keys scoped per account; DLQ routing and ESM polling
account-aware
- **SNS** — topic and subscription keys scoped per account
- **Lambda** — function store and ESM store account-aware; SQS, Kinesis,
and DynamoDB Streams pollers use stored `accountId` for background reads
- **EventBridge** — rules, archives, and replays scoped per account;
`RuleScheduler` uses rule's stored `accountId` for background dispatch
- **Kinesis** — stream keys and shard iterators scoped per account
- **Firehose** — delivery stream keys scoped per account
- **Pipes** — pipe keys scoped per account; poller uses stored `accountId`
- **Scheduler** — schedule and group keys scoped per account; dispatcher
uses stored `accountId` for background execution
- **EKS** — cluster keys scoped per account; `accountId` stored on
`Cluster` model (`@JsonIgnore`) for background use
- **MSK** — cluster keys scoped per account; readiness poller uses stored
`accountId`; `accountId` stored on `MskCluster` model (`@JsonIgnore`)
- **ECR** — repository keys scoped per account via `effectiveAccount()`
backed by `regionResolver`
- **OpenSearch** — domain keys scoped per account; readiness poller uses
stored `accountId`; `accountId` stored on `Domain` model (`@JsonIgnore`)
Replace all occurrences of the hardcoded literal `"000000000000"` and
`config.defaultAccountId()` calls in ARN construction with
`regionResolver.getAccountId()` so that ARNs reflect the actual requesting
account:
- KMS — key ARNs and default key policy principal
- ELBv2 — load balancer, target group, listener, and rule ARNs
- AutoScaling — group, launch configuration, and policy ARNs
- API Gateway — VTL execution context `accountId`
- ElastiCache — user ARNs in DescribeUsers response
- CodeDeploy — application, deployment group, instance, and target ARNs
- CodeBuild — CloudWatch log group ARN
- Transfer — server and user ARNs
- S3 — ACL owner ID in GetBucketAcl / GetObjectAcl responses
- CloudFormation — stack ARN, changeset ARN, and `AWS::AccountId`
pseudo-parameter; captures account at request time before handing
off to executor thread
- DynamoDB TTL sweeper — use `scanAllAccountsAsMap()` so the background
TTL sweep covers all accounts, not just the default
- Add `AccountIsolationIntegrationTest` verifying that SQS queues,
DynamoDB tables, S3 buckets, Kinesis streams, EventBridge rules,
Lambda functions, and Secrets Manager secrets created under one
account are invisible when queried under a different account
- Update unit tests for EKS, MSK, ECR, Pipes, Scheduler, and Glue
to pass `RegionResolver` through constructors (removes mock of
`config.defaultAccountId()`)
* fix(sqs): drop uppercase "Tags" read from CreateQueue JSON handler
AWS SQS JSON 1.0 schema uses lowercase "tags" for CreateQueue (uppercase
"Tags" is reserved for TagQueue). Real AWS treats unknown JSON fields as
ignored, so a hand-crafted client sending uppercase "Tags" would lose its
tags on AWS — but floci silently persisted them, diverging from AWS
behavior and masking client bugs at migration time.
Drop the defensive uppercase merge and add JSON-protocol integration
tests for both the canonical lowercase path (tags persist) and the
uppercase-as-unknown-field path (tags ignored).
* test(sqs): wrap CreateQueue-with-tags tests in try/finally for cleanup
Wrap CreateQueue + ListQueueTags + DeleteQueue test bodies so the
cleanup DeleteQueue runs in a finally block. A failed assertion
previously left an orphan queue, which could mask flake under re-runs
since CreateQueue is idempotent and won't re-apply tags to an existing
queue.
* feat(ses): add v2 TagResource / UntagResource / ListTagsForResource
Implements the v2 SES tag endpoints at /v2/email/tags. Initial scope
covers ConfigurationSet ARNs only
(arn:aws:ses:<region>:<account>:configuration-set/<name>); other
resource types return NotFoundException so follow-up PRs can extend
coverage to Identity, EmailTemplate, etc.
Behavior aligned with observed AWS responses:
- TagResource enforces ARN/signing region match strictly and rejects
mismatches with BadRequestException ("Failed to tag resource").
- UntagResource and ListTagsForResource route lookups to the ARN's
region instead, so a region mismatch surfaces as NotFoundException
with the resource-specific message (e.g. "No ConfigurationSet
present with name: <name>").
- TagResource merges by key (existing keys are replaced, others
retained); UntagResource silently skips keys not present.
- Empty Tags / TagKeys lists are rejected with BadRequestException to
match AWS validation.
- ARN parsing uses the shared AwsArnUtils helper; missing region or
account in the ARN is rejected as BadRequest, matching AWS.
Tests:
- New SesTagsV2IntegrationTest for endpoint-focused coverage (lifecycle,
region-mismatch asymmetry, validation errors).
- Cross-feature round-trip in SesConfigurationSetV2IntegrationTest
verifying that tags supplied to CreateConfigurationSet are reachable
via ListTagsForResource.
- New SesTagResourceTest in the Java SDK compatibility suite.
* refactor(ses): drop unused region parameter from list/untag tag service methods
listResourceTags and untagResource route lookups by the ARN's region, so
the request signing region they accepted was never read. Remove it and
stop resolving it in the controller. tagResource still takes region
because it strictly validates it against the ARN.
Tags passed to CreateQueue were silently dropped in both the Query
and JSON protocol handlers — neither extracted the Tags parameter
before calling sqsService.createQueue().
Changes:
- SqsQueryHandler: extract Tag.N.Key/Value params and pass to service
- SqsJsonHandler: read both 'Tags' and 'tags' fields (botocore sends
lowercase 'tags' for CreateQueue but uppercase 'Tags' for TagQueue)
- SqsService: add createQueue overload accepting tags; existing 2-arg
and 3-arg overloads delegate with null tags (no callers broken)
Closes#699
* feat: implement API Gateway v2 WebSocket data-plane support Implement full WebSocket data-plane for API Gateway v2, including: - Real WebSocket connection handling via Vert.x (ws://localhost:4566/ws/{apiId}/{stage}) - $connect/$disconnect/$default route lifecycle with Lambda integration - Custom route selection via routeSelectionExpression ($request.body.{field}) - @connections management API (POST/GET/DELETE) for server-to-client messaging - Lambda REQUEST authorizer support on $connect with identity source validation - Stage variable substitution in integration URIs - Multiple integration types: AWS_PROXY, AWS (VTL), HTTP_PROXY, HTTP (VTL), MOCK - Route response selection expression for bidirectional messaging - Binary frame support (isBase64Encoded: true) - 128 KB payload size limit enforcement (frames and @connections POST) - 10-minute idle timeout and 2-hour max connection duration - GoneException (410) for disconnected connections - $connect response headers propagation - Server-initiated close via @connections DELETE (skips $disconnect Lambda) Also includes: - Refactored LambdaArnUtils.extractFunctionNameFromUri as shared utility - Extended Authorizer/Integration/Stage models with new fields - Comprehensive Java integration tests (WebSocket lifecycle, routing, auth, etc.) - Node.js SDK compatibility tests using ws client and @aws-sdk/client-apigatewaymanagementapi - Updated documentation with full feature matrix
* test(apigatewayv2): support custom WebSocket endpoint via env var
- Update wsUrl helper to read FLOCI_ENDPOINT environment variable
- Convert http/https schemes to ws/wss for WebSocket compatibility
- Strip trailing slashes from endpoint URL for consistent formatting
- Enable testing against non-localhost endpoints for CI/CD flexibility
* fix: use AwsErrorResponse for @connections API error responses
Replace raw JSON string literals in handlePostToConnection,
handleGetConnectionInfo, and handleDeleteConnection with the
project-standard AwsErrorResponse record, which serialises to
the correct {"__type": ..., "message": ...} wire shape.
* fix: simplify extractFunctionNameFromUri using AwsArnUtils.parse
Adopt AwsArnUtils.parse() as the core of the implementation per
reviewer suggestion. One addition beyond the suggested snippet:
the API Gateway v1 integration URI format embeds a Lambda ARN
inside an apigateway ARN (resource starts with 'path/.../functions/'),
so we detect that pattern and recurse on the embedded ARN before
applying the standard function-name extraction. All 43
LambdaArnUtilsTest cases pass, including the API Gateway v1 style URI.
Replace the FLOCI_STORAGE_HOST_PERSISTENT_PATH footgun with automatic
named Docker volume management for RDS, OpenSearch, MSK, and ECR.
- Each resource gets a collision-free 6-char hex volumeId generated once
at creation and stored in the model. Container and volume names both use
it: floci-{service}-{volumeId}
- Volumes are labelled floci=true for easy pruning
- Memory mode always removes volumes on resource delete. Persistent modes
retain by default; set prune-volumes-on-delete: true to remove on delete
- Mode detection: FLOCI_STORAGE_HOST_PERSISTENT_PATH set to an absolute
path → host bind-mount mode (legacy); unset or non-absolute → named-
volume mode. Volume names in host-persistent-path are not supported
- Removed the container-storage config key — no longer needed
- Updated docker-compose.yml, and all docs
EventBridgeHandler manually extracted only Id, Arn, Input, InputPath,
and InputTransformer from the request JSON node — SqsParameters was
never read. This meant the field was never stored, ListTargetsByRule
never returned it, and EventBridgeInvoker called sendMessage without
MessageGroupId, causing FIFO queue delivery to fail with:
"The request must contain the parameter MessageGroupId."
Fix:
- Add SqsParameters model (messageGroupId field)
- Add sqsParameters field to Target model
- EventBridgeHandler.handlePutTargets: read SqsParameters node and
set it on the target before storing
- EventBridgeHandler.handleListTargetsByRule: write SqsParameters back
into the response node when present
- EventBridgeInvoker: pass messageGroupId to sendMessage() for SQS
targets, enabling FIFO queue delivery
Fixes#722
* feat(textract): add Textract service support and integration tests
* chore(textract): Implement PR suggestions
* fix(textract): remove completed async jobs to prevent memory growth
Implements the v1 Query action mirroring the existing v2
PUT /v2/email/account/sending endpoint. The Enabled parameter is
optional per AWS docs; missing or empty is treated as false.
Adds integration tests and a Java SDK compatibility test that
exercises both v1 UpdateAccountSendingEnabled and verifies state
is shared with the v2 GetAccount / PutAccountSendingAttributes path.
Implements Phase 1 of the Transfer Family JSON 1.1 handler covering
17 operations across server lifecycle, user management, SSH key
management, and tagging.
immediately closing a ServerSocket. Between that check and Docker
binding the port, a second concurrent RunInstances call saw the same
port as free — both instances raced to bind 2200 and the second one
failed with "port is already allocated".
Fix: PortAllocator now maintains an in-memory ConcurrentSkipListSet of
reserved ports. allocate() is synchronized and adds the chosen port to
the set before returning, so concurrent callers skip it even before
Docker has bound it. release() removes the entry when the container is
terminated, making the port available for future instances.
Ec2ContainerManager.terminate() now calls portAllocator.release() after
the Docker container is removed.
Add PortAllocatorTest with 5 cases including a concurrency test that
races 20 threads simultaneously to confirm uniqueness.
Fixes#721
* feat(route53): add Route53 management-plane emulation
Implements Route53 Phase 1 with 17 operations: hosted zones (Create,
Get, Delete, List, ListByName, Count), resource record sets
(ChangeResourceRecordSets, List), change tracking (GetChange), health
checks (Create, Get, Delete, List, Update), tagging
(ListTagsForResource, ChangeTagsForResource), and GetAccountLimit.
Auto-creates SOA and NS apex records on zone creation. Rejects deletion
of non-empty zones. All changes return INSYNC immediately. IDs are
returned with path prefixes (/hostedzone/Z…, /change/C…) to satisfy
the SDK Route53IdInterceptor. Nameservers are configurable via
floci.services.route53.default-nameserver[1-4].
Adds OpenTofu and Terraform compatibility tests covering zone creation,
A record, auto-created SOA/NS records, health check, and tag persistence.
* feat(feat): adding missing endpoints
* feat(route53): fix timeout when creating route dns from terraform
- Add 7 on-premises instance operations: RegisterOnPremisesInstance,
DeregisterOnPremisesInstance, GetOnPremisesInstance,
BatchGetOnPremisesInstances, ListOnPremisesInstances,
AddTagsToOnPremisesInstances, RemoveTagsFromOnPremisesInstances
- Add Server AppSpec YAML parsing (jackson-dataformat-yaml) extracting
os and hooks map (hookName → [{location, timeout, runas}])
- Resolve deployment targets from EC2 tag filters (via Ec2Service) and
on-premises instance tag filters; fall back to all registered
on-premises instances when no filters are configured
- Run lifecycle events in order (ApplicationStop → DownloadBundle →
ValidateService) on a virtual thread per deployment; DownloadBundle
and Install auto-succeed as infrastructure steps
- Execute AppSpec hook scripts via SSM Run Command when the instance is
registered in SSM; graceful degradation (treat as succeeded) when SSM
is not available for an instance
- Refactor deploymentTargets from two-level to three-level
(region→deploymentId→targetId→wrapper) to support multi-instance
Server deployments alongside existing Lambda/ECS single-target shape
- Add SsmCommandService helpers: isInstanceRegistered,
sendCommandToInstance, getCommandInvocationStatus
- Add OnPremisesInstance model with instanceName, instanceArn,
iamSessionArn, iamUserArn, registerTime, deregisterTime, tags,
registrationStatus
PutEmailIdentityDkimAttributes, CreateEmailIdentity, and DeleteEmailIdentity
now return the same error codes and messages as real AWS SES v2:
- PutEmailIdentityDkimAttributes on unknown identity -> 400 BadRequestException
("Domain X is not verified for DKIM signing.")
- PutEmailIdentityDkimAttributes on email-format identity whose parent
domain is registered -> 200 OK no-op (DKIM is a domain-level concept)
- CreateEmailIdentity on duplicate identity -> 400 AlreadyExistsException
- DeleteEmailIdentity on unknown identity -> 404 NotFoundException
V1 idempotent semantics (VerifyEmailIdentity / VerifyDomainIdentity /
DeleteIdentity) are preserved -- strict checks are added at the V2
controller level only.
Integration tests assert the exact AWS error messages (with trailing
period) and, for the email-with-registered-parent no-op case, verify
that the parent domain's DkimAttributes are unchanged before and after.
Following #714, the 2-arg PipesTargetInvoker.invokeSqs(arn, payload)
overload became dead code; only the region-aware 3-arg version is
called from invoke().
* feat(ses): add MAIL FROM domain and identity attribute operations
v1 (Query):
- SetIdentityMailFromDomain / GetIdentityMailFromDomainAttributes
- SetIdentityFeedbackForwardingEnabled
- SetIdentityHeadersInNotificationsEnabled
- GetIdentityNotificationAttributes now reflects the stored
feedbackForwardingEnabled and per-NotificationType
headersInNotificationsEnabled flags instead of hard-coded defaults
v2 (REST JSON):
- PUT /v2/email/identities/{id}/mail-from -> PutEmailIdentityMailFromAttributes
- GetEmailIdentity response surfaces real MailFromAttributes
(MailFromDomain / MailFromDomainStatus / BehaviorOnMxFailure) instead
of the previously hard-coded "" / NOT_STARTED / USE_DEFAULT_VALUE
- v1 PascalCase <-> v2 SCREAMING_SNAKE BehaviorOnMxFailure values are
translated at the controller boundary, with both ends rejecting
unknown enum values
Identity gains mailFromDomain, behaviorOnMxFailure (v1 form),
mailFromDomainStatus, and headersInNotificationsEnabled fields. The
service layer normalizes BehaviorOnMxFailure to the canonical SESv1
enum values (UseDefaultValue / RejectMessage), so storage is
consistent regardless of which protocol wrote it.
Validation (verified against live aws-cli output):
- ForwardingEnabled / Enabled / MailFromDomain are required on the
matching v1 setters; missing values produce InvalidParameterValue
rather than silently being treated as false / null
- An empty-string MailFromDomain remains the documented "clear" path,
distinct from a missing parameter; whitespace-only values are
rejected (only "" or null clear the setting)
- BehaviorOnMxFailure / NotificationType enum violations return the
AWS-canonical "1 validation error detected: Value at '<param>' failed
to satisfy constraint: Member must satisfy enum value set: [...]"
message: ValidationError on v1, BadRequestException on v2
- Unknown identity on v1 setters returns InvalidParameterValue with
the AWS-canonical "Identity <X> does not exist." form (HTTP 400)
- v2 PutEmailIdentityMailFromAttributes follows the same wire mapping:
unknown identity surfaces as BadRequestException (HTTP 400) via
remapV1Exception, with the same "Identity <X> does not exist."
message text. Schema / enum validation runs before the service call
so an unknown enum on a missing identity still surfaces as an enum
error rather than as the identity error
- v2 controller validates that MailFromDomain and BehaviorOnMxFailure
are JSON strings; non-textual values produce BadRequestException
- AwsQueryController.SES_ACTIONS picks up the new v1 actions for the
auth-less fallback dispatch
Tests: 21 v1 integration cases, 9 v2 integration cases, 4 SDK compat
cases (AWS Java SDK 2.42.24).
* fix(ses): align identity-setter missing-identity errors with live AWS
Previously setFeedbackForwardingEnabled threw NotFoundException/404 and
setHeadersInNotificationsEnabled threw a Floci-specific
"Identity <X> does not exist." message. Real AWS verified via
aws-cli returns InvalidParameterValue (HTTP 400) for both, but with
*different* operation-specific message texts:
- SetIdentityFeedbackForwardingEnabled (also v2 PUT /feedback after
remapV1Exception):
Identity X is invalid. Must be a verified email address or domain.
- SetIdentityHeadersInNotificationsEnabled:
Identity X is invalid. It must be a verified email address or domain.
- SetIdentityMailFromDomain (unchanged in this commit):
Identity <X> does not exist.
Update the service-level throws so each setter emits its operation's
exact wire shape. setFeedbackForwardingEnabled now also benefits the
pre-existing v2 PUT /feedback endpoint, which previously surfaced
NotFoundException/404 instead of BadRequestException/400.
Tests:
- v1 unknown-identity coverage for SetIdentityFeedbackForwardingEnabled
(new) and updated message-text assertion for HeadersInNotificationsEnabled
- v2 unknown-identity coverage for PUT /feedback
- SDK compat additions: getIdentityNotificationAttributes round-trip
exercising forwarding/header flags, and v2
PutEmailIdentityMailFromAttributes unknown-identity throwing
BadRequestException
* test(ses): update putFeedbackAttributes_notFound to expect BadRequest
The previous commit changed setFeedbackForwardingEnabled to throw
InvalidParameterValue (HTTP 400) for missing identities to match real
AWS, which propagates through remapV1Exception as BadRequestException
on the v2 PUT /feedback path. The pre-existing
SesV2IntegrationTest.putFeedbackAttributes_notFound still asserted the
old 404 / NotFoundException behavior, so it began failing in CI.
Update the test to expect 400 / BadRequestException, matching the
verified live AWS response.
When FLOCI_SERVICES_LAMBDA_AWS_CONFIG_PATH is set, bind-mount the host
path read-only into Lambda containers at /opt/aws-config and set
AWS_SHARED_CREDENTIALS_FILE and AWS_CONFIG_FILE env vars so the SDK
discovers credentials regardless of container HOME directory.
When unset, credentials are read from Floci's own environment with a
fallback to test/test/test. Blank values are treated as absent.
Closes#686
- Include <associationState> in AssociateRouteTable response so Terraform
v6 waiters can confirm association without timing out
- Add association.route-table-association-id, association.subnet-id,
association.gateway-id, and association.main filter support to
DescribeRouteTables
- Apply resource-id, resource-type, key, and value filters in DescribeTags
(previously all filters were ignored, returning every tag)
- Add RouteTableAssociation.gatewayId field for gateway-id filter support
- Add integration tests covering new filters and associationState assertion
- Add VPC networking resources to compat-terraform and compat-opentofu
suites (IGW, subnet, route table + association, security group)
When DOCKER_HOST is set without a scheme (e.g. "10.37.124.101:2375" in
Bitbucket Pipelines), docker-java's createDefaultConfigBuilder() calls
URI.create() on the raw value and throws IllegalArgumentException before
Floci's own withDockerHost() override can take effect. PR #665 normalized
the value from floci.docker.docker-host but left this crash path open.
- Add createDockerConfigBuilder() to catch the IAE and fall back to a
fresh Builder() so the normalized host can still be applied
- Add resolveEffectiveDockerHost() to use DOCKER_HOST env var (normalized)
as a fallback when floci.docker.docker-host is at its default unix socket,
so CI environments like Bitbucket Pipelines work without requiring a
separate FLOCI_DOCKER_DOCKER_HOST setting
- Add unit tests covering the Bitbucket scenario and edge cases
Fixes#663
AppConfigTagHandler inherited the default tagsBodyKey() = "tags"
(lowercase), so SharedTagsController parsed and serialised the tag
payload with the lowercase key. The AWS spec for AppConfig
TagResource and ListTagsForResource is capital "Tags" with a map
body, which is what AWS SDK clients send and expect — so SDK calls
to appConfig.tagResource(...) silently dropped tags and listing
came back empty.
Override tagsBodyKey() on AppConfigTagHandler to return "Tags".
The other axes (POST method, map body, lowercase tagKeys query)
already match the defaults so no further override is needed.
AppConfigIntegrationTest is updated to send capital "Tags" bodies
and assert capital "Tags" response keys, matching the AWS SDK
wire format. AppConfigTest (SDK compatibility) now exercises a
tagResource → listTagsForResource → untagResource round-trip via
AppConfigClient to lock in the wire format end-to-end.
* feat(sqs,dynamodb): add TRACE-level payload logging
Add TRACE log lines that include request/response payloads for the
common SQS and DynamoDB operations -- off by default, opt-in via
per-category log level. Helps diagnose TestContainers-based test
failures where DEBUG IDs alone don't reveal what was sent.
SQS: SendMessage / SendMessageBatch / ReceiveMessage / DeleteMessage /
DeleteMessageBatch log body and attributes.
DynamoDB: PutItem / GetItem / UpdateItem / DeleteItem log the item;
Query and Scan log the returned and scanned counts (bodies would be
too noisy).
Ship quarkus.log.min-level: TRACE so a single category override is
enough -- users don't also have to lower the root floor.
Closes#613
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* feat(scheduler): support TagResource, UntagResource, ListTagsForResource
Implements the three remaining EventBridge Scheduler tag APIs by
extending the shared /tags/{arn} dispatcher. Tags apply to schedule
groups only, matching AWS behavior; ARNs pointing at individual
schedules return ValidationException.
A survey of all ~75 AWS services that share the /tags/{arn} path
shows three independent shape axes — body key (`tags` lower vs
`Tags` capital), body structure (map vs list of {Key, Value}), and
untag query parameter name (`tagKeys` vs `TagKeys`) — and most
"capital Tags" services still use lowercase tagKeys query, so these
axes vary independently. TagHandler exposes them as five orthogonal
default methods rather than a coarse-grained enum:
- tagsBodyKey() defaults to "tags"
- tagsBodyIsList() defaults to false (map)
- tagKeysQueryName() defaults to "tagKeys"
- tagResourceUsesPut() defaults to false (POST)
- strictTagValidation() defaults to false (lenient parsing)
The defaults match the most common AWS shape (~73 services use
lowercase tags map + POST + lowercase tagKeys) so handlers like
EKS, Pipes, and AppConfig need no overrides. The dispatcher
returns 405 MethodNotAllowedException for the unused HTTP method
per handler. Strict input validation (missing Tags, wrong-shaped
Tags, missing TagKeys, entries missing Key or Value) is enforced
when strictTagValidation() is true, mirroring the AWS Scheduler
error shape; lenient handlers retain the looser parsing they had
before.
SchedulerTagHandler overrides tagsBodyKey, tagsBodyIsList,
tagKeysQueryName, and strictTagValidation. ApiGatewayTagHandler
overrides tagResourceUsesPut to true. AppConfigIntegrationTest
switches its tagApplication call from PUT to POST to match the
AWS spec for AppConfig (was relying on the dispatcher's prior
leniency on HTTP method).
* fix(tags): normalize empty body and reject non-object payloads
Address Copilot review on floci-io/floci#700.
- doTagResource normalizes null/blank request bodies to "{}" before
passing to ObjectMapper.readTree, mirroring SchedulerController's
parseTags. Previously an empty body raised a Jackson parse error
that strict handlers surfaced as a ValidationException with a raw
Java/Jackson message instead of the structured AWS error shape.
- parseTags adds a strict-only check that the JSON root is an
object. A request body like a JSON array or string used to fall
through to "Value null at 'Tags' ..." which misleads about the
actual problem; it now reports that the payload itself must be a
JSON object.
SchedulerIntegrationTest covers both paths with a 400 assertion.