Лабораторная 7: безопасность, mTLS и OpenBao, оценка 3

This commit is contained in:
Nurlygayanova Ekaterina
2026-11-13 12:41:35 +03:00
parent 20afc2c790
commit 4408471ed5
217 changed files with 21288 additions and 106 deletions
+22
View File
@@ -0,0 +1,22 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE users (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
username text NOT NULL,
display_name text NOT NULL,
-- Строка password KDF (Argon2id/scrypt) вместе с солью и параметрами; никогда не отдаётся в API.
password_hash text NOT NULL,
created_at timestamptz NOT NULL DEFAULT now(),
CONSTRAINT users_username_key UNIQUE (username),
CONSTRAINT users_username_format CHECK (username ~ '^[a-z0-9_]{3,32}$'),
CONSTRAINT users_display_name_len CHECK (char_length(display_name) BETWEEN 1 AND 100
AND btrim(display_name) <> ''),
CONSTRAINT users_password_hash_not_empty CHECK (password_hash <> '')
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS users;
-- +goose StatementEnd