feat: implement S3 attachments and presigned uploads

This commit is contained in:
sinveria
2026-11-10 12:08:50 +03:00
parent aaa834e412
commit d96d4a2836
50 changed files with 3138 additions and 72 deletions
+15 -5
View File
@@ -40,12 +40,22 @@ def main():
alice,bob,eve,chat = c.bootstrap()
sent = c.message(alice,chat,'Сохранить при отказе')
original = sent['json']
target = sent['headers'].get('X-Instance-Id','')
target = sent['headers'].get('X-Instance-Id', '')
attachment = content = None
if LAB>=4:
attachment,content = c.attachment(alice,chat)
if LAB>=5:
attachment = c.wait_ready(alice,attachment)
if LAB >= 4:
attachment, content, upload_instance = c.attachment(alice, chat, include_instance=True)
if args.mode == 'failover':
check(bool(upload_instance), 'attachment upload response has no X-Instance-Id')
target = upload_instance
if LAB >= 5:
attachment = c.wait_ready(alice, attachment)
if args.mode == 'failover':
check(bool(target), 'target API instance ID is empty')
env = dict(os.environ)
env['TARGET_INSTANCE_ID'] = target
observed = set()