When using a personal_access_token and ap_tokens, the lastUsed field is not being updated
What are the relevant steps to reproduce, including the version(s) of the relevant software?
Create a PAT
✗ go run cmd/cli/main.go pat create -n stuffff -d "for all the things" -e 730h -o 01J18E87D587GKK8K18MPYWER4
Check last_used
go run cmd/cli/main.go pat get
ID NAME TOKEN LASTUSEDAT EXPIRESAT
01J18GR4DJH5Q17QA5J6J4C9E1 stuffff ***************************** never 2024-07-26 06:17:43.84478 +0000 UTC
01J18GTHP3E244W8NHBGMZYTNF stuffff ***************************** never 2024-07-26 06:19:02.960658 +0000 UTC
Use the PAT in a request, and recheck last_used - it will still be never
What is the expected behavior?
LastUsedAt is updated when PAT and API tokens are used
Describe the bug or issue you're encountering
When using a personal_access_token and ap_tokens, the
lastUsed
field is not being updatedWhat are the relevant steps to reproduce, including the version(s) of the relevant software?
Create a PAT
Check
last_used
Use the PAT in a request, and recheck
last_used
- it will still benever
What is the expected behavior?
LastUsedAt
is updated when PAT and API tokens are usedCode Location
This should be updated in the auth middleware that determines if the Token is valid before the
AuthenticatedUser
is returned https://github.com/datumforge/datum/blob/main/pkg/middleware/auth/auth.go