* fix(core): use self-closing tags for empty XmlBuilder values
XmlBuilder.elem(name, "") produced <name></name> for empty string values, which caused some XML consumers (e.g. Terraform AWS provider) to crash with nil pointer dereference.
Now empty string values render as self-closing <name/> instead, which is semantically identical but avoids the parser crash. Null values remain skipped entirely.
* fix(ec2): conditionally omit stateReason instead of self-closing empty tags
The previous approach (self-closing tags for empty XmlBuilder values)
was wrong for two reasons:
1. AWS emits <tag></tag> (paired tags), not <tag/> — verified against
botocore rest-xml protocol fixtures (XmlEmptyStrings, XmlEmptyBlobs).
2. Go's encoding/xml tokenizes both forms identically (StartElement +
EndElement, no CharData), so the Terraform crash persisted either way.
Real fix: stop hardcoding <stateReason><code></code><message></message>
in Ec2QueryHandler for every instance. AWS omits stateReason entirely
when there is none (e.g. a running instance). Now it is only emitted
when stateReasonCode or stateReasonMessage is present.
XmlBuilder.elem() reverted to its original paired-tag behavior.
Added Instance.stateReasonCode/stateReasonMessage model fields.
Updated Ec2InstanceResponseShapeTest to assert null for running
instances (matching real AWS behavior).
Add the wafv2 (AWSWAF_20190729) JSON 1.1 service: Web ACLs, IP sets, regex
pattern sets, and rule groups, plus resource association, logging and permission
policies, and tagging. Uses LockToken optimistic concurrency and isolates the
CLOUDFRONT and REGIONAL scopes.
Covered by an in-repo RestAssured integration test and an AWS SDK v2
compatibility test.
Add the elasticmapreduce (ElasticMapReduce) JSON 1.1 service: cluster lifecycle
with a simulated state machine, job-flow steps, instance groups and fleets,
security configurations, and tags. Honours the ActionOnFailure legacy alias and
EMR's distinct error shapes.
Operations: RunJobFlow, DescribeCluster, ListClusters, TerminateJobFlows,
SetTerminationProtection, SetVisibleToAllUsers, SetKeepJobFlowAliveWhenNoSteps,
SetUnhealthyNodeReplacement, ModifyCluster, AddJobFlowSteps, DescribeStep,
ListSteps, CancelSteps, AddInstanceGroups, ListInstanceGroups, AddInstanceFleet,
ListInstanceFleets, ListInstances, CreateSecurityConfiguration,
DescribeSecurityConfiguration, DeleteSecurityConfiguration,
ListSecurityConfigurations, AddTags, RemoveTags.
EmrService holds a static SecureRandom, so it is registered under
quarkus.native.resources additional-build-args --initialize-at-run-time to keep
the GraalVM native build working.
Covered by an in-repo RestAssured integration test and an AWS SDK v2
compatibility test.
* feat(eks): support managed node groups (create/describe/list/delete)
aws eks create-nodegroup returned a 400 S3 error ("POST requires ?uploads
parameter") because EksController declared no route for
/clusters/{name}/node-groups, so the request fell through to S3's path-style
catch-all. Add the nodegroup REST routes (which outrank S3's templated path)
plus management-plane node group CRUD.
Node groups are emulated as catalog records that become ACTIVE immediately,
mirroring mock-mode cluster creation; no real worker nodes are provisioned
(k3s schedules pods on its built-in node in real mode).
Closes#1137
* refactor(eks): drop unused nextToken/maxResults params from listNodegroups
* feat(ses): publish events to Firehose, EventBridge, and CloudWatch destinations
Extend SES V2 configuration set event publishing so destinations beyond
SnsDestination actually deliver. Previously KinesisFirehoseDestination,
EventBridgeDestination, and CloudWatchDestination were stored but the
publisher logged a warning and skipped. PinpointDestination still skips.
- KinesisFirehoseDestination → single Firehose PutRecord per event;
S3-backed streams flush accumulated records as NDJSON once the default
count threshold is reached.
- EventBridgeDestination → PutEvents entry with Source=aws.ses,
DetailType="Email <EventTypeLabel>", payload as Detail. Region is
stamped on the entry (so matchesPattern + envelope agree on a
non-default region) and Resources is always present (empty when
sourceArn is null — matchesPattern's resources-filter branch casts
entry.get("Resources") unconditionally).
- CloudWatchDestination → MetricDatum to AWS/SES with Unit=Count.
Dimensions resolved from DimensionConfigurations against EmailTags
(MESSAGE_TAG / messageTag), email headers (EMAIL_HEADER / emailHeader),
or ses:configuration-set, falling back to DefaultDimensionValue.
Timestamp left to putMetricData's epoch-seconds default.
Tests
- SesEventPublishingV2IntegrationTest @Order 14-28: per-destination
setup → send → assert, plus a cross-region (eu-west-1) EventBridge
case pinning region propagation end-to-end.
- SesEventPublisherTest (Mockito ArgumentCaptor): the EB PutEvents
entry always carries Resources as an ArrayNode — integration tests
cannot pin this because EventBridgeService.buildEventEnvelope
defaults a missing key via getOrDefault.
Docs
- docs/services/ses.md: replace the SNS-only claim with the four
supported destination types.
* fix(ses): use AWS past-tense detail-type for EventBridge SES events
The EventBridge publisher was emitting "Email Send", "Email Delivery",
etc — derived from the SNS notification eventType vocabulary by
prepending "Email ". AWS uses a separate past-tense vocabulary on
EventBridge: "Email Sent", "Email Delivered", "Email Bounced", "Email
Complaint Received", "Email Rejected", "Email Opened", "Email Clicked",
"Email Rendering Failed", "Email Delivery Delayed", "Email Subscribed"
(see https://docs.aws.amazon.com/eventbridge/latest/ref/events-ref-ses.html).
A customer rule pattern keyed on the AWS value
({"source":["aws.ses"],"detail-type":["Email Delivered"]}) would
silently fail to match Floci events.
Changes:
- Add SesEventPayload.eventBridgeDetailType returning the past-tense
EventBridge vocabulary. Kept separate from eventTypeLabel (which
remains correct for SNS notifications and CloudWatch metric names).
- SesEventPublisher.publishEventBridge uses the new mapping.
Tests
- SesEventPayloadTest.eventBridgeDetailType_matchesAwsPastTenseVocabulary:
pins all 10 mappings against AWS docs.
- SesEventPublishingV2IntegrationTest @Order 29
(eventBridge_detailTypePattern_keyedOnAwsSentValue_matches):
structural pin — creates a rule with EventPattern
{"source":["aws.ses"],"detail-type":["Email Sent"]} and asserts the
SQS target receives the SEND envelope. A regression to "Email Send"
would cause the rule to silently drop the event, failing the test
without relying on any hard-coded assertion string.
- Existing tests updated to assert the AWS values:
SesEventPublishingV2IntegrationTest 4 assertions; sdk-test-java
SesEventPublishingTest 3 assertions.
* fix(ses): emit CloudWatch metric name "RenderingFailure" without space
AWS CloudWatch metric publishing for SES uses "RenderingFailure" (no
space) for the RENDERING_FAILURE event type — verified against real
AWS by configuring a CW event destination on a configuration set,
sending a templated email with a missing TemplateData key to trigger
the rendering failure path, and capturing the new metric name from
`aws cloudwatch list-metrics --namespace AWS/SES`.
Floci's publisher was previously sourcing the CW MetricName from
SesEventPayload.eventTypeLabel, which returns "Rendering Failure" (with
space). That spelling is correct for the SNS notification's eventType
field but wrong for CloudWatch — customer dashboards / alarms keyed on
the AWS-correct "RenderingFailure" never see Floci's metric.
Changes:
- Add SesEventPayload.cloudWatchMetricName returning the CW spelling.
Mirrors eventTypeLabel for every other case so the two stay aligned
in shape; only RENDERING_FAILURE differs.
- SesEventPublisher.publishCloudWatch uses the new mapping.
- SesEventPayloadTest.cloudWatchMetricName_matchesAwsCwSpelling pins
all 10 mappings; RENDERING_FAILURE expectation comes from the live
AWS capture rather than an AWS docs guess.
DELIVERY_DELAY remains as "DeliveryDelay" in this commit — it could
not be triggered conveniently from the SES sandbox (needs genuine SES
backoff), so leaving the existing value rather than guessing. Flagged
in code comments as needing future verification.
The other simple metric names (Send, Delivery, Bounce, Complaint) were
also verified against the same AWS capture and match Floci's existing
spelling byte-for-byte — no change needed for those.
* feat(cloudmap): add AWS Cloud Map (servicediscovery) management API
Implements the Route53AutoNaming_v20170314 JSON 1.1 service: namespace
management (HTTP/public-DNS/private-DNS), services, instance register/
deregister, async operation tracking, DiscoverInstances/DiscoverInstancesRevision
(honouring the data- host prefix), instance health status, and tags.
Dispatched via AwsJson11Controller; storage through StorageFactory; config in
EmulatorConfig + application.yml. Covered by an in-repo RestAssured integration
test and an AWS SDK v2 ServiceDiscoveryClient compatibility test.
* refactor(cloudmap): drop unused prefix variable in scanInstances
* build: add graphql-java dependency
* feat(appsync): add and extend data models for Phase 2
- Add AdditionalAuthenticationProvider, DomainName, ChannelNamespace, ApiAssociation models
- Add 14 fields to GraphqlApi (apiType, visibility, owner, etc.)
- Change additionalAuthenticationProviders from raw maps to typed list
- Add 6 fields to Resolver (resolverArn, cachingConfig, maxBatchSize, etc.)
- Add dataSourceArn to DataSource
- Rename FunctionConfiguration.arn to functionArn
* feat(appsync): add service and controller changes for Phase 2
* feat(appsync): add service and controller changes for Phase 2
* test(appsync): add Phase 2 integration tests
Add ~60 new tests for:
- Model completeness (new fields, ARNs, functionArn rename)
- Domain names CRUDL + associate/disassociate
- Channel namespaces CRUDL + update
- Merged API associations CRUDL
- Enhanced metrics
- Schema registry parsing with AWS scalars and extensions
- Directive registration (aws_api_key, aws_subscribe, deprecated, unknown)
- Edge cases (null auth providers, maxBatchSize 0, cleanup on delete)
* test(appsync): add AWS scalar unit tests
Test all 17 AWS scalars:
- All registered in AppSyncScalarRegistry
- AWSDateTime, AWSJSON, AWSEmail parse valid/invalid values
- AWSTimestamp and AWSShort range validation
- AWSURL and AWSPhone format validation
* test(appsync): add SDK compatibility tests for Phase 2
Validate that the AWS SDK Java v2 can read:
- dataSourceArn() on CreateDataSource response
- resolverArn() on CreateResolver response
- functionArn() on CreateFunction response
- BadRequestException on invalid schema creation
* docs(appsync): add Phase 2 operations, schema registry, and AWS scalars documentation
- Add Domain Names, Channel Namespaces, Merged API Associations, Enhanced Metrics
- Document AWS scalar types (17 scalars with validation rules)
- Document AppSync directives (8 directives with locations)
- Update Not Implemented section with future phase references
- Add CLI examples for domain names and channel namespaces
- Update cascade delete to include channel namespaces and domain associations
* docs: add AppSync to service tables, env vars, storage config, and SDK README
- README.md: add AppSync to category table, detailed notes, and architecture diagram
- docs/index.md: add AppSync to supported services table, fix count to 52
- docs/configuration/environment-variables.md: add FLOCI_SERVICES_APPSYNC_ENABLED
- docs/configuration/advanced/application-yml.md: add appsync config block
- docs/configuration/storage.md: add AppSync per-service storage override
- compatibility-tests/sdk-test-java/README.md: add AppSyncTest to services table
* fix(appsync): reuse ObjectMapper and fix AWSJSON serialize for non-string values
AWSJSON scalar was creating a new ObjectMapper on every parseValue() call. serialize() used toString() which produces invalid JSON for Map/JsonNode results.
* fix(appsync): strip string literals and comments before unknown directive validation
The regex @(\w+) incorrectly flagged @ mentions inside GraphQL string literals and comments as unknown directives.
* fix(appsync): prevent silent overwrite on creates, validate required fields and input values
- Add existence checks on createDataSource, createResolver, createType,
createChannelNamespace, createMergedApiAssociation (→ ConflictException 409)
- Validate authenticationType is required on createGraphqlApi
- Validate typeName is required on createResolver
- Validate dataSourceName exists on createResolver and createFunction
- Prevent associateApi from silently overwriting existing association
- Enforce API key limit (max 2 per API)
- Fix expires parsing to accept ISO 8601 strings, throw on invalid values
- Fix castInt overflow detection
- Fix updateApiKey expires validation (was silently swallowing errors)
- Change InvalidNextTokenException to BadRequestException (AWS standard)
- Fix maxResults=0 to return empty page
- Fix getIntrospectionSchema to throw 404 instead of returning null
- Fix tags with null values (was producing literal string "null")
* test(appsync): fix cascade delete test to create data source before function, align with new validation
* refactor(appsync): remove dead code and unused hasSchema()
- Delete AppSyncDirectiveRegistry.java (100 lines, never used)
- Delete DirectiveValidator.java (45 lines, never called)
- Remove hasSchema() from SchemaRegistry (never called)
* fix(appsync): scalar null-safety, type validation, and DNS resolution
- Add null checks to 5 serialize() methods (AWS_TIMESTAMP, AWS_LONG,
AWS_INTEGER, AWS_BOOLEAN, AWS_FLOAT) to prevent NPE
- Fix AWS_TIMESTAMP parseValue() ClassCastException on String input
- Replace InetAddress.getByName() with regex in AWS IPAddress to
prevent DNS resolution (SSRF concern)
- AWSBoolean now rejects non-boolean values (matches AppSync behavior)
* refactor(appsync): centralize directive definitions in AppSyncDirective enum
- Add AppSyncDirective enum as single source of truth for directive
names and SDL definitions
- Update AppSyncSchemaParser to use enum instead of duplicated strings
- Eliminates 3 sources of truth (validateNoUnknownDirectives Set,
injectDirectiveDefinitions SDL, and formerly AppSyncDirectiveRegistry)
* perf(appsync): cache scalarMap in AppSyncScalarRegistry
- Initialize scalarMap once in constructor as unmodifiableMap
- Avoids recreating HashMap on every call (was called twice per
schema parse)
* test(appsync): add tests for scalar fixes and behavior changes
- Add tests for null-safety in serialize() (5 scalars)
- Add test for AWSTimestamp parseValue with String input
- Add tests for AWSIPAddress regex validation (IPv4, IPv6, invalid)
- Add tests for AWSBoolean rejecting non-boolean values
- Add test for scalarMap caching
* test(sdk): add AWS scalars schema creation test
Verifies that schemas with AWS scalar types (AWSDateTime, AWSJSON,
AWSIPAddress, AWSBoolean) parse correctly via the SDK.
* fix(appsync): correct API paths to match AWS documentation
- Channel namespaces: /v1/ → /v2/, channelnamespaces → channelNamespaces
- Domain association: /apis → /apiassociation
- Remove ListApiAssociations (not a real AppSync operation)
- Remove GetEnhancedMetricsConfig (not a real AppSync operation)
- Rename Merged API Association to Source API Association with correct paths:
- AssociateSourceGraphqlApi: POST /v1/mergedApis/{id}/sourceApiAssociations
- GetSourceApiAssociation: GET /v1/mergedApis/{id}/sourceApiAssociations/{id}
- ListSourceApiAssociations: GET /v1/apis/{apiId}/sourceApiAssociations
- DisassociateSourceGraphqlApi: DELETE /v1/mergedApis/{id}/sourceApiAssociations/{id}
* feat(appsync): add SourceApiAssociation models
Add SourceApiAssociation, SourceApiAssociationConfig, and
SourceApiAssociationSummary models to support merged/source API
association operations per AWS AppSync API Reference.
* feat(appsync): add ChannelNamespace support models
Add AuthMode, HandlerConfig, HandlerConfigs, Integration, and
LambdaConfig models for ChannelNamespace handler configuration
per AWS AppSync API Reference.
* fix(appsync): fix ApiAssociation and ChannelNamespace models
ApiAssociation: remove source/merged API fields, keep only domain
association fields (apiId, associationStatus, deploymentDetail,
domainName) per AWS AppSync API Reference.
ChannelNamespace: add missing fields (channelNamespaceArn,
codeHandlers, created, handlerConfigs, lastModified,
publishAuthModes, subscribeAuthModes, tags) per AWS docs.
* feat(appsync): add missing service methods and fix response models
- associateApi now returns full ApiAssociation object
- createMergedApiAssociation returns SourceApiAssociation
- createSourceApiAssociation returns SourceApiAssociation
- getSourceApiAssociation validates mergedApiId
- listSourceApiAssociations returns SourceApiAssociationSummary
- Add updateSourceApiAssociation method
- Add deleteMergedApiAssociation method
- ChannelNamespace: populate arn, timestamps on create/update
* feat(appsync): fix response formats and add missing endpoints
- associateMergedGraphqlApi: response key apiAssociation → sourceApiAssociation
- disassociateSourceGraphqlApi: returns 200 + body (not 204)
- associateApi: returns full ApiAssociation from service
- Add POST /v1/mergedApis/{id}/sourceApiAssociations/{assocId} (UpdateSourceApiAssociation)
- Add DELETE /v1/sourceApis/{id}/mergedApiAssociations/{assocId} (DisassociateMergedGraphqlApi)
* test(appsync): fix and add integration tests for new endpoints
- Fix associateSourceGraphqlApi: use mergedApiId and sourceApiAssociationStatus
- Fix deleteSourceApiAssociation: expect 200 with body (not 204)
- Add updateDomainName test
- Add associateMergedGraphqlApi test
- Add updateSourceApiAssociation test
- Add disassociateMergedGraphqlApi test
* test(appsync): add SDK tests for missing operations
- Add updateDomainName test
- Add associateMergedGraphqlApi test
- Add updateSourceApiAssociation test
- Add disassociateMergedGraphqlApi test
- Fix test ordering for new domain tests
Add UpdateConfigurationSetSendingEnabled (SES v1 Query) and
PutConfigurationSetSendingOptions (SES v2 REST, PUT
/v2/email/configuration-sets/{name}/sending) to toggle email sending
on a single configuration set, complementing the existing
account-level UpdateAccountSendingEnabled / PutAccountSendingAttributes
toggle. The two APIs share state: both write
`ConfigurationSet.sendingEnabled` (Boolean, null/true = enabled).
Enforcement is centralized in SesService.validateConfigurationSet,
which is called by SendEmail, SendRawEmail, and SendBulkTemplatedEmail
(v1 and v2 paths). When the CS's sendingEnabled is false, the send is
rejected with SendingPausedException + "Sending is paused for
configuration set <name>" — matching the exact wire shape AWS returns
in production (verified via `aws sesv2 send-email` against an AWS
account with a disabled CS; both ErrorCode and Message reproduce as-is).
Read-back paths:
- v2 GetConfigurationSet returns SendingOptions: {SendingEnabled}
- v1 DescribeConfigurationSet with `reputationOptions` attribute
returns ReputationOptions/SendingEnabled (matches the AWS v1 wire
contract where SendingEnabled lives under ReputationOptions)
The v1 action is also added to AwsQueryController.SES_ACTIONS so that
action-name-based service routing recognizes it.
Tests
- SesConfigurationSetSendingOptionsV2IntegrationTest (13 cases): toggle
via both APIs, cross-API state sharing, SendEmail rejection with
SendingPausedException when disabled, read-back via Get/Describe,
bad-request validation, unknown CS returns 404 via v2.
- SesConfigurationSetSendingTest (SDK compat, 9 cases): AWS Java SDK
v2 marshalling of both APIs, with sendEmail rejection asserted as
`SendingPausedException` (the AWS SDK class corresponding to the
matched server-side error code).
Docs
- docs/services/ses.md: list both APIs in their respective tables.
Lambda/CodeBuild containers get Floci's IP as their only DNS, so all
public-name resolution flows through Floci's embedded UDP/53 forwarder.
The forwarder read responses into a hardcoded 512-byte buffer, silently
truncating larger EDNS0 responses (e.g. CDN-backed hosts), so public
lookups failed inside Lambda with ENOTFOUND/EBUSY.
- Enlarge the forwarder receive buffer to 4096 bytes (EDNS0).
- Forward across an ordered upstream list (resolv.conf + configurable
public fallbacks), returning the first valid response; warn when all
upstreams fail instead of dropping the response silently.
- Append configurable fallback resolvers (default 8.8.8.8, 8.8.4.4)
after Floci's IP on spawned containers' HostConfig.Dns, controllable
via floci.dns.container-fallback-* / FLOCI_DNS_CONTAINER_FALLBACK_*.
Closes#1110
When SendEmail / SendRawEmail is called with a recipient on the
account-level suppression list whose reason matches the effective
SuppressedReasons (the configuration set's SuppressionOptions
override if present, else the account-level reasons), Floci now:
1. Emits a synthetic Bounce or Complaint event (per the suppression
reason) through the configured event destinations alongside the
always-emitted Send event.
2. Drops the suppressed recipient from the SMTP relay step, while
still delivering the message to non-suppressed recipients on the
same send.
The SendEmail API response (200 + MessageId), the stored SentEmail
(used by the LocalStack-compatible /_aws/ses inspection endpoint),
and the published event's mail.destination all continue to reflect
the original recipient list — matching how AWS reports the message
at the API and event layers.
This PR bundles two related pieces:
- The per-configuration-set SuppressionOptions block (Put endpoint +
GetConfigurationSet response shape + getEffectiveSuppressedReasons
helper). Mirrors AWS V2 PutConfigurationSetSuppressionOptions:
empty list = explicit "no suppression filtering" for this CS,
unset block = fall back to account-level reasons. The validation
message for the new endpoint matches the AWS V2 natural-language
form ("Reason <X> is invalid, must be one of [BOUNCE, COMPLAINT].")
which is distinct from the V1-style nested message returned by the
three older suppression endpoints; both forms were verified
against live AWS on 2026-06-03.
- The send-time filter + synthetic-event partitioning, plumbed
through getEffectiveSuppressedReasons so the override takes effect
per-send. collectSuppressedReasons and resolveSuppressionReason
now both take configurationSetName, hitting the per-CS override
when present and falling back to the account-level reasons
otherwise.
Per-recipient: when only some recipients are suppressed, the
non-suppressed ones still reach smtpRelay.relay() / relayRaw().
The relay is skipped entirely only when every recipient is
suppressed.
- Recipient suppressed with reason BOUNCE (and BOUNCE in the
effective reasons) -> synthetic Bounce event; not relayed.
- Recipient suppressed with reason COMPLAINT (and COMPLAINT in the
effective reasons) -> synthetic Complaint event; not relayed.
- Reason mismatch or address not on the list -> Send only; relayed
normally.
- Simulator-address recipients and suppression-listed recipients
are unioned into the same event's recipient list, deduplicated.
Tests
- SesConfigurationSetSuppressionOptionsV2IntegrationTest (16 cases)
for the CRUD + helper.
- SesConfigurationSetTest SDK compat (6 V2 cases) using
SesV2Client.PutConfigurationSetSuppressionOptions and the typed
SuppressionListReason enum (+ the WithStrings escape hatch for
the server-side validation path).
- SesServiceSmtpTest grows four cases pinning the send-time
override behaviour: empty list on the CS disables filtering and
the relay receives the address; BOUNCE-only override leaves
COMPLAINT-suppressed addresses unfiltered; a CS without an
override falls back to account-level (parity with no-CS sends);
raw-send mirrors the JSON-send path.
- SesEventPayload / SesEventPublishingV2IntegrationTest / further
send-path coverage from the original suppression PR is preserved.
- All 452 SES tests pass.
* feat(appsync): add GraphQL API management service
Implement Phase 1 CRUDL management API for AWS AppSync.
Includes controller, service layer, and model classes for:
- GraphQL API lifecycle (create/get/update/delete/list)
- Schema creation and introspection
- Data Sources, Resolvers, Functions, Types, API Keys
- Tagging and Environment Variables
* chore(appsync): register service in config and catalog
Add AppSync service configuration (EmulatorConfig), service
descriptor (ResolvedServiceCatalog), YAML config entries, and
SDK test client fixture.
* test(appsync): add integration and SDK compatibility tests
AppSyncIntegrationTest: 44 tests covering CRUDL for all resources
GraphQL API, Schema, DataSources, Resolvers, Functions, Types,
API Keys, Tags, Environment Variables, and cascade delete.
AppSyncTest: AWS SDK v2 compatibility tests for management API
operations using the real AppSyncClient.
* feat(appsync): add typed enums for AWS API models
Add Java enums matching AWS AppSync API constants:
- AuthenticationType (API_KEY, AWS_IAM, COGNITO, OIDC, LAMBDA)
- DataSourceType (NONE, LAMBDA, DYNAMODB, HTTP, EVENTBRIDGE, ...)
- ResolverKind (UNIT, PIPELINE)
- ResolverRuntimeName (APPSYNC_JS, VTL)
- TypeFormat (SDL, JSON)
- SchemaCreationStatusType (PROCESSING, ACTIVE, FAILED, ...)
* refactor(appsync): align model types with AWS API reference
- DataSource.type: String → DataSourceType enum
- GraphqlApi.authenticationType: String → AuthenticationType enum
- GraphqlApi.logConfig: String → Map<String, Object> (structured)
- GraphqlApi.additionalAuthenticationProviders: Map → List<Map> (array)
- GraphqlApi.xrayEnabled: String → Boolean
- Resolver.kind: String → ResolverKind enum
- Resolver.ResolverRuntime.name: String → ResolverRuntimeName enum
- AppSyncType.format: String → TypeFormat enum
- SchemaCreationStatus.status: String → SchemaCreationStatusType enum
- ApiKey.expires: String → Long (epoch seconds)
* fix(appsync): correct ARN format, add enum validation, fix field types
- Function ARN: add missing region parameter
- Add parseEnum() helper for type-safe enum deserialization
- Reject invalid enum values with BadRequestException (400)
- Handle String/Boolean/Number coercion for xrayEnabled, expires
- Remove extra 'details' from StartSchemaCreation response
- Pass region to createFunction from controller
* fix(appsync): validate required fields on resource creation
Reject requests missing required fields with BadRequestException (400):
- CreateGraphqlApi: name required
- CreateDataSource: name and type required
- CreateResolver: fieldName and dataSourceName required
- CreateFunction: name required
- CreateType: name required
* test(appsync): add error handling, delete standalone, and cascade tests
Add 22 new integration tests (44 → 66 total):
- Error handling: missing name, blank name, invalid enum, missing required
fields for API/DataSources/Resolvers/Functions/Types (11 tests)
- Non-existent resource 404 tests for API, DataSource, Type (3 tests)
- Delete standalone: verify CRUD delete for Resolver, DataSource,
Function, Type, ApiKey with post-delete 404 confirmation (5 tests)
- Cascade verification: API delete cascades to DataSources and Functions;
Function delete does not affect resolvers (3 tests)
* feat(appsync): add pagination support for list endpoints
Add maxResults and nextToken query params to all list endpoints:
- ListGraphqlApis, ListDataSources, ListResolvers, ListResolversByFunction
- ListFunctions, ListTypes, ListApiKeys
Uses offset-based pagination with Base64-encoded tokens, following
the Pricing service pattern. Returns nextToken when more results
are available, null when all results have been returned.
* test(appsync): add pagination integration tests
Add 9 pagination tests (66 → 75 total):
- ListApis with maxResults returns subset and nextToken
- ListApis with nextToken returns second page
- ListApis without pagination returns all items
- ListDataSources, ListTypes, ListFunctions, ListApiKeys,
ListResolvers with maxResults
- Invalid nextToken returns 400
* fix(appsync): align SDK test with AWS SDK v2 model, extract type name from SDL
- Fix SDK test: use typeAsString() for enum comparison, remove apiKey()
field assertion, use functions() instead of functionConfigurationList()
- Extract type name from SDL definition when name is not provided
(matches real AWS CreateType behavior)
- Update integration test for type creation without explicit name
* fix(appsync): use extracted type name when definition-based extraction succeeds
The type name extracted from SDL definition was stored in a local
variable but not set on the AppSyncType object, causing createType
to return a type without name and making subsequent get/delete fail.
* refactor(appsync): inject RegionResolver instead of passing region as string
Follow the established pattern used by BackupService and PipesService.
Replace manual ARN string concatenation with regionResolver.buildArn()
and remove the hardcoded accountId field.
* fix(appsync): add functionId to Resolver model and fix listResolversByFunction filtering
The listResolversByFunction endpoint was incorrectly comparing
function.getName() with resolver.getDataSourceName(), which is not
the correct AWS AppSync relationship. Resolvers reference functions
via a functionId field, not by data source name matching.
- Add functionId field to Resolver model
- Handle functionId in createResolver and updateResolver
- Fix listResolversByFunction to filter by functionId
- Add listResolversByType method for per-type filtering
* feat(appsync): add global listResolvers endpoint
Add GET /v1/apis/{apiId}/resolvers to list all resolvers across all
types, matching the AWS AppSync API. The per-type endpoint
(GET /v1/apis/{apiId}/types/{typeName}/resolvers) is preserved.
- Add global listResolvers to controller
- Rename per-type endpoint to listResolversByType for clarity
- Add integration test for global listResolvers
- Update listResolversByFunction test to verify functionId-based filtering
* test(appsync): complete SDK compatibility tests for Phase 1
Add missing SDK v2 compatibility tests to match all Phase 1 operations:
- API Keys: updateApiKey, deleteApiKey
- Resolvers: updateResolver
- Types: createType, getType, listTypes, updateType
- Error handling: getNonExistentApi, getNonExistentDataSource,
getNonExistentType throw AppSyncException
Total SDK tests: 24 → 35. All operations in Phase 1 are now covered.
V2 SES already exposes ConfigurationSet event-destination CRUD via
REST JSON; this PR adds the matching V1 Query actions
(CreateConfigurationSetEventDestination /
UpdateConfigurationSetEventDestination /
DeleteConfigurationSetEventDestination) and extends
DescribeConfigurationSet so V1 callers can round-trip their stored
destinations. The service layer (`SesService.createConfigurationSetEventDestination`
etc.) already had the persistence and validation logic, so most of the
work is wire-format: parse V1 Query parameter shapes, render V1 XML
responses, and route the new action names.
- SesQueryHandler: three new Query actions plus
`readEventDestination(params, prefix)` and `writeEventDestination`
helpers. V1 wire field names use uppercase `ARN` / `NS` suffix
variants (`SNSDestination.TopicARN`,
`KinesisFirehoseDestination.IAMRoleARN` / `DeliveryStreamARN`,
`CloudWatchDestination.DimensionConfigurations.member.N`) which are
mapped onto the existing model classes; the `EventDestination.Enabled`
default mirrors the V2 primitive-boolean default of `false` when
omitted.
- V1 event-type wire forms are lowercase camelCase (`send`,
`complaint`, `renderingFailure`) while floci stores the V2 canonical
form (SCREAMING_SNAKE). New `V1_EVENT_TYPE_TO_INTERNAL` /
`INTERNAL_EVENT_TYPE_TO_V1` maps translate in both directions; unknown
values pass through so the existing validate-against-VALID_EVENT_TYPES
check still catches typos.
- `handleDescribeConfigurationSet`: when
`ConfigurationSetAttributeNames.member.N=eventDestinations` is
requested, render the stored event destinations as a V1 XML block.
Treat a null `ConfigurationSet.eventDestinations` list as empty when
rendering, so a corrupted persisted JSON with `"EventDestinations": null`
still produces an empty `<EventDestinations/>` container rather than
NPE-ing. Other ConfigurationSet attribute names (trackingOptions,
deliveryOptions, reputationOptions) remain unsupported and are
silently ignored — they will land with their respective Put*Options
PRs. The container is emitted even when the destination list is
empty so the response depends only on the requested attributes.
- `writeEventDestination`: skip destination blocks when required fields
are blank (defensive belt-and-suspenders for any legacy state) and
filter incomplete CloudWatch dimension members so partial members
don't leak into the XML.
- `SesService.validateEventDestination`: centralize required-field
validation for SNS / Firehose / CloudWatch dimensions, so both V1
and V2 reject partial destinations at create/update time. Members
with missing required fields now fail with a 400
`InvalidParameterValue` carrying the offending member index.
- `AwsQueryController.SES_ACTIONS`: include the three new actions in
the action-name → "email" service routing fallback so SigV4 requests
whose credential scope doesn't pin the service still reach SES.
Tests
- `SesConfigurationSetEventDestinationV1IntegrationTest`: 15 cases
covering create / describe-with-attribute / describe-without-attribute
/ describe-empty-attribute / duplicate / update / update-unknown /
delete / delete-unknown / partial Firehose / partial CloudWatch dim
/ blank SNS TopicARN / action-name routing fallback when the
Authorization header is absent.
- `SesServiceEventDestinationTest`: 8 new unit cases for the
centralized SNS / Firehose / CloudWatch dim validation, exercising
validateEventDestination directly.
- `compatibility-tests/sdk-test-java SesConfigurationSetEventDestinationTest`:
extended to drive both V1 (SesClient) and V2 (SesV2Client) against a
live Floci. Each protocol gets its own config set; nine new V1 tests
mirror the V2 lifecycle plus partial-Firehose rejection.
* feat(ses): publish SES events to SNS configuration set destinations
Add SES V2 event publishing to SnsDestination targets configured on a
ConfigurationSet. When SendEmail / SendRawEmail / SendTemplatedEmail /
SendBulkEmail is invoked with a ConfigurationSetName, Floci builds the
matching AWS-format event payload (a `mail` block plus an event-type-
specific block) and publishes it to each enabled SNS destination whose
MatchingEventTypes includes that event.
Events emitted
- SEND on every successful send.
- DELIVERY / BOUNCE / COMPLAINT / REJECT when a recipient matches the
corresponding AWS mailbox simulator address (success@ / bounce@ /
complaint@ / suppressionlist@simulator.amazonses.com).
- Per-event-type recipient lists (delivery.recipients,
bounce.bouncedRecipients, complaint.complainedRecipients) are
filtered to only the simulator address that triggered the event and
emitted in their canonical trimmed form; mail.destination carries
the full envelope.
Wire-level fidelity
- Event payload mirrors the AWS SES SNS notification format documented
at https://docs.aws.amazon.com/ses/latest/dg/event-publishing-retrieving-sns-examples.html.
- mail.tags includes user-supplied EmailTags / DefaultEmailTags /
ReplacementTags (V2) and Tags.member.N / DefaultTags.member.N /
Destinations.member.N.ReplacementTags (V1 Query). Each tag emits as
{Name: [Value]}.
- mail.headers[] appends user-supplied Content.Simple.Headers and
Content.Template.Headers after the auto-emitted From/To/Cc/Subject;
null/blank Names are rejected with "The header name must be
specified." (BadRequestException 400).
- V2 SendBulkEmail BulkEmailEntries accept ReplacementTags (merged by
Name onto DefaultEmailTags) and ReplacementHeaders (merged
case-insensitively per RFC 5322 onto DefaultContent.Template.Headers).
- mail.sendingAccountId resolves from EmulatorConfig.defaultAccountId().
- ConfigurationSet existence is validated up-front on sendEmail /
sendRawEmail / sendBulkTemplatedEmail — an unknown name fails fast
with ConfigurationSetDoesNotExist (V2 controller remaps to
NotFoundException 404, V1 returns 400) before any message is stored
or relayed.
Validation errors aligned with live AWS
- EmailTags blank Name: BadRequestException 400 "The tag name must be
specified." (V2) / InvalidParameterValue 400 same message (V1).
- ConfigurationSetName not found: same error code, status, and message
as AWS.
Raw email handling
- For V2 SendEmail with Raw content (and V1 SendRawEmail), when the
caller did not provide Destinations, Floci falls back to To/Cc/Bcc
parsed from the raw MIME via SmtpRelay.parseRawHeaders (extracted
from the existing relay logic). MIME parsing is only invoked when
needed (no explicit Destinations or event publishing active).
Internal shape
- New records: model/MessageTag (Name, Value, for EmailTags) and
model/MessageHeader (Name, Value, for Content.Headers) — kept
distinct from the resource-tag Tag (Key, Value).
- SesEventPublisher dispatches to SnsService; non-SNS destination
types log a warning and are skipped (Firehose / EventBridge /
CloudWatch / Pinpoint), and missing SnsDestination.TopicArn likewise
warns instead of silently dropping. Failures preserve the throwable
in the warn log.
Tests
- SesEventPayloadTest covers mail/commonHeaders/headers/tags shape,
per-event filtering, and the headers/tags propagation paths.
- SesServiceMergeEmailTagsTest / SesServiceMergeHeadersTest pin Bulk
Default vs per-entry merge semantics (tags by Name case-sensitive,
headers by Name case-insensitive per RFC 5322).
- SesEventPublishingV2IntegrationTest exercises Send / Delivery /
Bounce / SendOnly / mixed-recipient / disabled-destination /
V1-MIME-fallback / EmailTags / V1-Tags / Simple.Headers paths
end-to-end through SES -> SNS -> SQS.
- compatibility-tests/sdk-test-java/SesEventPublishingTest validates
SendEmail with EmailTags/Headers and SendBulkEmail with per-entry
ReplacementHeaders override using AWS Java SDK V2 clients.
* fix(ses): address Copilot review on upstream PR #1106
- SesService.validateConfigurationSet: clarify the Javadoc — the
helper always throws with httpStatus = 400, and the V2 controller's
remapV1Exception is what turns ConfigurationSetDoesNotExist into
NotFoundException 404. The previous "(404 in V2, 400 in V1)" hint
read as if the helper itself picked the status, which is misleading.
- SesController.parseEmailTagsArray: reject non-object entries with
"<fieldName> entries must be JSON objects.", mirroring the existing
parseHeadersArray check. Previously a string/number element would
hit the blank-Name path and report a less specific message.
- SesService.mergeHeaders / mergeEmailTags: also skip entries whose
name is the empty string, not just null. Both parsers reject blank
names at the boundary, but defending the merge helpers keeps them
safe for direct callers (e.g., future tests) and matches the intent
of the boundary validation.
ModifySubnetAttribute only handled MapPublicIpOnLaunch; the other three
AWS-defined attributes — AssignIpv6AddressOnCreation, EnableDns64, and
MapCustomerOwnedIpOnLaunch — were silently ignored. Added them to the
handler loop and to the Subnet model, and included them in the
DescribeSubnets XML response alongside an empty ipv6CidrBlockAssociationSet
element that AWS always returns.
DescribeInstances was missing attachTime on blockDeviceMapping/ebs, causing
SDK response shape validation to fail for callers that inspect that field.
* feat(ses): add SES V2 configuration set event destination operations
Implement CreateConfigurationSetEventDestination, GetConfigurationSetEventDestinations,
UpdateConfigurationSetEventDestination, and DeleteConfigurationSetEventDestination on
the SES V2 REST JSON API. Event destinations are stored on the configuration set;
validation and error messages mirror the real AWS SESv2 responses. Includes REST
integration, service unit, and AWS SDK compatibility tests.
* fix(ses): return defensive copy from event destination getter and preserve order on update
GetConfigurationSetEventDestinations now returns an unmodifiable copy so callers
cannot mutate stored state outside the service. UpdateConfigurationSetEventDestination
replaces the destination in place (by index) instead of remove+add, keeping the
list order stable when a configuration set has multiple event destinations.
* fix(ecs): reconcile task lifecycle when container exits naturally
ECS tasks stayed in RUNNING indefinitely after the underlying Docker
container exited, causing `aws ecs wait tasks-stopped` to hang forever
and exitCode to remain null. Fixes#889.
The 5-second reconciler now also polls running task handles. When all
containers for a task have exited, it atomically claims the handle
(guarding against a concurrent explicit stopTask), closes log streams,
removes the Docker containers, and transitions the task to STOPPED with
stoppedAt and per-container exitCode populated.
Explicit stopTask is also fixed: it now calls stopTaskAndCollectExitCodes
to capture exit codes before the container record is removed, and
propagates them to the ECS container model. An idempotency guard prevents
double-decrement of runningTasksCount when stopTask is called on a task
already transitioned by the reconciler.
cleanupStoppedTask is used by the reconciler to avoid re-inspecting
containers whose exit codes were already collected in the inspection pass.
* fix(ecs): capture exit code after stop, not before
stopTaskAndCollectExitCodes inspected containers before stopping them,
so getExitCodeIfStopped returned null for still-running containers and
the exit code was lost once stopAndRemove deleted the record.
Split the operation into two phases: stop all containers first, then
inspect exit codes, then remove. Containers already exited skip the
stop call silently.
* fix(apigw-v2): populate pathParameters in Lambda proxy event for HTTP API integrations
buildV2ProxyEvent never called extractV2PathParams, so pathParameters was always
absent from the Lambda event payload. Frameworks that rely on it for routing (e.g.
the tRPC AWS Lambda adapter via ANY /{proxy+}) failed with path routing errors.
Wire extractV2PathParams into buildV2ProxyEvent after the queryStringParameters
block, mirroring how dispatchHttpProxyV2 already uses it. Also relax the method
visibility to package-private to allow the new unit tests to call it directly.
* test(ec2): scope Ec2NetworkInterfacePaginationTest to its own VPC
DescribeNetworkInterfaces was called without a filter, so the tests
counted ENIs created by other concurrently-running sdk-test-java tests
(e.g. sdk-test-instance from Ec2DescribeNetworkInterfacesTest), causing
intermittent failures when test ordering meant those ENIs existed at
assertion time.
Adds a vpc-id filter helper scoped to the VPC created in @BeforeAll so
each test only sees the 6 ENIs it owns.
* test(kms): add grant compatibility contracts
* feat(kms): support empty ListGrants
* feat(kms): add CreateGrant and persisted ListGrants round trip
* test(kms): add create grant round trip coverage
* feat(kms): add grant pagination, filters, and ListRetirableGrants
* test(kms): add pagination, filter, and retirable grant coverage
* feat(kms): add RevokeGrant administrative delete
* test(kms): add RevokeGrant unit and integration coverage
* feat(kms): add RetireGrant with token and key+grant retirement paths
* docs(kms): document grant lifecycle operations and enforcement scope
* fix(kms): include RetiringPrincipal in ListGrants response
The handleListGrants handler was omitting RetiringPrincipal from the
JSON response even when the grant had one set. This meant grants
created with a retiring principal were invisible through ListGrants,
while ListRetirableGrants worked fine. Adds the missing serialization
to match the GrantListEntry AWS spec.
* feat(ec2): add partial DescribeNetworkInterfaces (phases 1-3)
Wire DescribeNetworkInterfaces into the EC2 query handler with ENI
data derived from running instances. Covers:
- Empty response skeleton
- Basic ENI mapping (networkInterfaceId, subnetId, vpcId, groupSet, attachment)
- Full field coverage (privateIpAddressesSet, EIP association, tagSet,
availabilityZone, interfaceType, attachTime, deleteOnTermination)
Remaining: filter support, pagination, error handling, Terraform compat
validation (phases 4-6 for #1031).
* feat(ec2): add filter support for DescribeNetworkInterfaces (phase 4)
Support these filter keys: network-interface-id, subnet-id, vpc-id,
group-id, status, private-ip-address, description, owner-id, mac-address,
private-dns-name, tag:<key>, tag-key. Filters use AND semantics.
No-match filters return HTTP 200 with empty networkInterfaceSet.
* feat(ec2): add pagination and error handling for DescribeNetworkInterfaces (phases 5-6)
- Add NetworkInterfaceListResult record for paginated responses
- Implement offset-based MaxResults/NextToken pagination
- Add Base64 token encode/decode for pagination cursor
- Validate MaxResults range (5-1000) and MaxResults+NetworkInterfaceId conflict
- Conditionally emit nextToken in XML response (only when truncated)
- Add InvalidNetworkInterfaceID.NotFound for non-existent IDs
- Add InvalidNetworkInterfaceID.Malformed for IDs not starting with 'eni-'
- Track found IDs via HashSet for accurate NotFound detection
* test(ec2): add DescribeNetworkInterfaces pagination, error, and multipage tests
- 5 pagination validation tests (MaxResults range, param conflict, invalid token)
- 1 pagination success test (MaxResults > available ENIs, no nextToken emitted)
- 2 error handling tests (InvalidNetworkInterfaceID.NotFound and .Malformed)
- 1 self-contained multipage pagination test (launches 5 extra instances,
verifies MaxResults=5 truncation, NextToken continuation, final page cleanup)
- All 87 Ec2IntegrationTest tests pass
* test(ec2): add SDK and Terraform compat tests for DescribeNetworkInterfaces
- Add Ec2NetworkInterfacePaginationTest with 4 scenarios:
all 6 ENIs without pagination, MaxResults=5 truncation,
NextToken continuation (no overlap between pages),
and token re-use stability
- Add eni_destroy.bats Terraform compat test verifying destroy succeeds
on VPC+subnet+SG now that DescribeNetworkInterfaces is implemented
- Add minimal Terraform config (VPC 10.0.0.0/16, subnet, SG) for ENI test
* fix(ec2): align DescribeNetworkInterfaces MaxResults errors
* test(terraform): make ENI destroy compat test runnable
* fix(s3): persist inline x-amz-tagging header on PutObject
PutObject silently dropped tags supplied via the x-amz-tagging request header — the controller did not read the header and tags never reached the object store. Adds a header parameter, parses the URL-encoded key=value tag set (with 10-tag and 8 KB limits), and persists via the existing putObjectTagging path so behavior matches real AWS S3.
* test(s3): add negative-path tests for inline x-amz-tagging header
Cover malformed pair, empty key, duplicate key, >10 tags, and oversized header. Note in S3Controller that the InvalidArgument and BadRequest codes match observed real-AWS behavior even though they are not in the S3 Smithy service model
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
## Summary
S3 `PutObject` was echoing the object's `Content-Encoding` (and `Content-Disposition`, `Cache-Control`, `x-amz-meta-*`) onto a response whose body is always empty. Real AWS S3 omits all of those on PutObject — they only belong on `GetObject` / `HeadObject`, where there is a body to describe.
The user-visible symptom is `Content-Encoding: gzip` on the PutObject response: AWS SDK for Java v2's `Crc32Validation.decompressing` interceptor sees the header, wraps the empty stream in `GZIPInputStream`, and throws `EOFException` from `readHeader`. The object is stored correctly server-side, but every gzip-encoded `PutObject` through the SDK fails before returning — breaking, for example, Spring Cloud AWS's `S3Template.upload(...)` with gzip metadata.
`S3Controller#putObject` now calls a new `appendPutObjectResponseHeaders(resp, obj)` that emits only the headers AWS returns on PutObject (storage-class when set, SSE when set, checksum, object-lock) and intentionally omits `Content-Encoding`, `Content-Disposition`, `Cache-Control`, `Content-Language`, `Expires`, and `x-amz-meta-*`. The shared `appendObjectHeaders` is untouched, so GET / HEAD / CopyObject — including the persistence behavior added by #56 / PR #57 — are unchanged.
Closes#944
## Type of change
- [x] Bug fix (`fix:`)
- [ ] New feature (`feat:`)
- [ ] Breaking change (`feat!:` or `fix!:`)
- [ ] Docs / chore
## AWS Compatibility
Incorrect behavior: PutObject's response copied the object's persisted `Content-Encoding` / `Content-Disposition` / `Cache-Control` / `x-amz-meta-*` headers onto a response that has no body.
Verified against real AWS S3 (`us-west-2`) with AWS CLI v2 (`aws-cli/2.27.58`) and AWS SDK for Java v2 (`software.amazon.awssdk:s3:2.42.24`). Eight `PutObject` scenarios were captured from botocore's `--debug` response-headers log, each with one additional request header. For every header this PR changes Floci's behavior on, the post-PR response matches AWS:
| Request includes | Pre-PR Floci response | Real AWS response | Post-PR Floci response |
|---|---|---|---|
| `Content-Encoding: gzip` | emits `Content-Encoding: gzip` | omits | omits |
| `Cache-Control: max-age=…` | emits `Cache-Control` | omits | omits |
| `Content-Disposition: …` | emits `Content-Disposition` | omits | omits |
| `x-amz-meta-owner: team-a` | emits `x-amz-meta-owner` | omits | omits |
(`Content-Language` and `Expires` exist in the old `appendObjectHeaders` only via `ResponseHeaderOverrides`, and the PutObject path passes `ResponseHeaderOverrides.NONE`, so they were never actually emitted on PutObject responses.)
Regression coverage, both layers:
- New SDK-level test `compatibility-tests/sdk-test-java/S3Test#putObjectWithContentEncodingDoesNotBreakSdkDecompression` uses a real `S3Client` to `PutObject` a gzip-encoded object. Before the fix it throws the exact `EOFException → Crc32Validation.decompressing → DefaultS3Client.putObject` stack from #944; with the fix it passes.
- Existing in-process `S3IntegrationTest#putObjectWithContentEncoding` gains assertions that `Content-Encoding`, `Content-Disposition`, and `Cache-Control` are absent from the PutObject response. Adjacent tests (`getObjectReturnsContentEncoding`, `headObjectReturnsContentEncoding`, `copyObjectPreservesContentEncoding`, and the Cache-Control / Content-Disposition equivalents) continue to assert those headers ARE returned on GET / HEAD / CopyObject — protecting the behavior fixed by #56 / PR #57.
## Checklist
- [x] `./mvnw test` passes locally (4700 tests, 0 failures, 0 errors, 8 skipped)
- [x] New or updated integration test added (RestAssured regression assertions in `S3IntegrationTest#putObjectWithContentEncoding`, plus new SDK test `S3Test#putObjectWithContentEncodingDoesNotBreakSdkDecompression` in `compatibility-tests/sdk-test-java`)
- [x] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/)
The Query-protocol handler for sns:PublishBatch was extracting Id,
Message, Subject, MessageGroupId and MessageDeduplicationId per entry
but skipped the per-entry MessageAttributes parsing loop that the
single-entry sns:Publish handler already had. As a result every batched
message reached subscribers (SQS, HTTP, Lambda) with an empty attribute
map, even though the AWS API contract treats MessageAttributes as a
first-class field on PublishBatchRequestEntry.
This caused consumers that rely on attributes for metadata (e.g.
CloudEvents binary content-mode: ce-type, ce-id, ce-source, …) to
discard the messages because the routing headers were missing.
Mirror the loop from handlePublish, parsing
PublishBatchRequestEntries.member.N.MessageAttributes.entry.M.* per
entry, and only attach the attributes map when non-empty so the
SnsService receives the same shape as the single-Publish path.
Adds:
- Handler unit regression test covering attribute forwarding and
per-entry isolation (entry without attrs must not inherit from
sibling entries).
- AWS SDK v2 compatibility test asserting end-to-end fan-out.
Existing single Publish behaviour is unchanged.
* fix(cognito): correct USER_SRP_AUTH PASSWORD_VERIFIER signature
Server-side SRP-6a produced HMAC signatures that never matched what
AWS Amplify / SDKs compute, so USER_SRP_AUTH always failed with
NotAuthorizedException. Five independent bugs in the byte layout and
key-derivation chain:
1. SRP multiplier k: hashed N and g left-padded to N_BYTES (384 bytes).
Cognito/Amplify hash the minimal two's-complement representation
(385 bytes for N — sign byte prepended because MSB is set — and
1 byte for g = 2). k participates in both server B = k*v + g^b and
client S = (B - k*g^x)^(a+ux), so a divergent k breaks the protocol.
Use N.toByteArray() and G.toByteArray() directly.
2. Session key derivation: previously ran an undocumented "Caldera
interleaved hash" over S, then fed that into HKDF with a zero salt.
Cognito applies HKDF-Expand directly over S with the scrambling
parameter U as salt:
PRK = HMAC-SHA256(U_bytes, S_bytes)
T(1) = HMAC-SHA256(PRK, "Caldera Derived Key" || 0x01)
key = T(1)[0..16]
Inline that HKDF in computeSessionKey; drop interleaved hash + the
auxiliary hkdf() helper.
3. HKDF output length: helper returned 32 bytes; Amplify uses the first
16. Return Arrays.copyOf(t1, 16).
4. computeSignature double-HKDF: when sessionKey was already the final
HMAC key, computeSignature ran HKDF on it again. Use it as-is.
5. computeU / computeX byte layout: U was hashed with A and B
left-padded to N_BYTES; salt was decoded as raw hex bytes. Amplify
feeds the minimal two's-complement representation (with sign byte
for positive MSB-set values). Use BigInteger.toByteArray() for A/B
and round-trip the hex salt through BigInteger so a sign byte is
prepended when needed.
Verified by reproducing floci's exact server-side computation in
JavaScript using Amplify's byte conventions: the JS replay reproduces
floci's expected HMAC byte-for-byte (proving the server is internally
consistent) and the divergence from the client's claimed HMAC traces
entirely to k differing. After the fix, USER_SRP_AUTH end-to-end signin
from Amplify v6 (React Native) against floci succeeds.
Compat note: users whose verifier was stored under the previous
computeX with a salt whose first byte has the MSB set (~50% of
generate-salt outputs) will produce a different x and must reset their
password. New signups against this fix are interoperable with Amplify.
Also drops the now-unused padTo() helper.
* test(compatibility): add USER_SRP_AUTH round-trip tests for Node + Java SDKs
The existing CognitoSrpTest only validated that PASSWORD_VERIFIER was
returned by InitiateAuth; nothing exercised the full handshake. With the
server-side SRP math now spec-compliant, add end-to-end tests that prove
real AWS SDK clients authenticate against floci.
Java (sdk-test-java/CognitoSrpTest):
- Add step 4: compute PASSWORD_CLAIM_SIGNATURE from the challenge using
the AWS "Caldera" SRP variant, send RespondToAuthChallenge, assert
AuthenticationResult contains valid JWT id/access/refresh tokens.
- Helper math (computeX / computeU / computeK / calderaHkdf /
hmacSha256 / formatCognitoTimestamp) inlined since the AWS Java SDK
v2 does not expose a public SRP client.
Node (sdk-test-node/tests/cognito-srp.test.ts):
- New round-trip test using amazon-cognito-identity-js 6.3.16 — the
canonical JS SRP impl that @aws-amplify/auth wraps internally.
- Pool is provisioned via AdminCreateUser + AdminSetUserPassword so the
test doesn't depend on an email-delivered verification code.
- Validates tokens come back as well-formed JWTs.
Both tests pass against floci with the fix from the previous commit and
fail (CodeMismatchException / NotAuthorizedException) without it.
* fix(ec2): add missing instance response fields to fix Terraform nil pointer dereference (#871)
The ENI <attachment> block was absent from Floci's RunInstances and
DescribeInstances XML responses. Terraform provider AWS v5.x iterates
network interfaces and reads iface.Attachment.DeviceIndex without nil-checking
Attachment, causing a panic in resourceInstanceRead.
Additional fields required by the provider were also missing: cpuOptions,
metadataOptions, maintenanceOptions, enclaveOptions, hibernationOptions,
privateDnsNameOptions, capacityReservationSpecification, stateReason,
and blockDeviceMapping.
- Add attachmentId and deviceIndex to InstanceNetworkInterface model
- Populate both fields at ENI creation time in Ec2Service.runInstances
- Emit <attachment> and <privateIpAddressesSet> inside each ENI item in instanceXml()
- Emit all missing instance-level fields in instanceXml()
- Add Ec2InstanceResponseShapeTest compatibility test (16 assertions)
* fix(ec2): fix ec2 unit tests
UpdateItem was silently ignoring the legacy `Expected` parameter sent
by AWS SDK v1 clients, causing conditional writes to always succeed
regardless of the condition.
Two bugs fixed:
- `handleUpdateItem` never read the `Expected` field from the request
- `evaluateLegacyExpected` passed conditions directly to
`matchesKeyConditionPublic`, which reads `AttributeValueList`, but
the legacy wire format uses the singular `Value` field instead
The fix reads `Expected` and `ConditionalOperator` in `handleUpdateItem`,
validates mutual exclusion with `ConditionExpression`, fetches the
existing item before the update, and normalizes `{"Value": x}` →
`{"AttributeValueList": [x]}` before delegating to the condition
evaluator.
Closes#848
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.
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.
- 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>