Добавил TLS и защиту мессенджера для лабораторной 7
Skeleton contracts / contracts (pull_request) Blocked by required conditions

This commit is contained in:
2026-11-29 13:06:06 +03:00
parent 20afc2c790
commit d15d78efdf
100 changed files with 4067 additions and 62 deletions
+10
View File
@@ -0,0 +1,10 @@
CREATE TABLE message_idempotency (
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
idempotency_key text NOT NULL CHECK (idempotency_key ~ '^[A-Za-z0-9._:-]{1,128}$'),
request_hash bytea NOT NULL CHECK (octet_length(request_hash) = 32),
message_id uuid NOT NULL REFERENCES messages(id) ON DELETE CASCADE,
created_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (user_id, chat_id, idempotency_key)
);
CREATE INDEX message_idempotency_expiry_idx ON message_idempotency (created_at);