feat: Move user-import, token, and event cleanup to housekeeping - #545
Merged
hellopablo merged 3 commits intoSep 16, 2026
Merged
Conversation
Preserve import reap semantics with item-level logs, add reapers for expired access and legacy 2FA tokens, and rotate user events after 730 days (0 disables it). Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit 33b1e2c)
Cron was the only caller, and that task is already gone. Run Nails\Auth\Housekeeping\UserImports through housekeeping:run. Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit 948da26)
AUTH_USER_EVENT_RETENTION_DAYS is off unless the app sets it. A two-year window is an app policy, not a module default. Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit b6b4ead)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
feature/pre-new-admin.Nails\Auth\Housekeeping\UserImportskeeps the three-step import cleaner (release stale claims, reap drafts, rotate finished jobs) with item-level audit logs and dry-run.auth:user:import:processis untouched.Nails\Auth\Housekeeping\AccessTokensdeletes expired API access tokens (@daily). Logsid,user_id,expires— not the token secret.Nails\Auth\Housekeeping\TwoFactorTokensdeletes expired legacy 2FA rows fromuser_auth_two_factor_token(*/15 * * * *). Logsid,user_id,expires— nottoken/salt.Nails\Auth\Housekeeping\UserEventsdeletesuser_eventrows older thanAUTH_USER_EVENT_RETENTION_DAYS. Unset or0disables deletion (no module default). Runs@daily.auth:user:import:clean(cron task and console command). Run on demand withhousekeeping:run --routine=….nails/module-housekeeping: dev-feature/pre-new-admin.Test plan
composer analyse/composer testnails housekeeping:listshows UserImports, AccessTokens, TwoFactorTokens, UserEventsRELEASE/DELETElines, no writesAUTH_USER_EVENT_RETENTION_DAYS, UserEvents logsDISABLEDand processes 0nails auth:user:import:cleanis goneMade with Cursor