Выполнить лабораторную 7 по безопасности мессенджера

This commit is contained in:
2026-12-04 23:51:24 +03:00
parent 20afc2c790
commit 65bbf3224a
86 changed files with 6376 additions and 144 deletions
+11
View File
@@ -0,0 +1,11 @@
CREATE TABLE idempotency_keys (
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
method varchar(8) NOT NULL CHECK (method = 'POST'),
resource_path text NOT NULL,
key varchar(128) NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
request_hash char(64) NOT NULL,
response_body jsonb NOT NULL,
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
PRIMARY KEY (user_id, method, resource_path, key)
);
CREATE INDEX idempotency_expiry ON idempotency_keys(created_at);