Files
floci/compatibility-tests/sdk-test-go
Hector Ventura e4fa93d7c3 fix(s3): redirect a request signed for another Region than its bucket's (#9606)
S3 answers a bucket only in its own Region. A SigV4 request signed for
another Region now gets 301 PermanentRedirect with the bucket's Region in
x-amz-bucket-region and Bucket and Endpoint in the error, and a HEAD gets
the status and header with no body, which is what the SDKs' redirect
handling follows. ListBuckets, GetBucketLocation and CreateBucket are served
from every Region, and unsigned, presigned and SigV4A requests and buckets in
another partition are served as before. A bucket stored without a Region is
redirected from the default one, where ListBuckets reports it.

floci-duck now signs each bucket's requests for that bucket's Region through
temporary DuckDB secrets that end with the request, so Athena, S3 Select,
Redshift and the CUR reports keep reading and writing buckets outside the
default Region.

floci.services.s3.region-redirect (FLOCI_SERVICES_S3_REGION_REDIRECT,
default true) turns the redirect off.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-27 17:53:43 -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
lambda-web Web functions, revisions, endpoints, waiters, tags, resource policy
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