mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
* feat(ecr): PutImage and the layer API PutImage, BatchCheckLayerAvailability, GetDownloadUrlForLayer, InitiateLayerUpload, UploadLayerPart and CompleteLayerUpload now go through the registry:2 container that docker push already writes to, so an image written through the API is the image docker pull and BatchGetImage return. - PutImage writes the manifest under its tag, or under its digest. It answers ImageDigestDoesNotMatchException, ImageAlreadyExistsException, ImageTagAlreadyExistsException and LayersNotFoundException as the model lists them. - Layer uploads map onto registry upload sessions, held in memory. Parts must follow each other, be at most 20 MiB, and all but the last at least 5 MiB. - GetDownloadUrlForLayer returns the blob's address on Floci's registry endpoint. - The immutable-tag guard moves into EcrService, so a docker push and a PutImage of one tag cannot both succeed. Closes #5735 * fix(ecr): refuse mixed layer digests, keep push time on retag, expire idle uploads CompleteLayerUpload refuses a second, different layer digest instead of ignoring it. PutImage keeps an image's first push time when it retags it. A layer upload idle for a day is refused even when no other upload opens, and dropping one cancels its registry upload session. * fix(ecr): check PutImage tags, require a manifest media type, share registry error handling - PutImage checks imageTag against the OCI tag grammar and answers InvalidParameterException otherwise. The tag goes into the registry's manifest URL, so v1?x wrote v1 and a slash wrote into another repository. - A manifest with no mediaType needs imageManifestMediaType, as on AWS, instead of Floci guessing one from the manifest's shape. - PutImage and the layer API reach the registry through one helper, callRegistry, in place of five copies of the same failure handling. * fix(ecr): answer ECR's own message for a tag outside its rule PutImage refuses a tag outside ECR's rule, [a-zA-Z0-9-_.]+ up to 300 characters, with ECR's message. A tag ECR takes but the backing registry cannot hold, one starting with '.' or '-' or longer than 128 characters, is refused with a message naming that limit, which docs/services/ecr.md now notes.
sdk-test-awscli
Compatibility tests for Floci using the AWS CLI v2 (2.22.35).
Tests are plain bash scripts that call aws CLI commands with --endpoint-url pointed at the emulator.
Services Covered
| Group | Description |
|---|---|
ssm |
Parameter Store — put, get, path, tags |
sqs |
Queues, send/receive/delete, attributes |
sns |
Topics, publish, attributes |
s3 |
Buckets, objects, tagging, copy, delete |
dynamodb |
Tables, put/get/update/query/delete items |
iam |
Users, roles, create/get/delete |
sts |
GetCallerIdentity |
ses |
Identities, sending, quotas, notification attributes |
secretsmanager |
Create/get/put/list/tag/delete secrets |
kms |
Keys, aliases, encrypt/decrypt |
cognito |
User pools, clients |
s3-notifications |
S3 → SQS event notifications |
Requirements
- AWS CLI v2
- bash
- jq
- bats-core (installed via
just setup-awscli)
Running
# All groups (from compatibility-tests/)
just test-awscli
# Run bats directly
./lib/run-bats-with-junit.sh sdk-test-awscli/test/ sdk-test-awscli/test-results/junit.xml
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-awscli .
docker run --rm --network host floci-sdk-awscli
# Custom endpoint (macOS/Windows)
docker run --rm -e FLOCI_ENDPOINT=http://host.docker.internal:4566 floci-sdk-awscli