Skip to content

feat(#1612): request-validation pilots — SESv2, Route 53, ElastiCache, EC2 key pairs and placement groups - #1686

Merged
scttfrdmn merged 3 commits into
mainfrom
feat/v0133-wire-validation-pilots
Nov 24, 2026
Merged

scttfrdmn merged 3 commits into
mainfrom
feat/v0133-wire-validation-pilots

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Part of #1612. This PR turns on the validation pilots on top of V1, which merged as #1683 (62fc10a). It is rebased onto main, so the diff is V2 only.

What remains under #1612 after this PR is the follow-up work: #1680 (validate the remaining services in protocol batches), #1681 (generated serializers) and #1682 (REST bindings beyond the pilots).

For each pilot, the code, status and message form are in validatedServices (emulator/wire_validate_errors.go), and each cites its source in a comment beside the row.

  • SESv2 (REST-JSON). Every failure answers BadRequestException/400. Every routed operation publishes this code ("The input you provided is invalid.").
    • The message uses SESv2's observed form, which leaves the value out: Value at 'deliveryOptions.maxDeliverySeconds' … Member must have value greater than or equal to 300 (terraform-provider-aws#40591).
    • Enum checks are on. Source: … Member must satisfy constraint: [Member must satisfy enum value set: [BOUNCE, COMPLAINT]] (terraform-provider-aws#38207).
    • The Value null at form for a missing member is substrate's reading for SESv2. No source shows it for this service.
  • Route 53 (REST-XML). Every failure answers InvalidInput/400. Every routed operation publishes this code ("The input is not valid.").
    • The message uses the quoted form: InvalidInput: 1 validation error detected: Value '/hostedzone/…' at 'resourceId' … less than or equal to 32 (terraform-provider-aws#37817).
    • Enum checks are on. Source: Value 'to' at 'startRecordType' … Member must satisfy enum value set: [...] (terraform-provider-aws#11677).
    • The tests reproduce AWS's own path for TTL, changeBatch.changes.1.member.resourceRecordSet.tTL (ttl for route53 should be sent as seconds caddy-dns/route53#17).
    • Route 53 lists enum values in an order of its own. Substrate lists them in the model's order, and the docs say so.
  • ElastiCache (Query). Every failure answers InvalidParameterValue/400, from the ElastiCache common-errors page.
  • EC2 (key pairs and placement groups). validatedServices can now be scoped per operation (ops). This PR validates CreateKeyPair, ImportKeyPair, DeleteKeyPair, DescribeKeyPairs, CreatePlacementGroup, DeletePlacementGroup and DescribePlacementGroups.
    • A missing member gets MissingParameter with The request must contain the parameter KeyName, naming the parameter by the model's locationName (publicKeyMaterial, groupName), or by the member name where there is none (KeyName). The observed answers name instanceId and ebs the same way.
    • Source: the EC2 error-codes page for the codes. The sentence is observed in the EC2 forum ("EC2 Missing parameter") and MissingParameter ebs error when using ami_block_device_mappings with volume_type hashicorp/packer#3799, and it matches ec2MissingParameter.
    • The model has no length or range constraints on these operations. Enums stay off: EC2's enforcement wording for model enums is unverified.
  • Interpreter. Adds missingSentence and the wireStyleElided and wireStyleEC2 message styles. The walker computes EC2 wire names.
  • Hand-written checks. Following the V1 review, none are removed. Each one the gate duplicates is kept, because CloudFormation dispatches, Scheduler universal targets and blank (present but empty) values still reach it. Each now goes through wireRequireMember. For an absent member, and for a blank one the model gives a minimum length, it runs the gate's own walk over that member (wireCheckMember), so the answer is the gate's byte for byte. A blank member the model doesn't bound is refused in the same form. TestWireValidation_PilotPluginChecksAnswerInTheGatesWords byte-compares the answers with the gate on and off. The sites:
    • ElastiCache: 13 X is required sites, via elasticacheMissing;
    • EC2: CreateKeyPair and ImportKeyPair (KeyName, PublicKeyMaterial), and DeletePlacementGroup (GroupName), via ec2MissingParameter;
    • SESv2: CreateEmailIdentity;
    • Route 53: CreateHostedZone Name, and ChangeResourceRecordSets' Type check, which now reports the change's index and the enum.
  • Tests.
    • Raw-HTTP refusals for each pilot: missing members, a too-short and an over-length string, out-of-range numbers, URI-label length, query-string and body enums, and blank values that the plugin answers in the same words.
    • A valid session across all four pilots returns byte-identical bodies with validation on and off.
    • Validation is operation-granular for EC2 (CreateVpc is unaffected).
    • A CloudFormation ElastiCache dispatch is not validated.
  • Fixtures. Four existing ElastiCache tests sent CreateCacheSubnetGroup without the required SubnetIds, and one SESv2 test sent SendEmail without the required Content. They now send both.
  • Docs. The concept page's service table and message forms are updated. The SESv2, Route 53, ElastiCache and EC2 reference pages each gain a "Request validation" section.

Routed-operation catalog unchanged.

Gates run locally:

  • make lint test e2e;
  • both drift sets, including wire-model-check, scheduler-query-model-check, comment-history-check and doc-links-check;
  • nondeterminism-check docs-versions docs-counts-check cfn-schema-check;
  • SUBSTRATE_IAC=1 make iac-e2e: Terraform and CDK pass. Neither journey uses Route 53 or ElastiCache today.
  • the VitePress build.

Review fixes (dbf753d).

  • wireCheckMember and wireRequireMember take the plugin's own service and operation. If the tables hold no such member, the plugin's previous refusal is returned instead.
  • ChangeResourceRecordSets checks its whole ChangeBatch through the gate's walk. The record-type list is read from the model with wireEnumAt; the hand-kept enum is gone.
  • A blank value the model does not bound is refused as Member must not be blank, which is substrate's own wording.
  • When a service has a missing-member sentence, the refusal uses the first missing member anywhere in the list.
  • The CHANGELOG now lists every newly enforced member, generated from the tables.
  • New tests:
    • direct plugin calls with no Service;
    • Route 53 with a bad Type, and with a bad Type plus a bad TTL, compared byte for byte between gate on and gate off.

Follow-up issues: #1680, #1681, #1682, #1687 (ElastiCache drops SubnetIds) and #1688 (Terraform coverage of the pilot services), all on v0.137.0.

@scttfrdmn scttfrdmn added this to the v0.133.0 milestone Nov 24, 2026
@scttfrdmn scttfrdmn added type: feature New feature or improvement area: wire Generated wire layer: service models, request validation, serializers labels Nov 24, 2026
@scttfrdmn
scttfrdmn changed the base branch from feat/v0133-wire-model to main November 24, 2026 09:40
@scttfrdmn
scttfrdmn force-pushed the feat/v0133-wire-validation-pilots branch from b5b4fb9 to c41f434 Compare November 24, 2026 10:03
… key pairs and placement groups

Each pilot's code, status and message form is in validatedServices with its source. Route 53
and SESv2 opt into enums on observed AWS answers. EC2 is validated per operation. Plugin checks
the gate duplicates are kept and answer in the gate's words, since dispatches the gate does not
see still reach them.
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.08257% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
emulator/route53_plugin.go 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…oute 53 batch through the gate's walk

- wireCheckMember and wireRequireMember take the plugin's own service and operation, and a
  member the tables do not hold returns the plugin's previous refusal.
- ChangeResourceRecordSets checks its ChangeBatch through the gate's walk, and its Type list is
  read from the model; the hand-kept enum is gone.
- A blank member the model does not bound is refused as blank, not null.
- A service's missing-member sentence names the first missing member anywhere in the list.
- EC2 names a missing parameter by the model's locationName.
- CHANGELOG lists every newly enforced member; follow-ups #1687 and #1688.
@scttfrdmn
scttfrdmn merged commit 32e50fd into main Nov 24, 2026
20 checks passed
@scttfrdmn
scttfrdmn deleted the feat/v0133-wire-validation-pilots branch November 24, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: wire Generated wire layer: service models, request validation, serializers type: feature New feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant