-
-
Notifications
You must be signed in to change notification settings - Fork 18
Add throttling to table row retrieval endpoints #1707
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,7 @@ import { | |
| IImportCSVFinTable, | ||
| IUpdateRowInTable, | ||
| } from './use-cases/table-use-cases.interface.js'; | ||
| import { Throttle } from '@nestjs/throttler'; | ||
|
|
||
| @UseInterceptors(SentryInterceptor) | ||
| @Timeout() | ||
|
|
@@ -187,6 +188,7 @@ export class TableController { | |
| @ApiQuery({ name: 'perPage', required: false }) | ||
| @ApiQuery({ name: 'search', required: false }) | ||
| @Timeout(TimeoutDefaults.EXTENDED) | ||
| @Throttle({ default: { limit: 300, ttl: 60000 } }) | ||
| @Get('/table/rows/:connectionId') | ||
| async findAllRows( | ||
|
Comment on lines
189
to
193
|
||
| @QueryTableName() tableName: string, | ||
|
|
@@ -249,6 +251,7 @@ export class TableController { | |
| @ApiQuery({ name: 'search', required: false }) | ||
| @UseGuards(TableReadGuard) | ||
| @Timeout(TimeoutDefaults.EXTENDED) | ||
| @Throttle({ default: { limit: 300, ttl: 60000 } }) | ||
| @HttpCode(HttpStatus.OK) | ||
| @Post('/table/rows/find/:connectionId') | ||
|
Comment on lines
252
to
256
|
||
| async findAllRowsWithBodyFilter( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throttleimport is out of the usual import grouping/order (external@nestjs/*imports are grouped at the top in other controllers). Consider movingimport { Throttle } from '@nestjs/throttler';up with the other Nest imports for consistency (e.g.,backend/src/entities/user/user.controller.ts:18).