SendEmail, SendRawEmail and SendTemplatedEmail (v1) and SendEmail (v2)
accepted any Source or FromEmailAddress, so a send from an address that
was never verified succeeded and landed in /_aws/ses. The SendEmail API
Reference says "The message must be sent from a verified email address
or domain", and AWS rejects anything else with MessageRejected.
The send path now checks every address the developer guide names for
this error ("This error could apply to the "From", "Source", "Sender",
or "Return-Path" address"): the Source or FromEmailAddress, the
ReturnPath or FeedbackForwardingEmailAddress and, on a raw message,
every mailbox of its From header, its Sender and its Return-Path
header. A v2 raw send reads the From header only in place of a missing
FromEmailAddress and accepts any From header when one is given
(probe-confirmed), so the header is checked only then. An address
counts as verified when the address itself, its domain or a parent
domain is a verified identity ("if you create and verify an identity
for example.com, you don't need to create separate identities for
a.example.com, a.b.example.com, user@example.com, user@a.example.com").
The error matches AWS: one MessageRejected, "Email address is not
verified. The following identities failed the check in region
US-EAST-1: <address>, <address>", and nothing is captured or relayed.
The check runs after the request's own validation, so the existing
error order is unchanged.
A delegate sender names the owner's identity with SourceArn, FromArn
and ReturnPathArn, their X-SES-SOURCE-ARN, X-SES-FROM-ARN and
X-SES-RETURN-PATH-ARN headers, or v2 FromEmailAddressIdentityArn and
FeedbackForwardingEmailAddressIdentityArn. These are now read (a
parameter wins over its header, and only the first instance of a header
counts), and an address covered by another account's identity ARN is
not checked against the caller's identities. Floci does not evaluate
sending-authorization policies, so it lets such a send through, as it
did before. On a raw send the source ARN also covers the From and
return-path addresses that have no ARN of their own, as SendRawEmail
describes.
Cognito's verification codes and invitations go through SES too, from
Cognito's own no-reply@verificationemail.com or a pool's
EmailConfiguration sender that Cognito has already found verified. They
now use a separate entry point, sendServiceEmail, that skips the check.
Tests and compatibility tests that sent from an unverified address now
verify it first; where a test sent from an address under a domain
identity, the domain is verified by publishing its DKIM records, since
Floci keeps a domain Pending until they exist. SesDomainIdentityTestHelper
does that, and the two copies of the same setup in the configuration-set
tests and the one in SesV2IntegrationTest now use it.
Closes #5141
sdk-test-java
Compatibility tests for Floci using the AWS SDK for Java v2 (2.31.8).
Runs 352 tests across 17 test classes against a live Floci instance — no mocks.
Services Covered
| Test class | Description |
|---|---|
SsmTest |
Parameter Store — put, get, path, tags |
SqsTest |
Queues, send/receive/delete, DLQ, visibility |
SnsTest |
Topics, subscriptions, publish, SQS delivery |
S3Test |
Buckets, objects, tagging, copy, multipart, batch delete |
DynamoDbTest |
Tables, CRUD, batch, TTL, tags, streams |
DynamoDbScanConditionTests |
Scan filter and condition expressions |
LambdaTest |
Create/invoke/update/delete functions |
IamTest |
Users, roles, policies, access keys |
StsTest |
GetCallerIdentity, AssumeRole, GetSessionToken |
SecretsManagerTest |
Create/get/put/list/delete secrets, versioning, tags |
KmsTest |
Keys, aliases, encrypt/decrypt, data keys, sign/verify |
CloudWatchTest |
PutMetricData, ListMetrics, GetMetricStatistics, alarms |
CloudFormationVirtualHostTests |
Virtual host style S3 access via CloudFormation |
ApigwSfnJsonataCrudlTests |
API Gateway + Step Functions JSONata CRUDL integration |
ApiGatewayV2WebSocketAndExtendedOpsTest |
API GW v2 WebSocket APIs, Update ops, Route/Integration Responses, Models, Tagging |
Ec2Tests |
EC2 instances, VPCs, security groups, subnets |
AppSyncTest |
GraphQL API CRUDL, data sources, resolvers, functions, types, API keys, tags, schema validation |
EcsTests |
ECS clusters, task definitions, services |
Adding a New Test
Create a standard JUnit 5 test class in src/test/java/com/floci/test/. Tests run against a live Floci instance using real AWS SDK clients.
Requirements
- Java 17+
- Maven
Running
# All tests
mvn test -q
# Specific test class
mvn test -Dtest=S3Test
# Via just (from compatibility-tests/)
just test-java
Configuration
| Variable | Default | Description |
|---|---|---|
FLOCI_ENDPOINT |
http://localhost:4566 |
Floci emulator endpoint |
AWS_REGION |
us-east-1 |
Region the TestFixtures clients sign for |
AWS credentials are always test / test. Setting AWS_REGION=cn-north-1 (with Floci started
with FLOCI_DEFAULT_REGION=cn-north-1) runs the suite in the China partition; the nightly
Partition Compatibility workflow does exactly that, and tolerates only the failures listed in
.github/ci/compat-partition-allowlist-cn-north-1.txt. Tests that build their own client with an
explicit region keep that region.
Metric filter publishing checks
CloudWatchLogsMetricFilterTest and CloudFormationLogsMetricFilterTest run
with the rest of the suite. Against a server on another port:
# From compatibility-tests/sdk-test-java
FLOCI_ENDPOINT=http://127.0.0.1:18084 ../../mvnw test \
-Dtest=CloudWatchLogsMetricFilterTest,CloudFormationLogsMetricFilterTest
The publishing tests read their expected values from
src/test/resources/cloudwatchlogs/metric-filter-publishing-aws.json, a
byte-identical copy of the root fixture recorded from AWS. MetricFilterFixturePackagingTest
checks the copy loads from the classpath, and the root
CloudWatchLogsMetricFilterFixturePackagingTest fails when either SDK module
copy drifts from the root file. The SDK selects the CloudWatch JSON protocol;
MetricFilterQueryAssertions signs the same reads as legacy form-encoded Query
requests, so GetMetricStatistics and GetMetricData on both wire formats are
asserted against every statistic the fixture records (Sum, SampleCount, Minimum,
Maximum). Reads poll for the sample, since the server publishes it shortly after
PutLogEvents returns. Passing
these tests shows Floci matches the recorded values; it is not live AWS
verification. For the opt-in replay against AWS see ../sdk-test-python/README.md.
Docker
docker build -t floci-sdk-java .
docker run --rm --network host floci-sdk-java
# Custom endpoint (macOS/Windows)
docker run --rm -e FLOCI_ENDPOINT=http://host.docker.internal:4566 floci-sdk-java