1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-27 11:02:16 +01:00

chore: better logging of failed tokens (#10425)

When querying invalid tokens we might catch them for a while to reduce
database load. Being able to identify the token can help understanding
what's going on or the client using that token

Log looks like:
```
[INFO] /services/api-token-service.ts - Token default:development.3ef3... rate limited until: Tue Jul 29 2025 09:53:47 GMT+0000 (Coordinated Universal Time)
```
This commit is contained in:
Gastón Fournier 2025-07-29 12:48:41 +02:00 committed by GitHub
parent d48d1df095
commit 7479720f58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -171,9 +171,10 @@ export class ApiTokenService {
stopCacheTimer(); stopCacheTimer();
} else { } else {
this.logger.info( this.logger.info(
`Not allowed to query this token until: ${this.queryAfter.get( `Token ${secret.replace(
secret, /^([^.]*)\.(.{8}).*$/,
)}`, '$1.$2...',
)} rate limited until: ${this.queryAfter.get(secret)}`,
); );
} }
} }