Prepare verified laboratory 7 implementation and evidence

This commit is contained in:
rey
2026-11-17 17:32:06 +03:00
parent 20afc2c790
commit eb1b5c7b84
677 changed files with 208256 additions and 64 deletions
+6
View File
@@ -0,0 +1,6 @@
-- name: AllowLogin :one
UPDATE login_limits SET attempts=CASE WHEN started_at<=clock_timestamp()-interval '60 seconds' THEN 1 ELSE attempts+1 END,
started_at=CASE WHEN started_at<=clock_timestamp()-interval '60 seconds' THEN clock_timestamp() ELSE started_at END
WHERE bucket=$1 AND (started_at<=clock_timestamp()-interval '60 seconds' OR attempts<10) RETURNING bucket;
-- name: RehashPassword :one
UPDATE users SET password_hash=sqlc.arg(replacement) WHERE id=sqlc.arg(user_id) AND password_hash=sqlc.arg(previous) RETURNING id;