Files
floci/docs
Kenshin Okinaka ff0201a13a feat(ses): add DKIM actions with domain-inherited email DKIM (#1904)
* feat(ses): add DKIM actions with domain-inherited email DKIM

Adds three DKIM actions and aligns DKIM status with AWS:

- v1 SetIdentityDkimEnabled: toggles the signing flag only (unknown identity ->
  InvalidParameterValue).
- v1 VerifyDomainDkim: returns a domain's three DKIM CNAME tokens (stable across
  calls), registering the domain as pending if absent.
- v2 PutEmailIdentityDkimSigningAttributes (PUT .../dkim/signing): sets the
  signing origin (AWS_SES Easy DKIM, regenerating tokens when the key length
  changes; EXTERNAL BYODKIM), returning DkimStatus + DkimTokens.

DkimVerificationStatus now tracks DNS record detection (via the Route53 lookup
in refreshIdentityState) rather than the enabled flag, so setDkimAttributes no
longer forces the status; the v1-native InvalidParameterValue is remapped to
BadRequestException on the v2 path. An email identity inherits its parent
domain's DKIM (SigningEnabled/Status/Tokens), matching AWS. Adds the
SigningAttributesOrigin / signing key length / last-key-generation fields to the
DkimAttributes response (LastKeyGenerationTimestamp is emitted as epoch seconds,
matching the SES v2 wire format).

Includes an AWS Java SDK compatibility test that exercises all three actions and
the email-inherits-domain behavior end-to-end.

* fix(ses): decouple DKIM status from signing flag and reject DKIM signing on email identities

- refreshIdentityState no longer gates the DkimVerificationStatus -> Success
  transition on isDkimEnabled(), so a domain with the expected CNAMEs reaches
  Success even when DKIM signing is disabled (status tracks DNS detection).
- putDkimSigningAttributes now rejects an email-address identity with
  BadRequestException ("The EmailIdentity value must be a valid domain."),
  matching real AWS — previously it mutated state the email would just inherit
  back from its parent domain on every read.

* fix(ses): report domain DKIM as NotStarted on create, Pending on read

CreateEmailIdentity now returns DkimAttributes.Status=NOT_STARTED for a new
domain (SES has not begun tracking the CNAMEs yet); the first GetEmailIdentity
/ ListEmailIdentities refresh transitions it to PENDING, matching AWS. The
signing-enabled flag no longer gates the NotStarted->Pending transition, so a
disabled domain still reports PENDING on read.

* fix(ses): reject blank identity on PutEmailIdentityDkimSigningAttributes with a 400

A blank or whitespace EmailIdentity fell through to a NotFoundException (404) instead
of the validation error AWS returns. AWS rejects a missing/blank value with the same
400 "The EmailIdentity value must be a valid domain." as an email-shaped identity
(verified), so extend the guard to also cover null/blank.

* docs(ses): clarify DKIM inheritance is from the exact parent domain

An email inherits DKIM only from an exactly-matching registered parent domain, not from a
verified ancestor — a verified example.com does not cover user@mail.example.com unless
mail.example.com is itself registered (verified against AWS). Note this in the DKIM
paragraph so "parent domain identity when one is registered" isn't read as ancestor coverage.
2026-08-15 09:26:37 -04:00
..
2026-03-15 17:43:56 -05:00