Files
floci/compatibility-tests/sdk-test-go/tests
Abhigya 4e42f47740 fix(cognito): stop defaulting unset password requirements to enabled (#4250)
* fix(cognito): stop defaulting unset password requirements to enabled

CreateUserPool filled in RequireUppercase, RequireLowercase, RequireNumbers
and RequireSymbols as true whenever a PasswordPolicy left them out. The four
members are unboxed booleans in the Cognito model, so a client that wants one
off cannot say so on the wire: aws-sdk-go-v2 emits each under
`if v.RequireLowercase != false`. A request built for require_* = false
carries only MinimumLength, and Floci answered it with all four enabled.

That made every Terraform plan after a create report drift on all four flags,
converging only because UpdateUserPool does not normalize, and it over-enforced
the policy on SignUp and AdminSetUserPassword: a pool created with
PasswordPolicy { MinimumLength: 6 } rejected passwords real Cognito accepts.

The API reference documents no default for any of the four. It documents one
for TemporaryPasswordValidityDays ("Defaults to 7"), which is kept, along with
MinimumLength 8. The all-enabled policy is the console's "Cognito defaults"
mode, not an API default; terraform-provider-aws asserts require_numbers and
require_uppercase read back as false immediately after a create that set them
to false, against the live service.

Absence now means "not required", which validatePasswordAgainstPolicy already
resolved that way through policyBoolean, so enforcement follows with no change.

Pools created with no PasswordPolicy at all are untouched, as before.

* test(cognito): pin the unset password requirement contract at the wire

Adds the JSON 1.1 half of the CreateUserPool password policy fix: a request
carrying only MinimumLength must come back without the four Require* members,
and a request that sets them to false explicitly must come back with false.

Verified non-vacuously - with the RequireUppercase default restored, the first
test fails on "RequireUppercase must not be defaulted on".
2026-09-23 14:03:27 -04:00
..
2026-04-11 09:59:05 -05:00