2FA-Reife: Recovery-Codes, Enforce-Policy für Admins, Admin-Reset
- Recovery-/Backup-Codes (8x, einmalig nutzbar) bei Aktivierung + Regenerieren; Login akzeptiert TOTP ODER Recovery-Code - Setting enforce_2fa_admins: Admins ohne 2FA werden zur Einrichtung geleitet - Admin kann 2FA eines Nutzers zurücksetzen (admin/users.php) - Schema 0003 (users.totp_backup_codes); security.php zeigt Codes & Restanzahl
This commit is contained in:
parent
dce10a8a08
commit
ba121d60e6
7 changed files with 179 additions and 12 deletions
16
updater/migrations/0003_maturity_features.sql
Normal file
16
updater/migrations/0003_maturity_features.sql
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-- Updater-Migration: Reife-Funktionen
|
||||
-- * 2FA Recovery-/Backup-Codes
|
||||
-- * API-Scopes & Rate-Limit pro Schlüssel
|
||||
-- Idempotent; "duplicate column"/"already exists" werden ignoriert.
|
||||
|
||||
ALTER TABLE `users` ADD COLUMN `totp_backup_codes` TEXT NULL;
|
||||
|
||||
ALTER TABLE `api_keys` ADD COLUMN `scope` VARCHAR(16) NOT NULL DEFAULT 'write';
|
||||
ALTER TABLE `api_keys` ADD COLUMN `rate_limit` INT NOT NULL DEFAULT 0;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `api_key_hits` (
|
||||
`id` BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
`api_key_id` INT NOT NULL,
|
||||
`hit_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
INDEX `idx_key_time` (`api_key_id`, `hit_at`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
Loading…
Add table
Add a link
Reference in a new issue