From d01b0357ed06ce20dad77187b49bac0a1ee93271 Mon Sep 17 00:00:00 2001 From: Victor Radael Date: Thu, 14 Jul 2022 17:31:12 -0300 Subject: [PATCH] FIX: Remove logs and add Authenticated --- src/modules/connector/client.service.ts | 1 - src/modules/connector/connector.controller.ts | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/modules/connector/client.service.ts b/src/modules/connector/client.service.ts index c628b24..6400b9b 100644 --- a/src/modules/connector/client.service.ts +++ b/src/modules/connector/client.service.ts @@ -87,7 +87,6 @@ export class ConnectorClientService implements OnModuleInit { request, ), ).catch((err) => { - console.log(err.details); throw new HttpException( err.details, err.code === 6 ? HttpStatus.CONFLICT : 400, diff --git a/src/modules/connector/connector.controller.ts b/src/modules/connector/connector.controller.ts index df1a19b..5360670 100644 --- a/src/modules/connector/connector.controller.ts +++ b/src/modules/connector/connector.controller.ts @@ -25,6 +25,7 @@ import { RemoveTagDto } from './dtos/remove-tag'; import { UpdateDto } from './dtos/update'; import { UploadFileDto } from './dtos/upload-file'; import { DadosferaLogger } from 'dadosfera-logs'; +import { Authenticated } from 'src/authentication/authentication.decorator'; @ApiTags('connectors') @ApiBearerAuth() @@ -40,6 +41,7 @@ export class ConnectorController { } @Post() + @Authenticated() @ApiConsumes('multipart/form-data') @UseInterceptors(FileInterceptor('file')) async uploadConnector( @@ -57,6 +59,7 @@ export class ConnectorController { } @Post('/upload') + @Authenticated() @ApiConsumes('multipart/form-data') @UseInterceptors(FileInterceptor('file')) async uploadFile(@UploadedFile() file, @Body() { name }: UploadFileDto) { @@ -71,6 +74,7 @@ export class ConnectorController { } @Post('/multiple-connectors-upload') + @Authenticated() @ApiConsumes('multipart/form-data') @UseInterceptors(FileInterceptor('file')) async uploadConnectorsFile(@UploadedFile() file: UploadConnectorsFileDto) { @@ -84,6 +88,7 @@ export class ConnectorController { } @Get() + @Authenticated() async getAllConnectors( @Headers('dadosfera-lang') language, @Query() queries: GetAllDto, @@ -109,11 +114,13 @@ export class ConnectorController { } @Get('/tags') + @Authenticated() async getConnectorsTags() { return await this.connectorClientService.getConnectorsTags(); } @Get('/:plugin') + @Authenticated() async getConnector( @Headers('dadosfera-lang') language, @Param('plugin') plugin: string, @@ -135,6 +142,7 @@ export class ConnectorController { } @Get('/:plugin/details') + @Authenticated() async getConnectorDetails( @Headers('dadosfera-lang') language, @Param('plugin') plugin: string, @@ -156,6 +164,7 @@ export class ConnectorController { } @Put('/:plugin') + @Authenticated() @ApiConsumes('multipart/form-data') async updateConnector( @Param('plugin') plugin: string, @@ -177,6 +186,7 @@ export class ConnectorController { } @Put('/:plugin/add-tag') + @Authenticated() async addTagOnConnector( @Param('plugin') plugin: string, @Body() body: AddTagDto, @@ -203,6 +213,7 @@ export class ConnectorController { } @Put('/:plugin/remove-tag') + @Authenticated() async removeTagOnConnector( @Param('plugin') plugin: string, @Body() body: RemoveTagDto, @@ -230,6 +241,7 @@ export class ConnectorController { } @Delete('/:plugin') + @Authenticated() async deleteConnector( @Param('plugin') plugin: string, @Body() { version }: DeleteConnectorDto,