Files
floci/compatibility-tests/sdk-test-go
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
..

sdk-test-go

Compatibility tests for Floci using the AWS SDK for Go v2 (1.41.4).

Services Covered

Group Description
ssm Parameter Store — put, get, label, history, path, tags
sqs Queues, send/receive/delete, DLQ, visibility
sns Topics, subscriptions, publish, SQS delivery
s3 Buckets, objects, tagging, copy, batch delete
s3-cors CORS configuration
s3-notifications S3 → SQS event notifications
dynamodb Tables, CRUD, batch, TTL, tags
lambda Create/invoke/update/delete functions
iam Users, roles, policies, access keys
sts GetCallerIdentity, AssumeRole, GetSessionToken
secretsmanager Create/get/put/list/delete secrets, versioning, tags
kms Keys, aliases, encrypt/decrypt, data keys, sign/verify
kinesis Streams, shards, PutRecord/GetRecords
cloudwatch PutMetricData, ListMetrics, GetMetricStatistics, alarms
rds-data RDS Data API execute statements, transactions, result fields with SDK v1 and v2

Requirements

  • Go 1.24+

Running

# All groups
gotestsum --junitfile test-results.xml ./tests/... ./internal/testutil/...

# Specific tests
go test ./tests/... ./internal/testutil/... -run TestSsm

# Via just (from compatibility-tests/)
just test-go

Configuration

Variable Default Description
FLOCI_ENDPOINT http://localhost:4566 Floci emulator endpoint

AWS credentials are always test / test / us-east-1.

Docker

docker build -t floci-sdk-go .
docker run --rm --network host floci-sdk-go

# Custom endpoint (macOS/Windows)
docker run --rm -e FLOCI_ENDPOINT=http://host.docker.internal:4566 floci-sdk-go