From 3f59fd4c585cd24192406c1ddd3781ab096531ec Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Sun, 23 Mar 2025 14:49:13 +0100 Subject: [PATCH] Add more usernames to the blacklist --- .../20250323134405_username_blocklist.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 rest-api/db/migrations/20250323134405_username_blocklist.sql diff --git a/rest-api/db/migrations/20250323134405_username_blocklist.sql b/rest-api/db/migrations/20250323134405_username_blocklist.sql new file mode 100644 index 0000000..8b89932 --- /dev/null +++ b/rest-api/db/migrations/20250323134405_username_blocklist.sql @@ -0,0 +1,13 @@ +-- migrate:up +ALTER TABLE internal.user + DROP CONSTRAINT username_not_blocked; + +ALTER TABLE internal.user + ADD CONSTRAINT username_not_blocked CHECK (LOWER(username) NOT IN ('admin', 'administrator', 'api', 'auth', 'blog', 'cdn', 'docs', 'help', 'login', 'logout', 'profile', 'preview', 'previews', 'register', 'settings', 'setup', 'signin', 'signup', 'support', 'test', 'www')); + +-- migrate:down +ALTER TABLE internal.user + DROP CONSTRAINT username_not_blocked; + +ALTER TABLE internal.user + ADD CONSTRAINT username_not_blocked CHECK (LOWER(username) NOT IN ('admin', 'administrator', 'api', 'auth', 'blog', 'cdn', 'docs', 'help', 'login', 'logout', 'profile', 'register', 'settings', 'setup', 'signin', 'signup', 'support', 'test', 'www')); \ No newline at end of file