-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Last Used field on API tokens #9536
Comments
This is an interesting idea. My only concern is the introduction of an additional database query, but I wonder if it can be combined somehow with the existing auth query. 🤔 |
@jeremystretch I have PR ready. It does introduce a write for each API call., so it only update once a minute.. |
Does it stil work when netbox is run in maintenance/readonly mode? |
@sdktr Any request with an API key will update the last_used field, independent of the accesslevel of the API token or state of Netbox But when reading the docs https://docs.netbox.dev/en/stable/configuration/dynamic-settings/#maintenance_mode and this comment #6219 , I think we should not update the last_used field when in maintenance mode. Thank you for pointing that out, I'll update the PR |
Closes #9536: Last Used field on API tokens
Closes #9536: Record last used time for API tokens
NetBox version
v3.2.3
Feature type
Change to existing functionality
Proposed functionality
Add a 'Last used' property to the API token
Use case
I want to know if a token is actively being used.
Database changes
Add 'Last used' field (datetime) to 'users_token'
External dependencies
No response
The text was updated successfully, but these errors were encountered: