Repository navigation
feat(#1612): generated wire-model validation foundation, with ACM as the pilot - #1683
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…the pilot Vendors botocore 1.44.10's models pruned to the routed operations under emulator/wiremodel, generates constraint tables into wire_model_gen.go, and adds a validation gate (step 4.6, after authorization and fault injection) that checks a client request's required members, lengths and ranges, plus enums and patterns per service. ACM is validated. Events record the snapshot the gate ran against, and a replay runs the gate only for events that carry it.
…s the gate does not see A stack's dispatch, a schedule's universal target and the tagging resolver reach ACM without the gate, so the DomainName and CertificateArn checks stay and render through the shared validation form instead of being deleted.
…ol selection, pattern cache - A validation refusal is counted in substrate_requests_total and request_errors_total. - A value of the wrong kind for its shape stops validation and leaves the plugin to answer. - The adapter is chosen by the request's wire format among metadata.protocols, which the tables now carry, so CloudWatch is read in Query and JSON as well as CBOR. - Model patterns compile once; a flattened XML list is named by its member. - -fetch removes models the new manifest drops; the Scheduler generator refuses a model the manifest does not list. - Tests pin that ACM's own checks refuse with validation off.
scttfrdmn
force-pushed
the
feat/v0133-wire-model
branch
from
November 24, 2026 09:28
0ab38a0 to
99d6001
Compare
…ncoded; NaN floats - wireCheckMember runs the gate's own view and walk over one member, so ACM's CertificateArn and DomainName checks answer byte for byte what the gate does (all failures, lengths in characters, an empty value as present). The tagging resolver keeps its own wording. - A request is read as Query only when it names an Action or carries a form body. - A float sent as NaN, Infinity or -Infinity is a float. - -fetch removes only models the previous manifest vendored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1612. This PR ships the generated validation foundation and turns it on for ACM. Still to come under #1612: the SESv2, ElastiCache, Route 53 and EC2 key-pair and placement-group pilots, in
feat/v0133-wire-validation-pilots, which is based on this branch. The shared pagination primitive is W-P's PR. Generated serializers are #1681.cmd/gen-wire-model -fetchdownloads botocore 1.44.10 (botocoreTag) from GitHub as one tarball. For each mapped service it takes the newest API version, prunes it to the shapes reachable fromemulator.RoutedOperations(inputs, outputs and errors) plus paginators, strips the documentation, and writesemulator/wiremodel/<svc>.json.gzand amanifest.json. The result is 70 models, 1,116 operations and about 356 KB gzipped.pluginModels(cmd/gen-wire-model/plugins.go) maps all 68 plugins. Two are listed as unmodelled with a reason: execute-api and opensearch.TestPluginModels_CoverEveryRoutedPluginasserts the mapping covers every plugin.ExecuteGraphQLand servicequotasListRequestedServiceQuotaChangesByService. Ten more are defined by two of a plugin's models (ELB classic and v2; Timestream), so they are left out of the tables.-fetchremoves a model that the previous manifest vendored and the new one no longer lists, and the Scheduler generator refuses a model the manifest does not list.make wire-modelgeneratesemulator/wire_model_gen.go(about 0.9 MB, undercfn_schema_gen.go's 1.2 MB).Min/Maxas written in the model, an enum index, a pattern index and its constrained members (with theirlocation,locationName,queryNameandflattenedtraits).wireOperationsmaps each plugin and operation to its input shape, plus the HTTP method and URI template for REST.wireModelscarries each model'smetadata.protocols.make wire-model-checkruns offline in CI's Service Reference Drift job, and fails naming any routed operation the snapshot lacks.make wire-model-fetchneeds the network and is run by hand.cmd/gen-scheduler-query-modelreads the vendored snapshot instead of the AWS CLI, and gainsmake scheduler-query-model-checkin CI.DescribeNetworkInterfaces(examples: Terraform end-to-end journey against substrate #1519), which the regenerated file now includes.emulator/wire_validate.go).validateRequestwalks the input shape through oneinputViewinterface, with four adapters:cborDecodeand read through the same view.req.Params:member.N, flattened and named lists,entry.N.key/value, and EC2'squeryNameor capitalizedlocationName. The iam/sts/sqs/sns re-encoding atserver.go's step 1 replacesreq.Bodybut leavesParamsin place, which is what the gate reads.requestUri(including greedy{Key+}), query-string scalars and repeated-key lists, headers, prefixed header sets, structure and blob payloads, and JSON or XML bodies.big.Rat. Enum and pattern checks run only where a service opts in. A pattern Go's RE2 cannot compile (botocore patterns are Java regexes, for example(?!-)) is skipped.Smithy-Protocolheader, a target or a JSON content type, otherwise form parameters) among the model'smetadata.protocols. CloudWatch, which serves CBOR, JSON and Query, is read in each.Actionor carries a form body. A float sent asNaN,Infinityor-Infinityis treated as a float.emulator/wire_validate_errors.go).validatedServicesgives each service its codes and statuses for a missing member and for every other failure, its message style, and its enum and pattern opt-ins.N validation error(s) detected: …; …,Value null at 'x' … Member must not be null, and paths liketags.2.member.key. A list of scalars is reported once, asMember must satisfy constraint: [...]. Each form is cited next to the literal.ValidationExceptioncites a common-errors page.scheduler_errors.go's helpers separate. They render one hard-coded message per guard, and Scheduler is not validated yet.stepValidate(step 4.6) is the last step ofprePluginGates.check, after authorization, quota, consistency and fault injection. It covers only top-level requests to services invalidatedServices. Internal dispatches go throughRouteRequestand never reach it.wire.validate: false/SUBSTRATE_WIRE_VALIDATE=false(Config.Wire.SkipValidation, so the zeroConfigvalidates) andWithoutWireValidation().substrate_requests_totalandsubstrate_request_errors_total, under the service's code.Event.ValidationModel(validation_model, omitempty) recordsbotocore/1.44.10whenever the gate ran live.WithValidationModelrecords it regardless ofinclude_state_hashes. SQLite and file backends store the serialized event, so no schema change is needed. Fixture export embeds the field, which a test asserts.ValidationException/400 for every failure. Enum and pattern checks are on.Value of the input at(andValue null atfor missing members) comes from observed AWS answers, cited in the table. The reference publishes no text. The release notes need a## Provenanceentry for this.RequestCertificateDomainNamecheck and theCertificateArnconstraint checks. The gate makes them unreachable for a client's request, but three paths still reach them without it: a CloudFormation dispatch, a Scheduler universal target (acmis inschedulerSDKServices) and any request with validation off. They now callwireCheckMember, which runs the gate's own view, walk and refusal over that one member, so their answers match the gate's byte for byte: every failure for the member, lengths counted in characters, and an empty value treated as present.TestWireValidation_ThePluginsOwnChecksAnswerInTheGatesWordsandTestWireValidation_WithItOffThePluginStillRefusesbyte-compare the cases: missing, empty, too short, too long with non-ASCII characters, within the length in characters but over it in bytes, and failing only the pattern. The tagging resolver keeps its own wording throughacmValidateCertificateARN.docs/reference/concepts/validation.mdcovers what is checked, the message forms, gate order, opt-out and replay. Also updated: the ACM reference page, the testing guide (a Request Validation section and the replay step table), anddocs/contributing.md(CI table and the plugin-checklist row).Routed-operation catalog unchanged.
Gates run locally:
make lint test e2e;operation-catalog-check docs-reference-check docs-headings-check operation-docs-check authz-reference-check cfn-schema-check wire-model-check scheduler-query-model-check doc-links-check;wire-bookkeeping-check discarded-unmarshal-check discarded-marshal-check discarded-state-check nondeterminism-check comment-history-check;docs-versions docs-counts-check;SUBSTRATE_IAC=1 make iac-e2e: Terraform and CDK journeys pass;Follow-up issues (milestone v0.137.0, label
area: wire):*_gen.go;