feat: Platform Rate limiting + access token caching (#14560)

* feat: Platform Rate limiting + access token caching

* chore: changes

* chore: cleanup

* chore: remove yarnlock changes

* chore: yarnlcok

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
This commit is contained in:
Erik
2024-04-26 13:14:13 +00:00
committed by GitHub
co-authored by Alex van Andel Morgan
parent c28870e029
commit ceb555460e
14 changed files with 142 additions and 31 deletions
@@ -0,0 +1,10 @@
import { Injectable } from "@nestjs/common";
import { ThrottlerGuard } from "@nestjs/throttler";
@Injectable()
export class ThrottlerBehindProxyGuard extends ThrottlerGuard {
// TODO: adapt if required for CF / AWS / FlightControl proxying.
protected async getTracker(req: Record<string, any>): Promise<string> {
return req.ips.length ? req.ips[0] : req.ip;
}
}