chore: apply ThrottlerBehindProxyGuard across controllers (#5746)
This commit is contained in:
parent
67dff5fe0f
commit
212b15890e
4 changed files with 20 additions and 3 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import { Controller, Get } from '@nestjs/common';
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import { ThrottlerBehindProxyGuard } from './guards/throttler-behind-proxy.guard';
|
||||
|
||||
@Controller('ping')
|
||||
@UseGuards(ThrottlerBehindProxyGuard)
|
||||
export class AppController {
|
||||
@Get()
|
||||
ping(): string {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
import { Controller, Get } from '@nestjs/common';
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import {
|
||||
HealthCheck,
|
||||
HealthCheckService,
|
||||
PrismaHealthIndicator,
|
||||
} from '@nestjs/terminus';
|
||||
import { ThrottlerBehindProxyGuard } from 'src/guards/throttler-behind-proxy.guard';
|
||||
import { PrismaService } from 'src/prisma/prisma.service';
|
||||
|
||||
@Controller('health')
|
||||
@UseGuards(ThrottlerBehindProxyGuard)
|
||||
export class HealthController {
|
||||
constructor(
|
||||
private health: HealthCheckService,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,12 @@
|
|||
import { Body, Controller, Get, HttpStatus, Post, Query } from '@nestjs/common';
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
HttpStatus,
|
||||
Post,
|
||||
Query,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { InfraConfigService } from './infra-config.service';
|
||||
import { RESTError } from 'src/types/RESTError';
|
||||
import { throwHTTPErr } from 'src/utils';
|
||||
|
|
@ -11,8 +19,10 @@ import {
|
|||
} from './dto/onboarding.dto';
|
||||
import { ApiCreatedResponse, ApiOkResponse } from '@nestjs/swagger';
|
||||
import { plainToInstance } from 'class-transformer';
|
||||
import { ThrottlerBehindProxyGuard } from 'src/guards/throttler-behind-proxy.guard';
|
||||
|
||||
@Controller({ path: 'onboarding', version: '1' })
|
||||
@UseGuards(ThrottlerBehindProxyGuard)
|
||||
export class OnboardingController {
|
||||
constructor(private infraConfigService: InfraConfigService) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import {
|
|||
Query,
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
|
||||
import { PublishedDocsService } from './published-docs.service';
|
||||
|
|
@ -12,9 +13,11 @@ import { GetPublishedDocsQueryDto } from './published-docs.dto';
|
|||
import * as E from 'fp-ts/Either';
|
||||
import { throwHTTPErr } from 'src/utils';
|
||||
import { PublishedDocs } from './published-docs.model';
|
||||
import { ThrottlerBehindProxyGuard } from 'src/guards/throttler-behind-proxy.guard';
|
||||
|
||||
@ApiTags('Published Docs')
|
||||
@Controller({ version: '1', path: 'published-docs' })
|
||||
@UseGuards(ThrottlerBehindProxyGuard)
|
||||
export class PublishedDocsController {
|
||||
constructor(private readonly publishedDocsService: PublishedDocsService) {}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue