Repository navigation
fix(#1062): nine 200s for an absent required member become refusals - #1100
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #1062.
Nine operations answered 200 with a successful body for a request that omitted a member their page
marks
Required: Yes.CreateAccountAssignmentwith no body answered 200 and aSUCCEEDEDstatusfor an assignment whose permission set, target and principal were all the empty string, and
DeleteAccountAssignmentansweredSUCCEEDEDfor 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.
ValidationException/400GetTablesInvalidInputException/400ValidationError/400InvalidParameterException/400InvalidParameterException/400ValidationError/400Three premise corrections, posted on the issue before this PR opened
Scopeis required at eight WAFv2 operations, not the two the issue names.wafv2_plugin.godefaulted an absent
ScopetoREGIONALat nine sites; the member isRequired: Yeson eight ofthe pages behind them and
Required: Noonly onGetWebACL, 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, soREGIONALwas substrate's invention: a caller who omitted the member while meaningCLOUDFRONTgot a regional lookup and a not-found, or a web ACL created in the wrong scope.GetWebACLkeeps the fallback as a recorded divergence — an optional member cannot be refused forbeing absent and the lookup still needs a value.
cognito_idp_plugin.go:468is not a thirdMaxResultsrequired-member site.API_ListUserPoolClientsmarksMaxResultsRequired: No(1–60) andUserPoolIdRequired: Yes.So that handler's required-member defect is the unchecked
UserPoolId, fixed here; its page-sizerewrite is left to the page-size issue. That correction also means
MaxResultsisRequired: Yesover 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
GetRecordspublishes no validation error of any kind. Its five areExpiredIteratorException,InternalServerError,LimitExceededException,ResourceNotFoundExceptionandTrimmedDataAccessException, and the page assigns even anout-of-range
LimittoLimitExceededException— so there is no gap where a validation code wasmerely left unlisted.
ValidationExceptionwas declined despite eighteen sites in the sameplugin 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, whosepublished 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.goanddynamodb_streams_errors.goeach carry the argument in the doc comment, following theglue_errors.go/fsx_errors.goshape #1063 established.Two divergences are recorded rather than fixed:
GetWebACL'sREGIONALfallback, and the enumvalues
TargetType/PrincipalTypepublish for SSO, which are the present-but-invalid axis and needtheir own reading.
Tests
Twenty-five rows in
memberComplaintServicesacross four new service entries (SSO, the two Cognitoservices, 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
Idfor a{}body are now pairs.Scopeis checked first, soretargeting them would have silently stopped testing #1063's
Idrefusals; the second row of eachpair supplies a
Scopeto reach the check underneath.wafv2_scope_test.gocarries the two halves the one-code table cannot: the invalid-value code at alleight 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 areValidationError/400.TestInvalidBodyLeavesAnAbsentBodyAlone's doc comment anddocs/services.md's third-slice note bothrecorded 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_ErrorscalledListAccountAssignmentswith a comment reading "noAccountIdfilter — should return all", which was describing substrate's own omission rather thanthe API. It supplies the now-required
AccountId, which does not narrow the result because substratescopes 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
Scopewhere six of them previously inventedREGIONAL. A caller that was implicitly relying on the invented scope was already getting answersabout 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.