Project

General

Profile

Actions

Feature #43938

open

Track last usage of API access keys

Added by Vincent Robert about 16 hours ago. Updated about 12 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Resolution:

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


Related issues

Related to Redmine - Feature #43881: Strengthen API authentication: API tokens with expiration, scopes, rate limiting and audit loggingNewActions
Actions

Also available in: Atom PDF