Skip to content

wafv2: CreateIPSet accepts a request that omits the required IPAddressVersion #755

Description

@scttfrdmn

CreateIPSet marks IPAddressVersion Required: Yes in the API reference, but substrate
accepts a request that omits it and silently substitutes IPV4 (emulator/wafv2_plugin.go, the
createIPSet arm). #738 fixed the name substrate reads — the wrong one made a typed SDK's
IPV6 request fall through to that same default — but deliberately kept the default rather than
adding a refusal, because a missing-required-parameter refusal is a different class of defect and
needs its own error-code verification.

A caller that omits the parameter gets a successful IPv4 set where AWS refuses, so a test
exercising the validation branch of its own code cannot see the refusal.

What has to be decided

Which refusal AWS actually publishes. WAFv2's error list for CreateIPSet carries
WAFInvalidParameterException, WAFLimitsExceededException, WAFInternalErrorException,
WAFDuplicateItemException, WAFOptimisticLockException, WAFTagOperationException,
WAFTagOperationInternalErrorException, WAFSubscriptionNotFoundException and
WAFInvalidOperationException — but a required-member omission may be refused by the protocol
layer before the operation is reached, in which case the code and HTTP status come from the
serializer, not from the operation. That has to be checked against the reference before anything
is implemented, not guessed from a sibling operation.

The same question applies to the other required members on the operation (Name, Scope,
Addresses), and to whether an address that does not parse as CIDR for the declared version is
refused — so the answer is worth establishing once for the plugin rather than per parameter.

Acceptance criteria

  • The refusal for an omitted IPAddressVersion matches the code and HTTP status the AWS
    reference publishes, with the source named in the commit message.
  • The same rule is applied to the operation's other required members, or the difference is
    recorded with its reason.
  • A table-driven test covers omission of each required member.
  • docs/services.md records whatever remains a deliberate divergence.

Filed out of #738, which fixed the wire name only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions