FIX: Remove logs and add Authenticated

This commit is contained in:
Victor Radael
2022-07-14 17:31:12 -03:00
parent 9d10e58b1b
commit d01b0357ed
2 changed files with 12 additions and 1 deletions
-1
View File
@@ -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,
@@ -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,