Skip to content

fix(#1062): nine 200s for an absent required member become refusals - #1100

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1062-required-member-refusals
Sep 19, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1062-required-member-refusals

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #1062.

Nine operations answered 200 with a successful body for a request that omitted a member their page
marks Required: Yes. CreateAccountAssignment with no body answered 200 and a SUCCEEDED status
for an assignment whose permission set, target and principal were all the empty string, and
DeleteAccountAssignment answered SUCCEEDED for deleting it.

The codes are four, not one

Each refusal is the code the operation's own page publishes. The spread is the finding, and a single
code would have meant borrowing from a sibling service at six of the nine — which #671 settles
against.

service code grounds
SSO Admin (3 ops) ValidationException/400 published on all three pages, and already the plugin's answer at its two checked guards
Glue GetTables InvalidInputException/400 published; the code #1063 centralized one release earlier
WAFv2 (8 ops) ValidationError/400 #755's reading of the JSON common list, cited rather than re-derived
Cognito Identity InvalidParameterException/400 gloss is "Thrown for missing or bad input parameter(s)" — names the missing case
Cognito user pools InvalidParameterException/400 gloss says "invalid", not "missing" — recorded as substrate's reading
DynamoDB Streams ValidationError/400 the page publishes no validation error of any kind

Three premise corrections, posted on the issue before this PR opened

Scope is required at eight WAFv2 operations, not the two the issue names. wafv2_plugin.go
defaulted an absent Scope to REGIONAL at nine sites; the member is Required: Yes on eight of
the pages behind them and Required: No only on GetWebACL, which addresses a web ACL by ARN.
Correcting the two named sites would have left the same defect at six — the shape that let #950's
eleven deferred sites survive four releases into #1063. No WAFv2 page publishes any default for
Scope
, so REGIONAL was substrate's invention: a caller who omitted the member while meaning
CLOUDFRONT got a regional lookup and a not-found, or a web ACL created in the wrong scope.
GetWebACL keeps the fallback as a recorded divergence — an optional member cannot be refused for
being absent and the lookup still needs a value.

cognito_idp_plugin.go:468 is not a third MaxResults required-member site.
API_ListUserPoolClients marks MaxResults Required: No (1–60) and UserPoolId Required: Yes.
So that handler's required-member defect is the unchecked UserPoolId, fixed here; its page-size
rewrite is left to the page-size issue. That correction also means MaxResults is Required: Yes
over 1–60 on the two pages that do mark it so, with no published default — so the silent rewrite to
60 is gone at those two operations, and absent, zero, negative and above-sixty each refuse. One range
check covers all four, because zero is itself below the published minimum.

DynamoDB Streams GetRecords publishes no validation error of any kind. Its five are
ExpiredIteratorException, InternalServerError, LimitExceededException,
ResourceNotFoundException and TrimmedDataAccessException, and the page assigns even an
out-of-range Limit to LimitExceededException — so there is no gap where a validation code was
merely left unlisted. ValidationException was declined despite eighteen sites in the same
plugin answering it: those are DynamoDB's control-plane pages, a different API surface reached
through the same plugin, and borrowing across it is the analogy #671 forbids.

Provenance

Every code above is from the operation's own Errors section except WAFv2's and DynamoDB Streams',
which come from the JSON-protocol common-errors list because their pages publish no validation code
at all. Two readings are recorded as substrate's rather than the page's: ListUserPools, whose
published gloss covers an invalid parameter but not a missing one, and DynamoDB Streams GetRecords,
which has no published code to rest on. sso_errors.go, cognito_errors.go and
dynamodb_streams_errors.go each carry the argument in the doc comment, following the
glue_errors.go/fsx_errors.go shape #1063 established.

Two divergences are recorded rather than fixed: GetWebACL's REGIONAL fallback, and the enum
values TargetType/PrincipalType publish for SSO, which are the present-but-invalid axis and need
their own reading.

Tests

Twenty-five rows in memberComplaintServices across four new service entries (SSO, the two Cognito
services, DynamoDB Streams — the last named for the API rather than a host, because substrate routes
the Streams operations through DynamoDB's own host and target prefix).

The five WAFv2 rows that named Id for a {} body are now pairs. Scope is checked first, so
retargeting them would have silently stopped testing #1063's Id refusals; the second row of each
pair supplies a Scope to reach the check underneath.

wafv2_scope_test.go carries the two halves the one-code table cannot: the invalid-value code at all
eight required operations, asserted per handler so a handler that forgot the call fails, and
GetWebACL's exemption — which needs a message assertion because both of its refusals are
ValidationError/400.

TestInvalidBodyLeavesAnAbsentBodyAlone's doc comment and docs/services.md's third-slice note both
recorded the nine as deliberately unpinned; both now record them as checked, and both keep the reason
the exclusion mattered — had the nine been pinned when they were measured, each would have carried a
passing assertion that its defect was correct behavior.

One test moved: TestSSOPlugin_Errors called ListAccountAssignments with a comment reading "no
AccountId filter — should return all", which was describing substrate's own omission rather than
the API. It supplies the now-required AccountId, which does not narrow the result because substrate
scopes the listing to the caller's account regardless.

Compatibility

A consumer that omitted any of these members and relied on the 200 now gets a 400. That is the point
of the change, but it is a behavioural break in nine places, and the WAFv2 half is wider than the
issue's table: eight operations refuse an absent Scope where six of them previously invented
REGIONAL. A caller that was implicitly relying on the invented scope was already getting answers
about a scope it never named.

Gate: S1–S9 clean. Coverage 85.6% emulator / 85.1% total, at or above the 85.5/85.0 floor.

Nine operations answered 200 with a successful body for a request omitting a
member their page marks Required: Yes. Each now refuses with the code its own
page publishes, which is four codes rather than one: ValidationException for
SSO Admin's three account-assignment operations, InvalidInputException for Glue
GetTables, InvalidParameterException for the two Cognito services, and
ValidationError for WAFv2 (#755's reading, cited not re-derived). A single code
would have meant borrowing from a sibling service at six of the nine, which
#671 settles against.

Three premises in the issue changed, all posted on it before this PR:

  - Scope is Required: Yes at eight of the nine WAFv2 sites that defaulted it,
    not the two named, and Required: No only on GetWebACL. All eight refuse now;
    GetWebACL keeps the REGIONAL fallback as a recorded divergence, since no
    WAFv2 page publishes any default for the member. A present-but-unrecognized
    Scope answers WAFInvalidParameterException at all nine.
  - cognito_idp ListUserPoolClients is not a third MaxResults required-member
    site: its MaxResults is Required: No and its UserPoolId is Required: Yes.
    The UserPoolId check is here; the page-size rewrite stays for that issue.
  - DynamoDB Streams GetRecords publishes no validation error of any kind, so
    its refusal comes from the JSON common list. ValidationException was
    declined despite eighteen sites in the same plugin, because those are
    DynamoDB's control-plane pages — a different API surface.

MaxResults is Required: Yes over 1-60 on both Cognito list pages with no
published default, so the silent rewrite to 60 is gone there: absent, zero,
negative and above-sixty each refuse.

Twenty-five rows in memberComplaintServices across four new service entries,
plus wafv2_scope_test.go for the two halves a one-code table cannot carry. The
five WAFv2 rows that named Id for a {} body are now pairs, so #1063's Id
refusals stay pinned underneath the new Scope check.
@codecov

codecov Bot commented Sep 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit eac12a7 into main Sep 19, 2026
17 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1062-required-member-refusals branch September 19, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nine operations answer 200 for a body that omits a member their page marks Required: Yes

1 participant