feat: add private S3 storage (SeaweedFS) with bootstrap and client
- s3 and s3-bootstrap services: SeaweedFS 4.48 pinned by digest, internals on loopback, signing key, private bucket, API user policy, privacy checks on every bootstrap - [s3] settings and aiobotocore client in src/infra/s3: deadline per call, no retries, 503 on outage or rejected credentials - make start_s3, stop_s3, s3_check; run_dev, test_isolated, wipe_data and restart hook include S3 - failure_checks with own S3 and readiness check without it; bench generates S3 secrets and filters them out of the passport - rules, AGENTS.md, skill; sync health delta; KNOWN_ISSUES: rollout_from Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ from .idempotency import IdempotencyConflict
|
||||
from .pagination import InvalidCursor
|
||||
from .service import ServiceUnavailable
|
||||
from .session import InvalidCredentials, Unauthenticated
|
||||
from .storage import ObjectStorageUnavailable, StoredObjectMissing
|
||||
from .user import UsernameTaken
|
||||
|
||||
__all__ = [
|
||||
@@ -13,7 +14,9 @@ __all__ = [
|
||||
"InvalidChatMembers",
|
||||
"InvalidCredentials",
|
||||
"InvalidCursor",
|
||||
"ObjectStorageUnavailable",
|
||||
"ServiceUnavailable",
|
||||
"StoredObjectMissing",
|
||||
"Unauthenticated",
|
||||
"UsernameTaken",
|
||||
]
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
from .base import DomainError
|
||||
from .service import ServiceUnavailable
|
||||
|
||||
|
||||
class ObjectStorageUnavailable(ServiceUnavailable):
|
||||
"""S3 недоступен, не ответил за срок или отклонил учётные данные API.
|
||||
|
||||
Наследник `ServiceUnavailable`: 503 `unavailable` по таблице
|
||||
`src/api/errors.py`. Причину видно в журнале клиента, а не в ответе.
|
||||
"""
|
||||
|
||||
|
||||
class StoredObjectMissing(DomainError):
|
||||
"""Объекта с таким ключом в bucket нет.
|
||||
|
||||
Отличается от недоступности S3. HTTP-ответ на него назначает change
|
||||
`attachments`.
|
||||
"""
|
||||
|
||||
default_message = "Stored object not found"
|
||||
Reference in New Issue
Block a user