Implement lab4 grade 3: private S3 attachments and persistence checks

This commit is contained in:
2026-11-16 15:25:12 +03:00
parent ec540a1a72
commit 586b142ace
48 changed files with 2458 additions and 14 deletions
+12
View File
@@ -0,0 +1,12 @@
-- Additive migration: old lab2 tables and rows are unchanged.
-- This table is only for POST /chats/{chat_id}/messages; method/path scope is implicit.
CREATE TABLE message_requests (
actor_id uuid NOT NULL REFERENCES users(id),
chat_id uuid NOT NULL REFERENCES chats(id),
key text NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
fingerprint text NOT NULL,
response jsonb NOT NULL,
expires_at timestamptz NOT NULL,
PRIMARY KEY (actor_id, chat_id, key)
);
CREATE INDEX message_requests_expiry ON message_requests(expires_at);