* feat(apigatewayv2): HTTP_PROXY integration with request parameter mapping
Adds full HTTP_PROXY support to API Gateway v2 dispatch, replacing the
previous Lambda-only assumption. Integrations with IntegrationType=HTTP_PROXY
now forward the inbound request to the configured IntegrationUri,
applying RequestParameters transformations.
Supported RequestParameters action × target combinations:
overwrite | append | remove × path | header.<name> | querystring.<name>
Supported source value expressions:
$context.authorizer.claims.<name> JWT claim from authorizer
$context.authorizer.<name> authorizer context value
$context.requestId UUID assigned per request
$context.identity.sourceIp client IP
$request.header.<name> case-insensitive header lookup
$request.querystring.<name> query parameter
$request.path.<name> captured path parameter
literal strings returned unchanged
The IntegrationUri may contain {proxy} or {paramName} placeholders,
substituted with captured path parameters from the matched route.
overwrite:path values may also embed $request.path.X / $context.X
substrings which are resolved in-place.
Implementation:
- New package services.apigatewayv2.proxy with RequestContext (DTO),
ContextValueResolver (source expression parser), PathTemplateResolver
(URI template substitution), ProxyRequestBuilder (mutable outgoing
request), RequestParameterMapper (applies RequestParameters), and
HttpProxyInvoker (orchestrator using java.net.http.HttpClient).
- ApiGatewayExecuteController.dispatchV2 now branches on
integration.getIntegrationType() and routes HTTP_PROXY requests to
HttpProxyInvoker, building a RequestContext from the controller state
including parsed JWT claims for $context.authorizer.claims.X.
- Integration v2 model gains a requestParameters Map field, persisted
by ApiGatewayV2Service create/update and serialized by both the
AWS JSON 1.1 handler and the REST controller.
Bug fixes (encountered during integration testing):
- routeKeyMatchesPath now treats `ANY` as the AWS wildcard method,
matching any inbound HTTP method (previously did literal string
comparison and rejected ANY routes for non-ANY requests).
- JWT authorizer audience check now also accepts `client_id` claim,
which Cognito access tokens use instead of `aud` (only ID tokens
carry `aud`). AWS API Gateway accepts either; floci now matches.
Tests:
- 11 ContextValueResolver tests covering each source expression form
- 7 PathTemplateResolver tests covering placeholder substitution
- 13 RequestParameterMapper tests covering each action × target
- 7 HttpProxyInvokerTest tests using JDK com.sun.net.httpserver as a
real backend, verifying method/path/headers/body forwarding,
RequestParameters application, hop-by-hop header stripping, and
502 error mapping for backend failures
- 1 round-trip integration test confirming RequestParameters survive
CreateIntegration → GetIntegration via the AWS JSON 1.1 handler
* perf(apigatewayv2): cache compiled route-template patterns per route key
extractV2PathParams compiled both the routing regex and the
parameter-name extraction regex on every inbound request. Route
keys are stable after creation, so this is wasted work on every
request — visible under load on frequently-hit paths.
Cache the routing regex in a ConcurrentHashMap<String, Pattern>
keyed by the raw template string, and hoist the constant
parameter-name pattern to a static final field.
Adds ApiGatewayExecuteControllerTest with 8 cases covering greedy,
non-greedy, mixed, and edge inputs, plus a hot-loop assertion that
repeated calls against the same route key return stable results
(the cache itself is an internal implementation detail and is not
asserted directly).
* fix(apigatewayv2): accept {name+} greedy placeholder in IntegrationUri
PathTemplateResolver's PLACEHOLDER regex matched {paramName} but not
{paramName+}, so configuring IntegrationUri = "http://backend/{proxy+}"
forwarded the literal string "{proxy+}" to the backend and the call
silently 404'd. The mismatch is surprising because {proxy+} is the
canonical AWS form already accepted by route keys (e.g.
"ANY /wallet/{proxy+}"), so most users mirroring the route shape in
the IntegrationUri hit this.
Extend the placeholder pattern with \+? so {name} and {name+} both
resolve to the same parameter keyed by name. Captured path params
are still stored under the bare name (no + suffix), matching the
existing extractV2PathParams behavior, so no other call sites change.
Picked this over documenting the limitation because the AWS
convention is widely expected and the fix is one character.
Adds 4 tests to PathTemplateResolverTest for {name+}: greedy proxy,
greedy named, mixed greedy + non-greedy, and missing-key fallback.
Adds PartiQL support for DynamoDB via a hand-rolled tokenizer and
recursive-descent parser that translates SELECT, INSERT, UPDATE, and
DELETE statements into existing DynamoDbService calls.
- DynamoDbPartiQLParser: tokenizer + AST (sealed interfaces) with
positional ? placeholder resolution from Parameters array
- DynamoDbPartiQLHandler: translates AST to GetItem/Query, PutItem,
UpdateItem, DeleteItem; always uses ExpressionAttributeNames to avoid
reserved-keyword conflicts; routes pk-only WHERE to Query (not GetItem)
when the table has a composite key
- DynamoDbJsonHandler: wires ExecuteStatement, ExecuteTransaction, and
BatchExecuteStatement; BatchExecuteStatement captures per-statement
errors without aborting the batch
- DynamoDbPartiQLTest: 13 compatibility tests covering INSERT, SELECT
(pk-only, range, projection, begins_with, ? placeholders), UPDATE
SET/REMOVE, DELETE, ExecuteTransaction, and BatchExecuteStatement
Parse the message body as JSON and evaluate the subscription filter
policy against the parsed tree, with nested-key descent and type-aware
rule matching (string/number/boolean/null values, array-value OR,
exists/prefix/anything-but/numeric). Previously the scope was accepted
but filtering was skipped, so all messages were delivered. Bodies that
are not valid JSON fail closed.
The body is parsed lazily once per publish, only when at least one
subscription uses MessageBody scope, to avoid O(N-subscriptions) parses.
The MessageAttributes scope evaluator is untouched.
Ensure the EventBridge region is correctly passed through downstream
processing so that SQS queue lookup uses the intended region instead of
defaulting to the primary region.
Adds support for two Cognito user-pool Lambda triggers that were not yet
wired in floci:
PostConfirmation:
Fires on ConfirmSignUp with triggerSource=PostConfirmation_ConfirmSignUp.
Errors are logged but do not block the confirm operation, matching
AWS Cognito fire-and-forget semantics for post-* triggers.
PreSignUp:
Fires on SignUp with triggerSource=PreSignUp_SignUp BEFORE the user is
persisted. Lambda errors block the signup (NotAuthorizedException). The
trigger response can auto-confirm the user and auto-verify email/phone
via the documented response fields:
response.autoConfirmUser
response.autoVerifyEmail
response.autoVerifyPhone
When PreSignUp returns autoConfirmUser=true, PostConfirmation is also
invoked, matching AWS Cognito's documented chain behavior:
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html
Tests cover happy path, error handling, response application, the
auto-confirm → post-confirmation chain, and not-configured no-op behavior
for both triggers.
Implements PUT /v2/email/account/suppression so callers can change the
account-level suppression list reasons (BOUNCE / COMPLAINT). Entries
are persisted per region in ses-account-suppression.json via a new
AccountSuppressionAttributes model.
GetAccount's response is extended with a SuppressionAttributes object
that carries the stored SuppressedReasons. The setting itself is
metadata-only — floci does not synthesise bounce/complaint events so
no auto-suppression is triggered; the configuration round-trips for
SDK users and tooling that introspects account-level settings.
Behaviour aligned with real-AWS verification:
- SuppressedReasons accepts BOUNCE / COMPLAINT, validated against the
AWS-canonical nested "Member must satisfy constraint:
[Member must satisfy enum value set: [BOUNCE, COMPLAINT]]" wording
(verbatim match against real AWS).
- SuppressedReasons may be omitted (treated as empty list) or supplied
as an empty array (clears the reasons) — both return 200.
- Non-textual array members (JSON null, numeric, etc.) are rejected
with BadRequestException.
- Fresh regions report the AWS-default [BOUNCE, COMPLAINT] via
GetAccount; an explicit PUT (including an empty list) overrides it.
- The optional ValidationAttributes body field is accepted but not
parsed (Tier S scope).
Tests:
- SesV2IntegrationTest gains nine cases covering store-and-list,
clear-with-empty-array, missing field defaulting to empty, invalid
Reason (with the AWS-canonical nested message asserted), non-array
SuppressedReasons, JSON null array member, numeric array member,
optional ValidationAttributes, and the default-on-fresh-region
assertion in the existing getAccount case.
- SesAccountSuppressionTest exercises the Java SDK round trip and an
explicit empty list through SesV2Client; @BeforeAll captures the
caller's existing SuppressedReasons and @AfterAll restores it with
failures surfaced so a real-AWS run cannot silently leave the
account with auto-suppression disabled.
Implements PR 3 of the 3-PR billing-API scope discussed in #791. Adds
two service surfaces that share one underlying export pipeline:
- `cur:*` — legacy Cost and Usage Reports management plane, target
prefix `AWSOrigamiServiceGatewayService.*`.
- `bcm-data-exports:*` — modern Billing and Cost Management Data
Exports management plane, target prefix
`AWSBillingAndCostManagementDataExports.*`.
Both run as JSON 1.1 services dispatched through the existing
`AwsJson11Controller`.
## Operations
CUR (7):
- `PutReportDefinition`, `ModifyReportDefinition`,
`DescribeReportDefinitions`, `DeleteReportDefinition`
- `TagResource` / `UntagResource` / `ListTagsForResource` (stubs)
BCM Data Exports (7):
- `CreateExport`, `GetExport`, `ListExports`, `UpdateExport`,
`DeleteExport`
- `ListExecutions`, `GetExecution`
AWS-shaped error codes throughout: `DuplicateReportNameException`,
`ReportLimitReachedException`, `ReportNotFoundException`,
`ResourceNotFoundException`, `ValidationException`,
`UnknownOperationException`. Storage keys are account-scoped
(`<accountId>::<region>::<reportName>` for CUR;
`<accountId>::<exportArn>` and `<accountId>::<exportArn>::<executionId>`
for BCM) so both services participate in Floci's per-account
isolation.
## Parquet emission
The same `ResourceUsageEnumerator` SPI introduced in #832 (Cost
Explorer) backs the Parquet artifact:
1. `EmissionEngine` collects `UsageLine` rows from every
`@ApplicationScoped` enumerator bean.
2. `FocusRowProjector` projects them into FOCUS 1.2 / CUR 2.0 column
shape, reusing #821's bundled Pricing snapshot for unit prices.
3. Rows are staged as newline-delimited JSON in
`s3://floci-cur-staging/...` via Floci's S3 service — escape-safe
for tags, descriptions, and resource identifiers.
4. The `floci-duck` sidecar runs
`COPY (SELECT * FROM read_json_auto('s3://...')) TO 's3://...'
(FORMAT PARQUET)` so Parquet writes happen inside DuckDB, not in
the Java process. This avoids pulling Apache Parquet / Hadoop /
Avro into Floci's classpath and keeps the native binary footprint
unchanged.
5. Staging objects are removed in a best-effort `finally` block; each
run carries a fresh `runId` (UUID) in both staging and
destination keys so concurrent emissions cannot clobber each other.
The emission engine is shared between CUR and BCM, but the management
planes are otherwise independent — they each own their own validation,
storage, and JSON dispatch.
## Run modes
`FLOCI_SERVICES_CUR_EMIT_MODE` and
`FLOCI_SERVICES_BCM_DATA_EXPORTS_EMIT_MODE`:
- `synchronous` (default): emit on every report/export mutation
- `daily`: emit once per 24h via a CUR-owned single-thread
`ScheduledExecutorService` — separate from the EventBridge
Scheduler dispatcher, so internal billing exports do not surface as
user-visible Scheduler resources.
- `off`: management plane only
Emission failures never roll back the management mutation. Failures
surface as `ReportStatus.LastStatus = ERROR` on CUR and
`Execution.ExecutionStatus.StatusCode = DELIVERY_FAILURE` on BCM.
## Tests
42 new tests across 5 classes:
- `CurIntegrationTest` (11) — full CRUD on report definitions,
duplicate / not-found / validation paths
- `BcmDataExportsIntegrationTest` (16) — full CRUD on exports +
executions, all validation paths
- `FocusRowProjectorTest` (9) — pure-unit projection: usage rows,
USD-denominated record types (Credit / Refund / Tax), missing
resource id, tags JSON, billing-period anchoring, region+account
flow-through, rate cache reuse
- `ParquetEmitterIntegrationTest` (3) — DuckDB readback,
staging cleanup, concurrent run isolation
- `CurEmissionIntegrationTest` (3) — end-to-end:
PutReportDefinition -> emit -> Parquet readable through DuckDB;
ReportStatus updates; CreateExport produces an execution record
Full Floci suite stays green (4194/4194, excluding the pre-existing
local-env flakes documented during PR #821 / #832 and the two
duck-required tests added here that need the `floci-duck` sidecar
and a fixed Floci HTTP port to verify cross-container S3 access).
## Documentation
- `docs/services/cur.md` — operations, validation rules, emission
pipeline, configuration, examples.
- `docs/services/bcm-data-exports.md` — operations, validation,
execution lifecycle, configuration, examples.
- README service table updated with rows for both, plus a note that
CUR / BCM Data Exports share one Parquet engine.
Refs: https://github.com/orgs/floci-io/discussions/791
Refs: #823
Builds on: #821, #832
* fix: support EventBusName as ARN in EventBridge operations
ROOT CAUSE ANALYSIS
===================
EventBridge API accepts EventBusName in two formats:
1. Plain name: "my-event-bus"
2. Full ARN: "arn:aws:events:region:account-id:event-bus/my-event-bus"
Floci was treating the EventBusName parameter as a literal bus name without
parsing ARN format. When an ARN was provided, the service would attempt to
look up the full ARN string (e.g., "arn:aws:events:us-east-1:000000000000:event-bus/my-bus")
as if it were a bus name, resulting in a ResourceNotFoundException because no bus
with that exact name existed.
The root issue manifested in operations like:
- PutRule: "EventBus not found: arn:aws:events:..."
- PutTargets: "EventBus not found: arn:aws:events:..."
- DeleteEventBus: "EventBus not found: arn:aws:events:..."
- DescribeRule: "Rule not found" (due to incorrect bus resolution)
SOLUTION
========
Added ARN parsing support:
1. Created extractBusNameFromArn() method that:
- Detects if input starts with "arn:aws:events:"
- Parses the ARN format: arn:aws:events:region:account-id:event-bus/bus-name
- Extracts and returns just the bus-name portion
- Returns input unchanged if not an ARN (backward compatible)
2. Updated resolvedBusName() to:
- Call extractBusNameFromArn() for all EventBusName parameters
- Maintain backward compatibility with plain names
- Treat null/blank as "default" bus (existing behavior)
3. Updated describeEventBus() and deleteEventBus() to handle ARNs in Name parameter
HOW TO TEST THE FIX
===================
Manual Testing (reproduce the issue from #842):
1. Create an event bus and capture its ARN:
aws events create-event-bus --name "test-bus"
# Returns: {"EventBusArn": "arn:aws:events:region:account:event-bus/test-bus"}
2. Create a rule using the ARN (not name):
aws events put-rule \
--name "test-rule" \
--event-bus-name "arn:aws:events:region:account:event-bus/test-bus" \
--event-pattern '{"source":["test"]}' \
--state ENABLED
# BEFORE FIX: ResourceNotFoundException
# AFTER FIX: Success, returns RuleArn
3. Use ARN in other operations:
aws events put-targets \
--rule "test-rule" \
--event-bus-name "arn:aws:events:region:account:event-bus/test-bus" \
--targets "Id=1,Arn=arn:aws:sqs:..."
aws events put-events \
--entries EventBusName=arn:aws:events:region:account:event-bus/test-bus,...
Automated Testing:
13 comprehensive integration tests added in EventBridgeArnIntegrationTest:
- putRule_withArnAsEventBusName: Create rule using ARN
- describeRule_withArnAsEventBusName: Retrieve rule using ARN
- putTargets_withArnAsEventBusName: Create targets using ARN
- listTargetsByRule_withArnAsEventBusName: List targets using ARN
- putEvents_withArnAsEventBusName: Send events to bus using ARN
- removeTargets_withArnAsEventBusName: Remove targets using ARN
- deleteRule_withArnAsEventBusName: Delete rule using ARN
- deleteEventBus_withArn: Delete bus using ARN
- describeEventBus_withArn: Describe bus using ARN
- enableRule_withArnAsEventBusName: Enable rule using ARN
- disableRule_withArnAsEventBusName: Disable rule using ARN
Test Results:
- All 13 new EventBridgeArnIntegrationTest tests PASS
- All 6 existing EventBridgeIntegrationTest tests PASS (backward compatibility verified)
- No regressions
BACKWARD COMPATIBILITY
======================
The fix is fully backward compatible:
- Plain bus names continue to work as before
- Null/blank EventBusName defaults to "default" bus as before
- ARN parsing only activates if input starts with "arn:aws:events:"
- All existing code and tests unaffected
Fixes#842
* fix(eventbridge): validate input for deleteEventBus and handle ARN format
* fix(eventbridge): enhance ARN handling and validation for event bus names
Implement the missing Aurora cluster parameter group APIs that the
Pulumi/Terraform AWS provider invokes via aws.rds.ClusterParameterGroup:
- CreateDBClusterParameterGroup
- DescribeDBClusterParameterGroups
- DeleteDBClusterParameterGroup
- ModifyDBClusterParameterGroup
- DescribeDBClusterParameters
Storage and handler logic mirrors the existing instance-level
parameter group implementation. Without these actions, any IaC stack
that defines an Aurora ClusterParameterGroup fails with
UnsupportedOperation and never reaches Aurora cluster creation.
Tests cover the new XML envelope shape, required-field validation,
service round-trip, duplicate rejection, and parameter modification.
* fix(pricing): bundle snapshot resources into native image
The bundled pricing-snapshots tree was missing from the GraalVM
native-image build, so the standard Floci container (which ships
the native binary) had no service codes available — the Pricing
snapshot loader silently returned null because the JSON files
weren't present at runtime.
Two changes:
1. Register `pricing-snapshots/**` under
`quarkus.native.resources.includes` so GraalVM bundles every
snapshot file into the image. Quarkus's static analysis cannot
detect resource paths constructed dynamically (the loader joins
`pricing-snapshots/` with a per-call relative path), so an
explicit include is required.
2. Read snapshot resources via the class's own `ClassLoader` rather
than the thread context loader. In a native image the thread
context loader can be the bootstrap loader, which sees no
application resources, while the class's loader sees everything
bundled into the image.
Reported by @cfranzen against #821 — Pricing service returned no
service codes when called via Testcontainers and `load()` produced
no log output, indicating the snapshot files were absent rather
than malformed.
Refs: https://github.com/floci-io/floci/pull/821#issuecomment-4445052790
* ci: retrigger after sdk-test-node flake on apigatewayv2 websocket disconnect
- Add recursive WHERE evaluator: AND, OR, NOT, LIKE, BETWEEN, IN, IS NULL,
>=, <=, <> — replaces single-regex implementation
- Add JSON Lines and JSON array input support
- Add cross-format output (CSV→JSON, JSON→CSV)
- Emit real BytesScanned / BytesReturned stats
- Route CSV (USE headers) and JSON through floci-duck when available;
fall back to Java evaluator in standalone mode
- Route Parquet S3 Select through floci-duck (existing)
- Move FlociDuckManager to services/floci/ and introduce FlociDuckClient
as a shared duck HTTP client for Athena and S3 Select
- Promote CsvParser to core/common and consolidate AthenaService.splitCsv()
- Add compatibility tests: S3SelectTest (19 tests via S3AsyncClient)
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Implements the `AWSInsightsIndexService.*` JSON 1.1 surface backed by
synthesizing cost and usage from Floci's existing resource state
multiplied by the bundled AWS Pricing snapshot (#821). Covers the nine
Cost Explorer operations the FinOps tooling ecosystem most commonly
exercises:
- `GetCostAndUsage` / `GetCostAndUsageWithResources` — full
`TimePeriod`, `Granularity` (DAILY / MONTHLY / HOURLY),
`Metrics` (UnblendedCost / BlendedCost / AmortizedCost /
NetUnblendedCost / NetAmortizedCost / UsageQuantity /
NormalizedUsageAmount), `GroupBy` (DIMENSION / TAG /
COST_CATEGORY), and the recursive `Filter` expression tree
(`And` / `Or` / `Not` / `Dimensions` / `Tags` / `CostCategories`).
- `GetDimensionValues` — returns the dimension values present in the
synthesized data; honors filters and search strings.
- `GetTags` — returns tag keys / values across enumerated resources.
- `GetReservationCoverage` / `GetReservationUtilization` — zero-totalled
stubs so callers that hit these endpoints during smoke tests don't
fail on `UnknownOperationException`.
- `GetSavingsPlansCoverage` / `GetSavingsPlansUtilization` — same
stubbed shape.
- `GetCostCategories` — empty list (cost-category management is
out-of-scope for this PR).
`GROUP_BY=RECORD_TYPE` distinguishes `Usage`, `Credit`, `Tax`,
`Refund`, `DiscountedUsage`, and the four `SavingsPlan*` variants.
`Tax` / `Refund` / `DiscountedUsage` / `SavingsPlan*` are reserved for
follow-up PRs; `Credit` is emitted when
`FLOCI_SERVICES_CE_CREDIT_USD_MONTHLY > 0`, capped at the synthesized
monthly usage so net cost never goes below zero.
## Architecture
A new SPI lives in `core/common/`:
public interface ResourceUsageEnumerator {
Stream<UsageLine> enumerate(Instant start, Instant end, String region);
}
CDI auto-discovers all `@ApplicationScoped` beans implementing it.
Cost Explorer iterates `Instance<ResourceUsageEnumerator>` per request,
so adding a new Floci service with cost data is a matter of dropping a
new enumerator bean next to the service — zero changes to
`CostExplorerService`. The same enumerators will feed the upcoming CUR
and BCM Data Exports Parquet writer (#823) without duplication.
The bundled enumerators are:
- `Ec2UsageEnumerator` — `BoxUsage:<instanceType>` * hours per running
instance, priced from the Pricing snapshot.
- `S3UsageEnumerator` — `TimedStorage-ByteHrs` * GB-month per bucket,
priced from the snapshot.
- `LambdaUsageEnumerator` — catalog-only line per function (zero
quantity until invocation tracking lands in a follow-up).
- `UnpricedServicesEnumerator` — emits zero-quantity catalog rows for
the remaining ~30 Floci services so they appear in
`GetDimensionValues SERVICE` without contributing billed cost.
Each priced enumerator additionally emits a zero-quantity catalog
line so the service shows up in `GetDimensionValues SERVICE` even
when no resources exist.
## Tests
`CostExplorerIntegrationTest` covers all nine operations via
RestAssured wire-format assertions: granularity bucketing,
filter-expression evaluation, group-by combinations, dimension and
tag listings, RI / SP stubs, validation errors. 20 tests, all green.
The full Floci test suite stays green with the additions
(4030 tests run, 0 failures, 0 errors, excluding the pre-existing
local-env flakes documented during PR #821).
Refs: https://github.com/orgs/floci-io/discussions/791
Refs: https://github.com/floci-io/floci/issues/822
* fix: support wildcard filtering in EC2 filters
Add wildcard pattern matching support to EC2 filter values to match AWS behavior.
Changes:
- Added wildcardToRegex() method to convert AWS wildcard patterns (* and ?) to Java regex
- Added matchesValue() method for pattern-based value matching
- Updated all filter matching logic to use wildcard patterns instead of exact string matching
- Supports wildcard filtering for all filter types: tag filters, tag-key, tag-value, and resource-specific filters
- Applies to all EC2 resources: VPCs, Subnets, Security Groups, Instances, Internet Gateways, Route Tables, Volumes
Added comprehensive integration tests:
- describeVpcsWithWildcardTagFilter: Tests asterisk wildcard patterns
- describeVpcsWithWildcardQuestionMark: Tests question mark wildcard patterns
All 69 EC2 integration tests pass. Backward compatible with exact string matching.
Fixes#830
* fix: reorganize imports in Ec2Service and Ec2IntegrationTest for clarity
* Potential fix for pull request finding
* fix(kms): non-deterministic Encrypt and EncryptionContext AAD validation
Two security-parity bugs in the KMS mock:
- Encrypt was deterministic: identical Plaintext + KeyId + EncryptionContext
produced byte-identical CiphertextBlob, leaking plaintext equality. Real
AWS derives a fresh AES-GCM key per call and is non-deterministic.
- Decrypt ignored EncryptionContext, so a ciphertext encrypted under
{tenant: "1"} decrypted successfully under {tenant: "999"} (or no context
at all). Real AWS binds EncryptionContext as AAD and fails with
InvalidCiphertextException on any mismatch.
Switched the mock blob format to embed (a) a fresh 8-byte random nonce per
call and (b) a SHA-256 fingerprint of the canonicalized, sorted
EncryptionContext. Decrypt now rejects on fingerprint mismatch. Omitted
context and {} are interchangeable, matching AWS.
Threaded EncryptionContext through Encrypt / Decrypt / GenerateDataKey /
GenerateDataKeyWithoutPlaintext / ReEncrypt handlers (ReEncrypt honors
both SourceEncryptionContext and DestinationEncryptionContext).
Closes#816Closes#817
* fix(kms): address review feedback on PR #825
- Accept legacy v1 blobs (kms:<keyId>:<base64>) in parseBlob, for
back-compat with persistent stores that hold pre-v2 ciphertext.
- Cache SecureRandom as a static final field instead of allocating
per Encrypt call.
- Replace the double-parseBlob pattern in handleDecrypt and
handleReEncrypt with a new single-pass KmsService.decryptAndResolveKey
method that returns plaintext + source key ARN in one record.
decrypt() and decryptToKeyArn() remain independent primitives and
do not delegate through the new composite.
- Add reEncryptHonorsSourceContext test asserting that wrong source
context fails the decrypt half and that the destination blob is
bound to destination context, not source.
- Add legacyV1BlobDecryptsForBackCompat test pinning the v1 fallback
parser behavior (accepts empty/null context, rejects non-empty
context, resolves source key ARN).
- Clean up inline fully-qualified class references in tests to use
imports (Arrays, LinkedHashMap).
* test(kms): pin v1↔v2 prefix collision behavior
Locks in the documented limitation that a pre-PR v1 ciphertext encrypted
under an override-id of literally "v2" produces "kms:v2:<base64>", which
is indistinguishable by prefix from a malformed v2 blob and is rejected
by parseBlob with InvalidCiphertextException.
Trade-off, not a bug:
- Failure is loud (InvalidCiphertextException), not silent corruption.
- Conditions to hit are extremely narrow (persistent mode + override-id
+ key literally named "v2" + crossing the pre-PR upgrade boundary).
- Avoiding it would require either silently-lenient fallback parsing or
a v2-prefix rename, both with their own trade-offs.
If a future refactor changes BLOB_PREFIX_V2 or adds fall-through parsing,
this test fails — prompting a deliberate decision rather than a silent
behavior change.
* fix(s3): strip charset parameter from XML response Content-Type
Real AWS S3 returns `Content-Type: application/xml` for every XML
response, but Quarkus REST automatically appends `;charset=UTF-8` to
text-like media types declared via `@Produces(APPLICATION_XML)`. Some
SDKs treat the extra parameter as a wire-format deviation.
A `ContainerRequestFilter` registers a Vert.x `addHeadersEndHandler`
that strips the charset just before HTTP headers hit the wire. The
hook is necessary because for `Response.ok(entity).build()` (the
common pattern in S3Controller), Quarkus REST's optimised write path
bypasses both `ContainerResponseFilter` and `WriterInterceptor` — they
see `getMediaType() == null`.
Test: S3ContentTypeCharsetFilterTest covers ListBuckets (200) and
NoSuchBucket (404).
* fix(s3): address review feedback on charset filter
- Trim class-level Javadoc to match sibling-filter convention.
- Add @ApplicationScoped so the filter is a single shared CDI bean,
matching the S3VirtualHostFilter pattern.
- Tighten the semicolon-index guard from semi <= 0 to semi < 0 (a
semicolon at index 0 is not a valid MediaType).
- Add jsonResponseContentTypeUntouched regression test against
/_floci/health to guard against future widening of the XML guard.
* fix(sqs): FIFO ReceiveMessage returns multiple messages per group per call
A FIFO ReceiveMessage call may legitimately return multiple messages
from the same MessageGroupId, in insertion order, up to
MaxNumberOfMessages. Floci was capping each call at one message per
group, which in practice limited tests to 1-2 messages regardless of
how many were queued and broke ordering tests for high-throughput
("fair") FIFO queues distributing across groups.
The cross-call group lock is unchanged: a group with an in-flight
message from a previous call is still blocked until that message is
deleted or its visibility expires. Only the within-call constraint
was wrong.
Existing tests that asserted the buggy "one per group per call"
contract have been updated to assert AWS-correct behavior.
Refs #768.
* test(sqs): address PR review feedback on FIFO multi-message tests
- Loosen cross-group ordering assertions in FIFO receive tests:
FIFO only guarantees ordering within a MessageGroupId, not across
groups, so assert group1 messages are in-order relative to each
other and group2 message is present without fixing its position.
- Rename fifoQueue_groupLockBlocksAcrossCallsButNotWithin to
fifoQueueGroupLockBlocksAcrossCallsButNotWithin to match the
test class's lowerCamelCase convention.
* test(sqs): add FIFO partial-drain unlock and compat coverage
Address review feedback on PR #785:
- SqsServiceTest: add fifoQueueGroupUnlocksAfterAllInFlightMessagesDeleted
covering the most common consumer pattern — drain less than a full
group in one call, delete the in-flight messages, then receive the
remainder. Verifies the group lock unlocks once all in-flight
messages from that group are deleted.
- sdk-test-java SqsTest: add fifoReceiveReturnsMultipleMessagesFromSameGroupInOneCall
as the first FIFO test in the compatibility suite. Sends 3 messages
to a single MessageGroupId and asserts a single ReceiveMessage with
MaxNumberOfMessages=10 returns all three — closes the gap noted in
the review and provides a regression guard against real AWS.
* fix(sqs): honor AttributeNames/MessageSystemAttributeNames on ReceiveMessage
ReceiveMessage previously emitted a fixed set of system attributes
(ApproximateReceiveCount, SentTimestamp, plus FIFO fields when
present) regardless of what the caller asked for. AWS instead returns
exactly the attributes the request selects:
- empty list -> no system attributes
- ["SenderId"] -> only SenderId
- ["All"] -> SenderId, SentTimestamp, ApproximateReceiveCount,
ApproximateFirstReceiveTimestamp (and FIFO MessageGroupId,
SequenceNumber, MessageDeduplicationId when applicable)
Both the legacy AttributeName.N / AttributeNames parameter and the
modern MessageSystemAttributeName.N / MessageSystemAttributeNames
parameter are honored.
SenderId derives from the account ID parsed from the queue URL
(falling back to the configured default account), matching the
multi-tenancy isolation introduced in #753. A new
firstReceiveTimestamp field on Message backs
ApproximateFirstReceiveTimestamp and is set on first claim.
Refs #768.
* test(sqs): cover legacy AttributeNames and Query-protocol filtering
Adds Query-protocol receive-with-filter coverage and a legacy
AttributeNames case to the JSON test, and clarifies the senderIdFor
Javadoc to reflect actual fallback order (queue URL → request context
→ default).
* feat: add ListTagsForResource, TagResource, UntagResource for Step Functions
Implements the SharedTagsController TagHandler pattern for SFN state
machines and activities. Adds tags field to StateMachine and Activity
models, tag CRUD methods to StepFunctionsService, and a new
StepFunctionsTagHandler that registers the 'states' service key.
Closes#766
* feat: cover JSON 1.0 SDK wire path for SFN tag operations
Add ListTagsForResource, TagResource, UntagResource cases to
StepFunctionsJsonHandler for AWS SDK (awsJson1.0) compatibility.
The REST /tags/{arn} path (SharedTagsController) already covers
Terraform; this commit covers the SDK path.
Expand integration test to verify both wire paths. Add SDK-based
compatibility test using SfnClient.
* chore: remove invented inline comment from tags integration test
* refactor: remove dead REST TagHandler and clean up integration tests
StepFunctionsTagHandler registered the 'states' service key with
SharedTagsController (REST /tags/{arn}), but SFN uses JSON 1.0 exclusively.
No real client calls GET/POST/DELETE /tags/arn:aws:states:... — the handler
was unreachable dead code.
Remove StepFunctionsTagHandler and strip the eight REST-path tests from
StepFunctionsTagsIntegrationTest. The remaining JSON 1.0 tests are now
self-contained (no longer depend on state set by the deleted REST tests).
* fix: correct SDK API usage in tag tests and persist creation-time tags
- Fix StepFunctionsTagsTest: tags() takes Tag... not Map, use tagsAsMap()
helper to convert List<Tag> before asserting with MapAssert methods
- Fix StepFunctionsService: pass tags through createStateMachine/createActivity
so tags set at creation time are persisted immediately
- Fix StepFunctionsJsonHandler: extract parseTagsArray() helper, add 400
validation when tags/tagKeys are not arrays, wire tags into create calls
- Expand StepFunctionsTagsIntegrationTest: cover creation-time tag persistence
for state machines and activities, and 400 on malformed tag input
* fix(sqs): implement AddPermission and RemovePermission
Both actions previously returned UnsupportedOperationException, which
also masked the queue-existence check. They now manage labelled
Statement entries in the queue's Policy attribute:
- AddPermission appends a statement (Sid=Label, Effect=Allow,
Principal=arn:aws:iam::<accountId>:root list, Action=SQS:<name> list,
Resource=<queue ARN>). Duplicate label returns InvalidParameterValue.
- RemovePermission drops the statement with the given Sid, removing the
Policy attribute entirely when no statements remain. Unknown label
returns InvalidParameterValue.
- Both surface QueueDoesNotExist when the queue is absent.
Refs #768.
* fix(sqs): address PR review comments on AddPermission
- Use AWS-spec parameter names (AWSAccountId, ActionName) in MissingParameter
messages instead of plural variants.
- Reject unparseable existing Policy attribute with InvalidAttributeValue
rather than silently overwriting it with a fresh document.
The Parallel state executor was using a hardcoded 60-second deadline
per branch future instead of reading the optional TimeoutSeconds field
from the state definition. When TimeoutSeconds is set, a single
deadline is computed before collecting results so the limit applies
across all branches rather than per-branch. When TimeoutSeconds is
absent the futures are awaited without a deadline, matching the AWS
behaviour of no timeout unless specified.
Implements the `AWSPriceListService.*` JSON 1.1 surface backed by a
bundled static snapshot on the classpath. Covers the five public
operations: `DescribeServices`, `GetAttributeValues`, `GetProducts`,
`ListPriceLists`, and `GetPriceListFileUrl`, with pagination (Base64
offset tokens) and the array-of-JSON-strings `PriceList` shape the
real AWS SDKs expect.
Rationale: Floci today cannot back FinOps tooling (cost detection,
budget guards, CUR parsers, etc.) because the billing APIs are
absent. Pricing is the stateless prerequisite for the Cost Explorer
and CUR services that follow — cost lines are synthesized as
`resource state x pricing snapshot`, so the snapshot data path is the
foundation.
Snapshot layout on the classpath (and mirrored on the filesystem
when `FLOCI_SERVICES_PRICING_SNAPSHOT_PATH` is set):
pricing-snapshots/services.json
pricing-snapshots/attribute-values/<ServiceCode>/<Attr>.json
pricing-snapshots/products/<ServiceCode>/<Region>.json
pricing-snapshots/price-lists/<ServiceCode>.json
The bundled snapshot is intentionally minimal — `AmazonEC2`,
`AmazonS3`, and `AWSLambda` in `us-east-1` — to exercise SDK parsing
and filter logic without bloating the image. Users needing broader
coverage point the override env var at a full snapshot generated
from the AWS Price List bulk API.
Wiring follows the existing JSON 1.1 stateless pattern (Textract,
Secrets Manager): descriptor in `ResolvedServiceCatalog`, handler
injected into `AwsJson11Controller`, service config on
`EmulatorConfig.ServicesConfig`. No new protocol, no changes to
existing services, no new runtime dependencies.
Tests: `PricingIntegrationTest` covers all five operations via
RestAssured JSON 1.1 wire-format assertions, including validation
errors, unknown-service errors, filter matching, and pagination
tokens (17 tests, all green).
Refs: https://github.com/orgs/floci-io/discussions/791
* fix(sqs): return MD5 of current request on FIFO dedup replay
On a duplicate SendMessage within the 5-minute FIFO dedup window
Floci returned the original message verbatim, including its cached
MD5OfMessageBody and MD5OfMessageAttributes. AWS SDK clients validate
those MD5s against the body and attributes they sent, so any time the
second send differed from the first (or even when the first send had
different attribute keys than the second's body alone) the SDK threw
"MD5 returned by SQS does not match the calculation on the original
request" and never delivered the message.
AWS itself returns the original MessageId and SequenceNumber on
dedup, but recomputes MD5s from the current request so the validation
round-trips. Floci now does the same. A new SDK-driven integration
test (sqs Java SDK at test scope) covers the dedup-replay case plus
several standard/FIFO/binary/custom-type-name MD5 round-trips.
Refs #768.
* test(sqs): tighten dedup-replay MD5 test and drop redundant @Inject
Address review feedback on #786:
- Assert the second SendMessage returns the same MessageId and
SequenceNumber as the first, so the test would catch a regression
that silently disabled dedup (in which case the MD5 round-trip
would also pass for the wrong reason).
- Drop the redundant @Inject on the @ConfigProperty-injected field,
matching the convention used in other Floci integration tests.
* test(sqs): move FIFO MD5 SDK tests to compatibility-tests/sdk-test-java
Address maintainer review on #786:
- Drop the software.amazon.awssdk:sqs test-scope dependency from the
main module's pom.xml.
- Move SqsSdkMd5IntegrationTest to the compatibility-tests/sdk-test-java
module as SqsMd5Test, where the existing AWS SDK v2 compatibility
suite already lives. The test now follows that module's conventions
(TestFixtures.sqsClient, AssertJ, lowerCamelCase method names, queue
cleanup) and exercises the same scenarios: standard / FIFO / fair MD5
parity, binary and custom-type-name attributes, and the dedup-replay
case that asserts the second SendMessage returns the original
MessageId and SequenceNumber.
Three related DynamoDB correctness fixes, all in the same DynamoDbService surface:
1. Cross-attribute SET reads pre-update values (#798)
"SET a = :v, b = a" now writes the *original* value of `a` into `b`, matching
real DynamoDB. Snapshot the item once at the start of applySetClause and
resolve every RHS reference against the snapshot; defer writes to `item`.
Previously, in-place mutation between comma-separated clauses caused later
clauses to read post-update values, silently corrupting audit/history fields.
2. ClientRequestToken idempotency for TransactWriteItems (#799)
Same token + same body → no-op success. Same token + different body →
IdempotentParameterMismatchException. Implemented via a per-region in-memory
cache with a 10-minute TTL (matching the AWS window) keyed by
"region::token" with a SHA-256 of the raw request body for comparison.
handleTransactWriteItems now extracts ClientRequestToken from the request
and forwards it plus the raw body through a new 4-arg
transactWriteItems(items, region, token, rawRequest) overload. The original
2-arg signature is preserved as a no-token convenience that delegates.
3. Parenthesized arithmetic in SET silently dropped (#802)
"SET c = (c - :v)" now applies identically to "SET c = c - :v". Added
stripOuterParens() and call it on each SET-action RHS before
findArithmeticOperator() — which still correctly only finds operators at
depth 0, but now sees an unwrapped expression to scan. Combined forms like
"SET c = (if_not_exists(c, :d) - :v), other = :s" now apply both clauses
instead of dropping the parenthesized one while applying the other.
Tests
- DynamoDbServiceTest gains 8 regression tests:
cross-attribute SET (plain + #name), parenthesized arithmetic (simple,
with if_not_exists, doubled parens, alongside a plain assignment), and
TransactWriteItems idempotency (no-op replay, parameter-mismatch error,
null-token bypass).
Refs: #798, #799, #802
* fix(cloudwatch-logs): implement PutSubscriptionFilter and DescribeSubscriptionFilters
Add subscription filter CRUD support (Put, Describe, Delete) to
CloudWatch Logs service. Previously these operations returned
UnsupportedOperation.
Closes#795
* fix(cloudwatch-logs): upsert subscription filters and default distribution to ByLogStream
- PutSubscriptionFilter now overwrites existing filters instead of
throwing LimitExceededException (matches real AWS upsert behaviour)
- Default distribution to "ByLogStream" when not provided
- Update tests for new behaviour
* fix(api-gateway): resolve sibling {proxy+} collision with longest-prefix matching
When multiple sibling {proxy+} resources exist (e.g. /auth/{proxy+}
and /products/{proxy+}), the first one registered always matched
every request regardless of the parent path. Now the proxy+ with
the longest parent prefix matching the request path is selected,
matching real AWS behaviour.
Closes#792
* test(api-gateway): add unit tests for proxy+ path matching
Add 7 focused tests for the matchResource method covering root proxy+,
sibling proxy+ routing, fallback behaviour, exact/template priority,
longest parent prefix, and no-match cases.
* fix(api-gateway): reject empty proxy+ segments and use cleaner path extraction
Adopt reviewer's suggestion: use substring before {proxy+} for parent
prefix extraction instead of lastIndexOf('/'), and require at least one
path segment after the prefix for non-root proxy+ resources. Root
/{proxy+} still matches / as a special case.
Adds tests for empty proxy segment edge case (/auth/ should not match
/auth/{proxy+}) and updates longestParentPrefixWins assertion for /api/
(should be null, not match).
* feat(eventbridge): add TestEventPattern action
Exposes the existing rule pattern matcher as a public API so callers can
test whether a sample event would match an event pattern without firing
any targets. Adapts the AWS event envelope (lowercase source / detail-type
/ detail / resources) to the internal entry shape and delegates to the
same matchesPattern() helper that powers PutEvents rule dispatch.
Returns {"Result": <bool>} on success, InvalidEventPatternException (400)
on malformed pattern or missing event.
* fix(eventbridge): reject empty EventPattern in TestEventPattern
AWS marks EventPattern as a required field for TestEventPattern. The
previous implementation accepted null/empty values and silently delegated
to matchesPattern(), which returns true for blank patterns — turning the
API into an unintended match-all. matchesPattern()'s blank-is-match-all
behavior is intentional for rule dispatch (rules with no EventPattern are
scheduled rules that fire on every match attempt), but exposing it here
violates the spec.
Now throws InvalidEventPatternException (400) when EventPattern is null
or blank. Verified end-to-end via boto3: the typed exception is raised
client-side. The integration test that asserted the wrong behavior is
flipped, and a new test covers the missing-field case.
* fix(eventbridge): honor account/region from event and reject non-object Events
* 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.