Feature #43938
closedTrack last usage of API and Atom access keys
Description
Hello
As a first step toward #43881, this patch records and displays the last time each user's API key was used.
Problem:
There is currently no way to know if an API key has ever been used, or when it was last used.
This makes it impossible to identify stale or potentially compromised keys.
Proposal:
- Add a last_used_on column to the tokens table
- Update it on every successful API authentication (header, query parameter, or HTTP Basic)
- Display "Last used: X ago" / "Never used" in the account sidebar, next to the creation date
Notes:
- The update is a single UPDATE by unique index — negligible overhead per request
- Backward compatible: existing keys get null until first use
Files
