The review of lab 4 found four gaps at the attachment boundaries: an anonymous upload with a too large Content-Length got 413 before 401, the single request deadline cut slow but steady uploads and downloads, the API S3 key could list the bucket and run multipart actions, and the one-off services ran as root or as PID 1 without an init process. The change checks the token first, paces the request deadline by the bytes moved, splits the S3 keys of the API and of the reconciler and runs the one-off services as non-root with an init process. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
2.0 KiB
2.0 KiB
1. Платформа
- 1.1 Конвейер: guard раньше проверки объявленного
Content-Length - 1.2 Конвейер: дедлайн с минимальной скоростью передачи для
receive/sendприложения;MIN_TRANSFER_RATE_BYTESвTransportSettings,main.py,compose.yaml,.env.example - 1.3 Проверка группы:
make lint; API-тесты: upload без токена сContent-Lengthбольше лимита →401; медленный идущий upload и скачивание дольше таймаута →201/200; тело ползёт медленнее порога →503
2. Стенд
- 2.1
infra/s3/api-policy.jsonбез multipart,GetBucketLocationиListBucket;infra/s3/reconciler-policy.json;init.shсоздаёт обоих пользователей;cli.sh— aliasreconciler - 2.2
scripts/secrets.sh: ключ сверки;compose.yaml: secrets сверки уreconciler,s3-init,s3-cli;userуx-s3-client;init: trueуmigrateиreconciler - 2.3
scripts/limits.py: политика секретов;scripts/s3-check.sh: запрет листинга ключом API, права ключа сверки;scripts/reconcile_track.py: наполнение под ключом API - 2.4 CI: uid одноразовых сервисов
- 2.5 Проверка группы: стенд из чистого состояния,
make test,make s3-check,make limits,make reconcile,docker stopпрохода сверки
3. Стенд: тесты
- 3.1 Тесты стенда: медленный upload и медленное скачивание 3 MiB через LB, upload без токена с большим
Content-Length→401 - 3.2 Проверка группы:
make student-test,make test-faults,make test-persistence ACTION_SCRIPT=scripts/restart.sh,make test-failover ACTION_SCRIPT=scripts/stop-one.sh,make check