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:
co-authored by
Alex van Andel
Morgan
parent
c28870e029
commit
ceb555460e
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user