feat: login_audit table, lockout settings and Login security module SQL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
bbf268e00a
commit
a0146be325
6 files changed
+74
-1
No files matched your search
@@ -0,0 +1,19 @@
|
||||
-- Co-Lite change add-admin-login-security: the admin login history.
|
||||
-- Target: `service-system`.`login_audit`. Additive only. Run once, after the release package.
|
||||
-- Lock state is derived from this table (LOGIN_FAIL rows inside the block period, after the latest
|
||||
-- LOGIN_SUCCESS / UNLOCK_RESET / PASSWORD_CHANGED); there is no stored lock flag.
|
||||
USE `service-system`;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `login_audit` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||||
`company_id` bigint NULL COMMENT 'the user''s company when the username matches a user',
|
||||
`username` varchar(191) NOT NULL,
|
||||
`datetime` datetime NOT NULL,
|
||||
`event` varchar(20) NOT NULL COMMENT 'LOGIN_SUCCESS | LOGIN_FAIL | LOGIN_LOCKED | LOGOUT | UNLOCK_RESET | PASSWORD_CHANGED',
|
||||
`ip_address` varchar(64) NULL,
|
||||
`user_agent` varchar(512) NULL,
|
||||
`message` varchar(255) NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_login_audit_username_dt` (`username`, `datetime`),
|
||||
KEY `idx_login_audit_event_dt` (`event`, `datetime`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
Reference in new issue
Block a user