Files
floci/compatibility-tests/sdk-test-python
Brian Taylor b8f1e22c74 feat(cognito): implement log delivery configuration (#2867)
* feat(cognito): implement log delivery configuration

SetLogDeliveryConfiguration and GetLogDeliveryConfiguration were unsupported, so a
config declaring `aws_cognito_log_delivery_configuration` could not be applied
against Floci.

The configuration is stored on the user pool and validated the way the live API
validates it:

- LogLevel accepts ERROR or INFO, EventSource accepts userNotification or
  userAuthEvents, both reported with AWS's 1-based member path
- every entry must name a CloudWatch, Firehose or S3 destination
- Set replaces the list rather than merging, so an empty list clears it
- Get always returns LogConfigurations, as [] when nothing is configured

Floci stores the configuration and delivers nothing: the destination is neither
written to nor required to exist, and the pricing-tier gate AWS applies to
userAuthEvents is not reproduced.

Closes #2855

* fix(cognito): reject a null LogConfigurations instead of clearing the configuration

SetLogDeliveryConfiguration treated an omitted, null or wrongly typed
LogConfigurations as an empty replacement, so a malformed request returned 200
and erased the pool's stored configuration.

AWS rejects all three. An omitted or null member fails validation, and a value of
the wrong JSON type fails deserialization:

  omitted / null -> InvalidParameterException: 1 validation error detected: Value
                    null at 'logConfigurations' failed to satisfy constraint:
                    Member must not be null
  wrong type     -> SerializationException: Expected list or null

Also drops two em-dashes from the docs, per AGENTS.md.

* fix(cognito): translate malformed LogConfigurations elements the way AWS does

A scalar inside the array reached Jackson's convertValue directly, so an
IllegalArgumentException escaped as a 500 InternalFailure instead of a client
error, and a null element would have failed on the validation loop.

AWS answers both without a 500:

  [1, 2] / ["a string"] -> SerializationException: Expected null
  [null]                -> 200, the null element is dropped

Elements are now checked before conversion: nulls are skipped and non-objects
raise SerializationException.

* fix(cognito): bound LogConfigurations and reject a repeated event source

SetLogDeliveryConfiguration validated each element but never checked the list
itself, so a request with three or more well-formed configurations, or two
naming the same event source, was accepted and stored where AWS rejects it.

Measured against Cognito in ap-southeast-1:

  3 well-formed configs   InvalidParameterException, length constraint on
                          'logConfigurations', max 2
  2 duplicate sources     InvalidParameterException, "appear more then once"
  3 configs, one bad enum 2 validation errors, the length one reported first
  unknown pool, bad enum  the validation error, not ResourceNotFoundException
  0 configs               200 OK

The shape checks now run before the pool lookup, matching that last row, and
collect every violation into one message instead of throwing on the first.
The duplicate and missing-destination complaints share one message with the
missing-destination clause first, and each event source is named once however
many configurations carry it, as measured.

"more then once" is the service's own spelling, kept so the message matches.

The length message embeds the request model's toString, which the emulator now
reproduces for all three destination shapes and for an absent destination.
2026-09-02 11:44:18 -04:00
..

sdk-test-python

Compatibility tests for Floci using boto3 (1.37.1).

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-metrics PutMetricData, ListMetrics, GetMetricStatistics, alarms
cloudformation-naming Auto physical name generation, explicit name precedence, cross-reference
cognito User pools, clients, AdminCreateUser, InitiateAuth, GetUser

Requirements

  • Python 3.9+
  • pip

Running

pip install -r requirements.txt

# All groups
pytest tests/ --junit-xml=test-results/junit.xml

# Specific tests
pytest tests/test_s3.py

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

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-python .
docker run --rm --network host floci-sdk-python

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