From 24e8c732b8b23c86e764dcff026f7e41506e3bf4 Mon Sep 17 00:00:00 2001 From: "rodrigo.zamboni" Date: Mon, 31 Jan 2022 16:08:17 -0300 Subject: [PATCH] changing auth middleware approach --- src/middlewares/authentication.ts | 80 +++---------------- .../rest-enrichments.controller.ts | 39 +++------ .../rest-factory/rest-factory.controller.ts | 26 ++---- .../rest-inputs/rest-inputs.controller.ts | 44 +++------- .../rest-outputs/rest-outputs.controller.ts | 39 +++------ .../rest-pipelines.controller.ts | 51 ++++-------- .../rest-transformations.controller.ts | 38 +++------ src/rest/rest-user/rest-user.controller.ts | 1 - swagger.json | 2 +- 9 files changed, 79 insertions(+), 241 deletions(-) diff --git a/src/middlewares/authentication.ts b/src/middlewares/authentication.ts index 453e1d0..d8f1cc0 100644 --- a/src/middlewares/authentication.ts +++ b/src/middlewares/authentication.ts @@ -1,89 +1,27 @@ -import jwt from 'jsonwebtoken'; -// import {decode,verify} from 'jsonwebtoken' -import jwkToPem from 'jwk-to-pem'; import { Request, Response, NextFunction } from 'express'; import axios from 'axios'; import { NestMiddleware } from '@nestjs/common'; -// let pems: { [key: string]: {} }[]; - export class LoggerMiddleware implements NestMiddleware{ - - setUp = async (region: string, id: string):Promise<{ [key: string]: {} }[]> => { - const URL = `https://cognito-idp.${region}.amazonaws.com/${id}/.well-known/jwks.json`; - - try { - const response = await axios.get(URL); - if (response.status !== 200) { - throw new Error('Deu Ruim'); - } - const data = await response.data; - const { keys } = data; - - return keys.map((key: any) => { - const modulus = key.n; - const exponent = key.e; - const keyType = key.kty; - const jwk = { kty: keyType, n: modulus, e: exponent }; - const pem = jwkToPem(jwk); - const keyId = key.kid; - - return { [keyId]: pem }; - }); - - // console.log('got PEMS'); - } catch (error) { - // console.log(error); - // console.log('Error! Unable to download JWKs'); - } - }; use = async ( request: Request, response: Response, next: NextFunction ) => { - const awsRegion = process.env.AWS_REGION - ? process.env.AWS_REGION - : 'undefined'; - const awsPoolId = process.env.AWS_IDENTITY_POOL_ID - ? process.env.AWS_IDENTITY_POOL_ID - : 'undefined'; - try { - - const pems = await this.setUp(awsRegion, awsPoolId); - - const userToken = request.headers.authorization?.split(' ')[1]; - - if (userToken) { - const user: any = jwt.decode(userToken, { complete: true }); - - if (user === null) { - response.status(401).end(); - return; - } - - const { kid } = user.header; - const pem = pems.filter((item: any) => item[kid]); - const pemValue: any = pem[0][kid]; - - if (!pem) { - response.status(401).end(); - return; - } - - jwt.verify(userToken, pemValue, (err: any) => { - if (err) { - response.status(401).json(err); - return; - } - - next(); - }); + const verify_response = await axios.post( + `${process.env.DEV_URL}/user/verify`, + { "token":request.get('Authorization')} + ).then(response =>{ + if(response.data.message == "Success"){ + next() } + }) + + } catch (error) { response.status(401).send({ message: 'Authentication Failed!' }); } diff --git a/src/rest/rest-enrichments/rest-enrichments.controller.ts b/src/rest/rest-enrichments/rest-enrichments.controller.ts index c8fb833..52591d7 100644 --- a/src/rest/rest-enrichments/rest-enrichments.controller.ts +++ b/src/rest/rest-enrichments/rest-enrichments.controller.ts @@ -1,8 +1,7 @@ -import { Controller, Get, Post, Body, Patch, Param, Delete, Put } from '@nestjs/common'; +import { Controller, Get, Post, Body, Patch, Param, Delete, Put, Headers} from '@nestjs/common'; import { RestEnrichmentsService } from './rest-enrichments.service'; import { CreateRestEnrichmentDto } from './dto/create-rest-enrichment.dto'; import { UpdateRestEnrichmentDto } from './dto/update-rest-enrichment.dto'; -import { AuthenticateController } from 'src/utils/Authenticate'; import axios from 'axios'; import { ApiTags } from '@nestjs/swagger'; @@ -12,17 +11,14 @@ export class RestEnrichmentsController { constructor(private readonly restEnrichmentsService: RestEnrichmentsService) {} @Post() - async create(@Body() body: CreateRestEnrichmentDto) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async create(@Body() body: CreateRestEnrichmentDto,@Headers() headers) { const connectionResponse = await axios.post( `${process.env.DEV_URL}/enrichment`, body, { headers:{ - "Authorization":`Token ${accessToken}`, + "Authorization":headers.authorization, "Content-Type":"application/json" } } @@ -32,15 +28,13 @@ export class RestEnrichmentsController { } @Get() - async list() { - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async list(@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/enrichment`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -49,16 +43,13 @@ export class RestEnrichmentsController { } @Get(':id') - async show(@Param('id') id: string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async show(@Param('id') id: string,@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/enrichment/${id}`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -67,17 +58,14 @@ export class RestEnrichmentsController { } @Put(':id') - async update(@Param('id') id: string, @Body() body: UpdateRestEnrichmentDto) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() - + async update(@Param('id') id: string,@Headers() headers, @Body() body: UpdateRestEnrichmentDto) { + const connectionResponse = await axios.put( `${process.env.DEV_URL}/enrichment/${id}`, body, { headers:{ - "Authorization":`Token ${accessToken}`, + "Authorization":headers.authorization, "Content-Type":"application/json" } } @@ -87,16 +75,13 @@ export class RestEnrichmentsController { } @Delete(':id') - async remove(@Param('id') id: string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async remove(@Param('id') id: string,@Headers() headers) { const connectionResponse = await axios.delete( `${process.env.DEV_URL}/enrichment/${id}`, { headers:{ - "Authorization":`Token ${accessToken}`, + "Authorization":headers.authorization, "Content-Type":"application/json" } } diff --git a/src/rest/rest-factory/rest-factory.controller.ts b/src/rest/rest-factory/rest-factory.controller.ts index 11a973f..e740b36 100644 --- a/src/rest/rest-factory/rest-factory.controller.ts +++ b/src/rest/rest-factory/rest-factory.controller.ts @@ -1,8 +1,5 @@ -import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { Controller, Get, Param, Headers } from '@nestjs/common'; import { RestFactoryService } from './rest-factory.service'; -import { CreateRestFactoryDto } from './dto/create-rest-factory.dto'; -import { UpdateRestFactoryDto } from './dto/update-rest-factory.dto'; -import { AuthenticateController } from 'src/utils/Authenticate'; import axios from 'axios'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; @@ -14,16 +11,13 @@ export class RestFactoryController { @Get('/start') - async startDagFactory() { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async startDagFactory(@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/factory/start`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -33,16 +27,13 @@ export class RestFactoryController { @Get('/pipeline_params') - async sendJSONSettingsToDagFactory() { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async sendJSONSettingsToDagFactory(@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/factory/pipeline_params`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -51,16 +42,13 @@ export class RestFactoryController { } @Get('/start/:pipelineId') - async startDag(@Param('pipelineId') pipelineId:string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async startDag(@Param('pipelineId') pipelineId:string,@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/factory/start/${pipelineId}`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) diff --git a/src/rest/rest-inputs/rest-inputs.controller.ts b/src/rest/rest-inputs/rest-inputs.controller.ts index 4aaeb07..cba1835 100644 --- a/src/rest/rest-inputs/rest-inputs.controller.ts +++ b/src/rest/rest-inputs/rest-inputs.controller.ts @@ -2,7 +2,6 @@ import axios from 'axios'; require("dotenv").config(); import { RestInputsService } from './rest-inputs.service'; import { Controller, Get, Post, Body, Patch, Param, Delete, Put, Headers } from '@nestjs/common'; -import { AuthenticateController } from 'src/utils/Authenticate'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; import { CreateRestInputDto } from './dto/create-rest-input.dto'; import { UpdateRestInputDto } from './dto/update-rest-input.dto'; @@ -15,24 +14,16 @@ import { testConnectionDTO } from './dto/testConnection.dto'; export class RestInputsController { constructor(private readonly restInputsService: RestInputsService) {} - @Get('/test-auth/') - async testauth(){ - return "Auth Success" - } - @Post('/test-connection/') - async testConnection(@Body() body:testConnectionDTO){ - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async testConnection(@Body() body:testConnectionDTO,@Headers() headers){ const connectionResponse = await axios.post( `${process.env.DEV_URL}/input/test-connection`, body, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -42,17 +33,14 @@ export class RestInputsController { } @Post() - async create(@Body() body: CreateRestInputDto){ - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async create(@Body() body: CreateRestInputDto,@Headers() headers){ const connectionResponse = await axios.post( `${process.env.DEV_URL}/input`, body, { headers:{ - "Authorization":`Token ${accessToken}`, + "Authorization":headers.authorization, "Content-Type":"application/json" } } @@ -63,16 +51,13 @@ export class RestInputsController { } @Get() - async list(){ - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async list(@Headers() headers){ const connectionResponse = await axios.get( `${process.env.DEV_URL}/input`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -82,15 +67,13 @@ export class RestInputsController { } @Get('/:id') - async show(@Param() id: string){ - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async show(@Param() id: string,@Headers() headers){ const connectionResponse = await axios.get( `${process.env.DEV_URL}/input/:${id}`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -103,16 +86,15 @@ export class RestInputsController { async update( @Body() body: UpdateRestInputDto, @Param() id: string, + @Headers() headers ){ - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() const connectionResponse = await axios.put( `${process.env.DEV_URL}/input/:${id}`, body, { headers:{ - "Authorization":`Token ${accessToken}`, + "Authorization":headers.authorization, "Content-Type":"application/json" } } @@ -123,15 +105,13 @@ export class RestInputsController { } @Delete(':id') - async delete(@Param() id: string){ - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async delete(@Param() id: string,@Headers() headers){ const connectionResponse = await axios.delete( `${process.env.DEV_URL}/input/:${id}`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) diff --git a/src/rest/rest-outputs/rest-outputs.controller.ts b/src/rest/rest-outputs/rest-outputs.controller.ts index cc4e3fa..d32c209 100644 --- a/src/rest/rest-outputs/rest-outputs.controller.ts +++ b/src/rest/rest-outputs/rest-outputs.controller.ts @@ -1,8 +1,7 @@ -import { Controller, Get, Post, Body, Patch, Param, Delete, Put } from '@nestjs/common'; +import { Controller, Get, Post, Body, Headers, Param, Delete, Put } from '@nestjs/common'; import { RestOutputsService } from './rest-outputs.service'; import { CreateRestOutputDto } from './dto/create-rest-output.dto'; import { UpdateRestOutputDto } from './dto/update-rest-output.dto'; -import { AuthenticateController } from 'src/utils/Authenticate'; import axios from 'axios'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; @@ -13,17 +12,14 @@ export class RestOutputsController { constructor(private readonly restOutputsService: RestOutputsService) {} @Post() - async create(@Body() body: CreateRestOutputDto) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async create(@Body() body: CreateRestOutputDto,@Headers() headers) { const connectionResponse = await axios.post( `${process.env.DEV_URL}/output`, body, { headers:{ - "Authorization":`Token ${accessToken}`, + "Authorization":headers.authorization, "Content-Type":"application/json" } } @@ -33,15 +29,13 @@ export class RestOutputsController { } @Get() - async list() { - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async list(@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/output`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -50,16 +44,13 @@ export class RestOutputsController { } @Get(':id') - async show(@Param('id') id: string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async show(@Param('id') id: string,@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/output/${id}`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -68,17 +59,14 @@ export class RestOutputsController { } @Put(':id') - async update(@Param('id') id: string, @Body() body: UpdateRestOutputDto) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async update(@Param('id') id: string, @Body() body: UpdateRestOutputDto,@Headers() headers) { const connectionResponse = await axios.put( `${process.env.DEV_URL}/output/${id}`, body, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -87,16 +75,13 @@ export class RestOutputsController { } @Delete(':id') - async remove(@Param('id') id: string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() - + async remove(@Param('id') id: string,@Headers() headers) { + const connectionResponse = await axios.delete( `${process.env.DEV_URL}/output/${id}`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) diff --git a/src/rest/rest-pipelines/rest-pipelines.controller.ts b/src/rest/rest-pipelines/rest-pipelines.controller.ts index c791926..bce0df0 100644 --- a/src/rest/rest-pipelines/rest-pipelines.controller.ts +++ b/src/rest/rest-pipelines/rest-pipelines.controller.ts @@ -1,8 +1,7 @@ -import { Controller, Get, Post, Body, Patch, Param, Delete, Put } from '@nestjs/common'; +import { Controller, Get, Post, Body, Headers, Param, Delete, Put } from '@nestjs/common'; import { RestPipelinesService } from './rest-pipelines.service'; import { CreateRestPipelineDto } from './dto/create-rest-pipeline.dto'; import { UpdateRestPipelineDto } from './dto/update-rest-pipeline.dto'; -import { AuthenticateController } from 'src/utils/Authenticate'; import axios from 'axios'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; @@ -13,17 +12,14 @@ export class RestPipelinesController { constructor(private readonly restPipelinesService: RestPipelinesService) {} @Post() - async create(@Body() body: CreateRestPipelineDto) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async create(@Body() body: CreateRestPipelineDto,@Headers() headers) { const connectionResponse = await axios.post( `${process.env.DEV_URL}/pipeline`, body, { headers:{ - "Authorization":`Token ${accessToken}`, + "Authorization":headers.authorization, "Content-Type":"application/json" } } @@ -33,15 +29,13 @@ export class RestPipelinesController { } @Get() - async list() { - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async list(@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/pipeline`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -50,16 +44,13 @@ export class RestPipelinesController { } @Get(':id/logs/details') - async showLogs(@Param('id') id: string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async showLogs(@Param('id') id: string,@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/pipeline/${id}/logs/details`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -68,16 +59,13 @@ export class RestPipelinesController { } @Get(':id/status') - async showStatus(@Param('id') id: string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async showStatus(@Param('id') id: string,@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/pipeline/${id}/status`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -86,16 +74,13 @@ export class RestPipelinesController { } @Get(':id') - async show(@Param('id') id: string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async show(@Param('id') id: string,@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/pipeline/${id}`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -104,17 +89,14 @@ export class RestPipelinesController { } @Put(':id') - async update(@Param('id') id: string, @Body() body: UpdateRestPipelineDto) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async update(@Param('id') id: string, @Headers() headers, @Body() body: UpdateRestPipelineDto) { const connectionResponse = await axios.put( `${process.env.DEV_URL}/pipeline/${id}`, body, { headers:{ - "Authorization":`Token ${accessToken}`, + "Authorization":headers.authorization, "Content-Type":"application/json" } } @@ -124,16 +106,13 @@ export class RestPipelinesController { } @Delete(':id') - async remove(@Param('id') id: string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async remove(@Param('id') id: string,@Headers() headers) { const connectionResponse = await axios.delete( `${process.env.DEV_URL}/pipeline/${id}`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) diff --git a/src/rest/rest-transformations/rest-transformations.controller.ts b/src/rest/rest-transformations/rest-transformations.controller.ts index a8bf160..d83c0f0 100644 --- a/src/rest/rest-transformations/rest-transformations.controller.ts +++ b/src/rest/rest-transformations/rest-transformations.controller.ts @@ -1,8 +1,7 @@ -import { Controller, Get, Post, Body, Patch, Param, Delete, Put } from '@nestjs/common'; +import { Controller, Get, Post, Body, Headers, Param, Delete, Put } from '@nestjs/common'; import { RestTransformationsService } from './rest-transformations.service'; import { CreateRestTransformationDto } from './dto/create-rest-transformation.dto'; import { UpdateRestTransformationDto } from './dto/update-rest-transformation.dto'; -import { AuthenticateController } from 'src/utils/Authenticate'; import axios from 'axios'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; @@ -13,17 +12,14 @@ export class RestTransformationsController { constructor(private readonly restTransformationsService: RestTransformationsService) {} @Post() - async create(@Body() body: CreateRestTransformationDto) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async create(@Body() body: CreateRestTransformationDto,@Headers() headers) { const connectionResponse = await axios.post( `${process.env.DEV_URL}/transformation`, body, { headers:{ - "Authorization":`Token ${accessToken}`, + "Authorization":headers.authorization, "Content-Type":"application/json" } } @@ -34,16 +30,13 @@ export class RestTransformationsController { } @Get() - async list() { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async list(@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/transformation`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -53,16 +46,13 @@ export class RestTransformationsController { } @Get(':id') - async show(@Param('id') id: string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async show(@Param('id') id: string,@Headers() headers) { const connectionResponse = await axios.get( `${process.env.DEV_URL}/transformation/${id}`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) @@ -72,17 +62,14 @@ export class RestTransformationsController { } @Put(':id') - async update(@Param('id') id: string, @Body() body: UpdateRestTransformationDto) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async update(@Param('id') id: string, @Headers() headers, @Body() body: UpdateRestTransformationDto) { const connectionResponse = await axios.put( `${process.env.DEV_URL}/transformation/${id}`, body, { headers:{ - "Authorization":`Token ${accessToken}`, + "Authorization":headers.authorization, "Content-Type":"application/json" } } @@ -93,16 +80,13 @@ export class RestTransformationsController { } @Delete(':id') - async remove(@Param('id') id: string) { - - const authController = new AuthenticateController() - const accessToken = await authController.authenticate() + async remove(@Param('id') id: string,@Headers() headers) { const connectionResponse = await axios.delete( `${process.env.DEV_URL}/transformation/${id}`, { headers:{ - "Authorization":`Token ${accessToken}` + "Authorization":headers.authorization } } ) diff --git a/src/rest/rest-user/rest-user.controller.ts b/src/rest/rest-user/rest-user.controller.ts index 622e8cf..e30f5f1 100644 --- a/src/rest/rest-user/rest-user.controller.ts +++ b/src/rest/rest-user/rest-user.controller.ts @@ -2,7 +2,6 @@ import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/commo import { RestUserService } from './rest-user.service'; import { CreateRestUserDto } from './dto/create-rest-user.dto'; import { UpdateRestUserDto } from './dto/update-rest-user.dto'; -import { AuthenticateController } from 'src/utils/Authenticate'; import axios from 'axios'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; import { UserAuthDTO } from './dto/userAuth.dto'; diff --git a/swagger.json b/swagger.json index 12c84d5..aa6fe24 100644 --- a/swagger.json +++ b/swagger.json @@ -1 +1 @@ -{"openapi":"3.0.0","paths":{"/input/test-auth":{"get":{"operationId":"RestInputsController_testauth","parameters":[],"responses":{"200":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]}},"/input/test-connection":{"post":{"operationId":"RestInputsController_testConnection","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/testConnectionDTO"}}}},"responses":{"201":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]}},"/input":{"post":{"operationId":"RestInputsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestInputDto"}}}},"responses":{"201":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]},"get":{"operationId":"RestInputsController_list","parameters":[],"responses":{"200":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]}},"/input/{id}":{"get":{"operationId":"RestInputsController_show","parameters":[],"responses":{"200":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]},"put":{"operationId":"RestInputsController_update","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestInputDto"}}}},"responses":{"200":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]},"delete":{"operationId":"RestInputsController_delete","parameters":[],"responses":{"200":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]}},"/output":{"post":{"operationId":"RestOutputsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestOutputDto"}}}},"responses":{"201":{"description":""}},"tags":["Outputs"],"security":[{"bearer":[]}]},"get":{"operationId":"RestOutputsController_list","parameters":[],"responses":{"200":{"description":""}},"tags":["Outputs"],"security":[{"bearer":[]}]}},"/output/{id}":{"get":{"operationId":"RestOutputsController_show","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Outputs"],"security":[{"bearer":[]}]},"put":{"operationId":"RestOutputsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestOutputDto"}}}},"responses":{"200":{"description":""}},"tags":["Outputs"],"security":[{"bearer":[]}]},"delete":{"operationId":"RestOutputsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Outputs"],"security":[{"bearer":[]}]}},"/enrichment":{"post":{"operationId":"RestEnrichmentsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestEnrichmentDto"}}}},"responses":{"201":{"description":""}},"tags":["Enrichments"]},"get":{"operationId":"RestEnrichmentsController_list","parameters":[],"responses":{"200":{"description":""}},"tags":["Enrichments"]}},"/enrichment/{id}":{"get":{"operationId":"RestEnrichmentsController_show","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Enrichments"]},"put":{"operationId":"RestEnrichmentsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestEnrichmentDto"}}}},"responses":{"200":{"description":""}},"tags":["Enrichments"]},"delete":{"operationId":"RestEnrichmentsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Enrichments"]}},"/transformation":{"post":{"operationId":"RestTransformationsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestTransformationDto"}}}},"responses":{"201":{"description":""}},"tags":["Transformations"],"security":[{"bearer":[]}]},"get":{"operationId":"RestTransformationsController_list","parameters":[],"responses":{"200":{"description":""}},"tags":["Transformations"],"security":[{"bearer":[]}]}},"/transformation/{id}":{"get":{"operationId":"RestTransformationsController_show","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Transformations"],"security":[{"bearer":[]}]},"put":{"operationId":"RestTransformationsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestTransformationDto"}}}},"responses":{"200":{"description":""}},"tags":["Transformations"],"security":[{"bearer":[]}]},"delete":{"operationId":"RestTransformationsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Transformations"],"security":[{"bearer":[]}]}},"/pipeline":{"post":{"operationId":"RestPipelinesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestPipelineDto"}}}},"responses":{"201":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]},"get":{"operationId":"RestPipelinesController_list","parameters":[],"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]}},"/pipeline/{id}/logs/details":{"get":{"operationId":"RestPipelinesController_showLogs","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]}},"/pipeline/{id}/status":{"get":{"operationId":"RestPipelinesController_showStatus","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]}},"/pipeline/{id}":{"get":{"operationId":"RestPipelinesController_show","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]},"put":{"operationId":"RestPipelinesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestPipelineDto"}}}},"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]},"delete":{"operationId":"RestPipelinesController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]}},"/user/register":{"post":{"operationId":"RestUserController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestUserDto"}}}},"responses":{"201":{"description":""}},"tags":["Users"]}},"/user/auth":{"post":{"operationId":"RestUserController_auth","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAuthDTO"}}}},"responses":{"201":{"description":""}},"tags":["Users"]}},"/user/confirm":{"post":{"operationId":"RestUserController_confirm","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserConfirmationDTO"}}}},"responses":{"201":{"description":""}},"tags":["Users"]}},"/user/resendCode":{"post":{"operationId":"RestUserController_resendCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendCodeDTO"}}}},"responses":{"201":{"description":""}},"tags":["Users"]}},"/factory/start":{"get":{"operationId":"RestFactoryController_startDagFactory","parameters":[],"responses":{"200":{"description":""}},"tags":["Dag Factory"],"security":[{"bearer":[]}]}},"/factory/pipeline_params":{"get":{"operationId":"RestFactoryController_sendJSONSettingsToDagFactory","parameters":[],"responses":{"200":{"description":""}},"tags":["Dag Factory"],"security":[{"bearer":[]}]}},"/factory/start/{pipelineId}":{"get":{"operationId":"RestFactoryController_startDag","parameters":[{"name":"pipelineId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Dag Factory"],"security":[{"bearer":[]}]}}},"info":{"title":"Maestro Grpc Documentation","description":"Documentation for Maestro gateway","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"testConnectionDTO":{"type":"object","properties":{"plugin":{"type":"string","description":"Input Plugin Name","example":"mysql"},"values":{"type":"object","description":"Plugin name","example":{"plugin":"mysql","values":{"jdbc_user":"test","jdbc_password":"test1234","database":"users","endpoint":"dadosfera.test123.us-east-1.rds.amazonaws.com","schema":"user","port":"5432","engine":"mysql"}}}},"required":["plugin","values"]},"CronDTO":{"type":"object","properties":{"hours":{"description":"Hours to the cron","example":["3","7"],"type":"array","items":{"type":"string"}},"hour_interval":{"type":"boolean","description":"Boolean for hour interval","example":true},"hour_resourse":{"type":"boolean","description":"Boolean for hour resourse","example":true},"hour_resourse_value":{"type":"number","description":"Value for hour resourse","example":3},"month_day":{"description":"Month day to the cron","example":["3"],"type":"array","items":{"type":"string"}},"month_day_interval":{"type":"boolean","description":"Boolean for month day interval","example":true},"month_day_resourse":{"type":"boolean","description":"Boolean for month day resourse","example":false},"month_day_resourse_value":{"type":"number","description":"Value for month day resourse","example":null},"month":{"description":"Month to the cron","example":["3"],"type":"array","items":{"type":"string"}},"month_interval":{"type":"boolean","description":"Boolean from month interval","example":false},"month_resourse":{"type":"boolean","description":"Boolean from month resourse","example":false},"month_resourse_value":{"type":"number","description":"Value to month resourse","example":null},"week_days":{"description":"Week days to the cron","example":[],"type":"array","items":{"type":"string"}},"week_days_interval":{"type":"boolean","description":"Boolean for the week days","example":false},"week_days_resourse":{"type":"boolean","description":"Boolean for week day resourse","example":false},"week_days_resourse_value":{"type":"number","description":"Hours to the cron","example":null}},"required":["hours","hour_interval","hour_resourse","hour_resourse_value","month_day","month_day_interval","month_day_resourse","month_day_resourse_value","month","month_interval","month_resourse","month_resourse_value","week_days","week_days_interval","week_days_resourse","week_days_resourse_value"]},"CreateRestInputDto":{"type":"object","properties":{"cron":{"description":"Input CRON","example":{"hours":["3","7"],"hour_interval":true,"hour_resourse":true,"hour_resourse_value":3,"month_day":["3"],"month_day_interval":true,"month_day_resourse":false,"month_day_resourse_value":null,"month":["3"],"month_interval":false,"month_resourse":false,"month_resourse_value":null,"week_days":[],"week_days_interval":false,"week_days_resourse":false,"week_days_resourse_value":null},"allOf":[{"$ref":"#/components/schemas/CronDTO"}]},"name":{"type":"string","description":"Name of the input","example":"Test_Input"},"plugin":{"type":"string","description":"Plugin","example":"s3"},"values":{"type":"object","description":"Values for choosen input","example":{"jdbc_user":"user123","jdbc_password":"password123","database":"default_database","endpoint":"dadosfera-postgres-db.test123.us-east-1.rds.amazonaws.com","table":"test_table","port":"5432","engine":"postgresql"}},"operation":{"type":"string","description":"Operation name","example":"input"}},"required":["cron","name","plugin","values","operation"]},"UpdateRestInputDto":{"type":"object","properties":{"cron":{"description":"Input CRON","example":{"hours":["3","7"],"hour_interval":true,"hour_resourse":true,"hour_resourse_value":3,"month_day":["3"],"month_day_interval":true,"month_day_resourse":false,"month_day_resourse_value":null,"month":["3"],"month_interval":false,"month_resourse":false,"month_resourse_value":null,"week_days":[],"week_days_interval":false,"week_days_resourse":false,"week_days_resourse_value":null},"allOf":[{"$ref":"#/components/schemas/CronDTO"}]},"name":{"type":"string","description":"Name of the input","example":"Test_Input"},"plugin":{"type":"string","description":"Plugin","example":"s3"},"values":{"type":"object","description":"Values for choosen input","example":{"jdbc_user":"user123","jdbc_password":"password123","database":"default_database","endpoint":"dadosfera-postgres-db.test123.us-east-1.rds.amazonaws.com","table":"test_table","port":"5432","engine":"postgresql"}},"operation":{"type":"string","description":"Operation name","example":"input"}}},"CreateRestOutputDto":{"type":"object","properties":{"name":{"type":"string","description":"Output name","example":"Test Output"},"plugin":{"type":"string","description":"Plugin name","example":"Test Plugin"},"values":{"type":"object","description":"Plugin values","example":{"prefix":"test"}},"operation":{"type":"string","description":"Operation name","example":"output"}},"required":["name","plugin","values","operation"]},"UpdateRestOutputDto":{"type":"object","properties":{"name":{"type":"string","description":"Output name","example":"Test Output"},"plugin":{"type":"string","description":"Plugin name","example":"Test Plugin"},"values":{"type":"object","description":"Plugin values","example":{"prefix":"test"}},"operation":{"type":"string","description":"Operation name","example":"output"}}},"CreateRestEnrichmentDto":{"type":"object","properties":{}},"UpdateRestEnrichmentDto":{"type":"object","properties":{}},"CreateRestTransformationDto":{"type":"object","properties":{"transformations":{"type":"object","description":"Array of transformations","example":[{"type":"hide_full_name","params":[{"base_column":"full_name","column_name":"hiden_full_name"}]},{"type":"hide_cpf","params":[{"base_column":"cpf","column_name":"cpf_hashed"}]}]}},"required":["transformations"]},"UpdateRestTransformationDto":{"type":"object","properties":{"transformations":{"type":"object","description":"Array of transformations","example":[{"type":"hide_full_name","params":[{"base_column":"full_name","column_name":"hiden_full_name"}]},{"type":"hide_cpf","params":[{"base_column":"cpf","column_name":"cpf_hashed"}]}]}}},"CreateRestPipelineDto":{"type":"object","properties":{"input":{"type":"object","description":"Pipeline Input","example":{"id":"ac8f828a-708d-4f28-a5b4-0170eaf96843"}},"transformations":{"description":"Pipeline Transformations","example":[{"id":"b2579a1a-2874-47f6-b609-7568a2930468"},{"id":"6bac1a1a-3037-474f-8211-c3ceb8ea04e8"}],"type":"array","items":{"type":"string"}},"output":{"type":"object","description":"Pipeline Output","example":{"id":"06f9ce35-d9c0-4f95-a49b-c09ea00b8e48"}},"tags":{"description":"Pipeline Tags","example":[],"type":"array","items":{"type":"string"}},"name":{"type":"string","description":"Pipeline Name","example":"Dadosfera Pipeline"},"description":{"type":"string","description":"Pipeline Description","example":"Example pipeline"}},"required":["input","transformations","output","tags","name","description"]},"UpdateRestPipelineDto":{"type":"object","properties":{"input":{"type":"object","description":"Pipeline Input","example":{"id":"ac8f828a-708d-4f28-a5b4-0170eaf96843"}},"transformations":{"description":"Pipeline Transformations","example":[{"id":"b2579a1a-2874-47f6-b609-7568a2930468"},{"id":"6bac1a1a-3037-474f-8211-c3ceb8ea04e8"}],"type":"array","items":{"type":"string"}},"output":{"type":"object","description":"Pipeline Output","example":{"id":"06f9ce35-d9c0-4f95-a49b-c09ea00b8e48"}},"tags":{"description":"Pipeline Tags","example":[],"type":"array","items":{"type":"string"}},"name":{"type":"string","description":"Pipeline Name","example":"Dadosfera Pipeline"},"description":{"type":"string","description":"Pipeline Description","example":"Example pipeline"}}},"CreateRestUserDto":{"type":"object","properties":{"email":{"type":"string","description":"User Email","example":"dev@dadosfera.ai"},"password":{"type":"string","description":"User Password","example":"dadospassword123"},"username":{"type":"string","description":"User Username","example":"dev_fera"},"name":{"type":"string","description":"User name","example":"Fulano da Silva"},"customer_id":{"type":"string","description":"Customer id","example":"dadosfera"},"rules":{"type":"string","description":"User rules","example":"['admin']"}},"required":["email","password","username","name","customer_id","rules"]},"UserAuthDTO":{"type":"object","properties":{"username":{"type":"string","description":"User username","example":"dev_fera"},"password":{"type":"string","description":"User password","example":"dadospassword123"}},"required":["username","password"]},"UserConfirmationDTO":{"type":"object","properties":{"username":{"type":"string","description":"User username","example":"dev_fera"},"confirmationCode":{"type":"string","description":"Received Confirmation Code","example":"315246"}},"required":["username","confirmationCode"]},"ResendCodeDTO":{"type":"object","properties":{"username":{"type":"string","description":"User username","example":"dev_fera"}},"required":["username"]}}}} \ No newline at end of file +{"openapi":"3.0.0","paths":{"/input/test-connection":{"post":{"operationId":"RestInputsController_testConnection","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/testConnectionDTO"}}}},"responses":{"201":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]}},"/input":{"post":{"operationId":"RestInputsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestInputDto"}}}},"responses":{"201":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]},"get":{"operationId":"RestInputsController_list","parameters":[],"responses":{"200":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]}},"/input/{id}":{"get":{"operationId":"RestInputsController_show","parameters":[],"responses":{"200":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]},"put":{"operationId":"RestInputsController_update","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestInputDto"}}}},"responses":{"200":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]},"delete":{"operationId":"RestInputsController_delete","parameters":[],"responses":{"200":{"description":""}},"tags":["Inputs"],"security":[{"bearer":[]}]}},"/output":{"post":{"operationId":"RestOutputsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestOutputDto"}}}},"responses":{"201":{"description":""}},"tags":["Outputs"],"security":[{"bearer":[]}]},"get":{"operationId":"RestOutputsController_list","parameters":[],"responses":{"200":{"description":""}},"tags":["Outputs"],"security":[{"bearer":[]}]}},"/output/{id}":{"get":{"operationId":"RestOutputsController_show","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Outputs"],"security":[{"bearer":[]}]},"put":{"operationId":"RestOutputsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestOutputDto"}}}},"responses":{"200":{"description":""}},"tags":["Outputs"],"security":[{"bearer":[]}]},"delete":{"operationId":"RestOutputsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Outputs"],"security":[{"bearer":[]}]}},"/enrichment":{"post":{"operationId":"RestEnrichmentsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestEnrichmentDto"}}}},"responses":{"201":{"description":""}},"tags":["Enrichments"]},"get":{"operationId":"RestEnrichmentsController_list","parameters":[],"responses":{"200":{"description":""}},"tags":["Enrichments"]}},"/enrichment/{id}":{"get":{"operationId":"RestEnrichmentsController_show","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Enrichments"]},"put":{"operationId":"RestEnrichmentsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestEnrichmentDto"}}}},"responses":{"200":{"description":""}},"tags":["Enrichments"]},"delete":{"operationId":"RestEnrichmentsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Enrichments"]}},"/transformation":{"post":{"operationId":"RestTransformationsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestTransformationDto"}}}},"responses":{"201":{"description":""}},"tags":["Transformations"],"security":[{"bearer":[]}]},"get":{"operationId":"RestTransformationsController_list","parameters":[],"responses":{"200":{"description":""}},"tags":["Transformations"],"security":[{"bearer":[]}]}},"/transformation/{id}":{"get":{"operationId":"RestTransformationsController_show","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Transformations"],"security":[{"bearer":[]}]},"put":{"operationId":"RestTransformationsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestTransformationDto"}}}},"responses":{"200":{"description":""}},"tags":["Transformations"],"security":[{"bearer":[]}]},"delete":{"operationId":"RestTransformationsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Transformations"],"security":[{"bearer":[]}]}},"/pipeline":{"post":{"operationId":"RestPipelinesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestPipelineDto"}}}},"responses":{"201":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]},"get":{"operationId":"RestPipelinesController_list","parameters":[],"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]}},"/pipeline/{id}/logs/details":{"get":{"operationId":"RestPipelinesController_showLogs","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]}},"/pipeline/{id}/status":{"get":{"operationId":"RestPipelinesController_showStatus","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]}},"/pipeline/{id}":{"get":{"operationId":"RestPipelinesController_show","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]},"put":{"operationId":"RestPipelinesController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestPipelineDto"}}}},"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]},"delete":{"operationId":"RestPipelinesController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Pipelines"],"security":[{"bearer":[]}]}},"/user/register":{"post":{"operationId":"RestUserController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRestUserDto"}}}},"responses":{"201":{"description":""}},"tags":["Users"]}},"/user/auth":{"post":{"operationId":"RestUserController_auth","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserAuthDTO"}}}},"responses":{"201":{"description":""}},"tags":["Users"]}},"/user/confirm":{"post":{"operationId":"RestUserController_confirm","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserConfirmationDTO"}}}},"responses":{"201":{"description":""}},"tags":["Users"]}},"/user/resendCode":{"post":{"operationId":"RestUserController_resendCode","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendCodeDTO"}}}},"responses":{"201":{"description":""}},"tags":["Users"]}},"/factory/start":{"get":{"operationId":"RestFactoryController_startDagFactory","parameters":[],"responses":{"200":{"description":""}},"tags":["Dag Factory"],"security":[{"bearer":[]}]}},"/factory/pipeline_params":{"get":{"operationId":"RestFactoryController_sendJSONSettingsToDagFactory","parameters":[],"responses":{"200":{"description":""}},"tags":["Dag Factory"],"security":[{"bearer":[]}]}},"/factory/start/{pipelineId}":{"get":{"operationId":"RestFactoryController_startDag","parameters":[{"name":"pipelineId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Dag Factory"],"security":[{"bearer":[]}]}}},"info":{"title":"Maestro Grpc Documentation","description":"Documentation for Maestro gateway","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"testConnectionDTO":{"type":"object","properties":{"plugin":{"type":"string","description":"Input Plugin Name","example":"mysql"},"values":{"type":"object","description":"Plugin name","example":{"plugin":"mysql","values":{"jdbc_user":"test","jdbc_password":"test1234","database":"users","endpoint":"dadosfera.test123.us-east-1.rds.amazonaws.com","schema":"user","port":"5432","engine":"mysql"}}}},"required":["plugin","values"]},"CronDTO":{"type":"object","properties":{"hours":{"description":"Hours to the cron","example":["3","7"],"type":"array","items":{"type":"string"}},"hour_interval":{"type":"boolean","description":"Boolean for hour interval","example":true},"hour_resourse":{"type":"boolean","description":"Boolean for hour resourse","example":true},"hour_resourse_value":{"type":"number","description":"Value for hour resourse","example":3},"month_day":{"description":"Month day to the cron","example":["3"],"type":"array","items":{"type":"string"}},"month_day_interval":{"type":"boolean","description":"Boolean for month day interval","example":true},"month_day_resourse":{"type":"boolean","description":"Boolean for month day resourse","example":false},"month_day_resourse_value":{"type":"number","description":"Value for month day resourse","example":null},"month":{"description":"Month to the cron","example":["3"],"type":"array","items":{"type":"string"}},"month_interval":{"type":"boolean","description":"Boolean from month interval","example":false},"month_resourse":{"type":"boolean","description":"Boolean from month resourse","example":false},"month_resourse_value":{"type":"number","description":"Value to month resourse","example":null},"week_days":{"description":"Week days to the cron","example":[],"type":"array","items":{"type":"string"}},"week_days_interval":{"type":"boolean","description":"Boolean for the week days","example":false},"week_days_resourse":{"type":"boolean","description":"Boolean for week day resourse","example":false},"week_days_resourse_value":{"type":"number","description":"Hours to the cron","example":null}},"required":["hours","hour_interval","hour_resourse","hour_resourse_value","month_day","month_day_interval","month_day_resourse","month_day_resourse_value","month","month_interval","month_resourse","month_resourse_value","week_days","week_days_interval","week_days_resourse","week_days_resourse_value"]},"CreateRestInputDto":{"type":"object","properties":{"cron":{"description":"Input CRON","example":{"hours":["3","7"],"hour_interval":true,"hour_resourse":true,"hour_resourse_value":3,"month_day":["3"],"month_day_interval":true,"month_day_resourse":false,"month_day_resourse_value":null,"month":["3"],"month_interval":false,"month_resourse":false,"month_resourse_value":null,"week_days":[],"week_days_interval":false,"week_days_resourse":false,"week_days_resourse_value":null},"allOf":[{"$ref":"#/components/schemas/CronDTO"}]},"name":{"type":"string","description":"Name of the input","example":"Test_Input"},"plugin":{"type":"string","description":"Plugin","example":"s3"},"values":{"type":"object","description":"Values for choosen input","example":{"jdbc_user":"user123","jdbc_password":"password123","database":"default_database","endpoint":"dadosfera-postgres-db.test123.us-east-1.rds.amazonaws.com","table":"test_table","port":"5432","engine":"postgresql"}},"operation":{"type":"string","description":"Operation name","example":"input"}},"required":["cron","name","plugin","values","operation"]},"UpdateRestInputDto":{"type":"object","properties":{"cron":{"description":"Input CRON","example":{"hours":["3","7"],"hour_interval":true,"hour_resourse":true,"hour_resourse_value":3,"month_day":["3"],"month_day_interval":true,"month_day_resourse":false,"month_day_resourse_value":null,"month":["3"],"month_interval":false,"month_resourse":false,"month_resourse_value":null,"week_days":[],"week_days_interval":false,"week_days_resourse":false,"week_days_resourse_value":null},"allOf":[{"$ref":"#/components/schemas/CronDTO"}]},"name":{"type":"string","description":"Name of the input","example":"Test_Input"},"plugin":{"type":"string","description":"Plugin","example":"s3"},"values":{"type":"object","description":"Values for choosen input","example":{"jdbc_user":"user123","jdbc_password":"password123","database":"default_database","endpoint":"dadosfera-postgres-db.test123.us-east-1.rds.amazonaws.com","table":"test_table","port":"5432","engine":"postgresql"}},"operation":{"type":"string","description":"Operation name","example":"input"}}},"CreateRestOutputDto":{"type":"object","properties":{"name":{"type":"string","description":"Output name","example":"Test Output"},"plugin":{"type":"string","description":"Plugin name","example":"Test Plugin"},"values":{"type":"object","description":"Plugin values","example":{"prefix":"test"}},"operation":{"type":"string","description":"Operation name","example":"output"}},"required":["name","plugin","values","operation"]},"UpdateRestOutputDto":{"type":"object","properties":{"name":{"type":"string","description":"Output name","example":"Test Output"},"plugin":{"type":"string","description":"Plugin name","example":"Test Plugin"},"values":{"type":"object","description":"Plugin values","example":{"prefix":"test"}},"operation":{"type":"string","description":"Operation name","example":"output"}}},"CreateRestEnrichmentDto":{"type":"object","properties":{}},"UpdateRestEnrichmentDto":{"type":"object","properties":{}},"CreateRestTransformationDto":{"type":"object","properties":{"transformations":{"type":"object","description":"Array of transformations","example":[{"type":"hide_full_name","params":[{"base_column":"full_name","column_name":"hiden_full_name"}]},{"type":"hide_cpf","params":[{"base_column":"cpf","column_name":"cpf_hashed"}]}]}},"required":["transformations"]},"UpdateRestTransformationDto":{"type":"object","properties":{"transformations":{"type":"object","description":"Array of transformations","example":[{"type":"hide_full_name","params":[{"base_column":"full_name","column_name":"hiden_full_name"}]},{"type":"hide_cpf","params":[{"base_column":"cpf","column_name":"cpf_hashed"}]}]}}},"CreateRestPipelineDto":{"type":"object","properties":{"input":{"type":"object","description":"Pipeline Input","example":{"id":"ac8f828a-708d-4f28-a5b4-0170eaf96843"}},"transformations":{"description":"Pipeline Transformations","example":[{"id":"b2579a1a-2874-47f6-b609-7568a2930468"},{"id":"6bac1a1a-3037-474f-8211-c3ceb8ea04e8"}],"type":"array","items":{"type":"string"}},"output":{"type":"object","description":"Pipeline Output","example":{"id":"06f9ce35-d9c0-4f95-a49b-c09ea00b8e48"}},"tags":{"description":"Pipeline Tags","example":[],"type":"array","items":{"type":"string"}},"name":{"type":"string","description":"Pipeline Name","example":"Dadosfera Pipeline"},"description":{"type":"string","description":"Pipeline Description","example":"Example pipeline"}},"required":["input","transformations","output","tags","name","description"]},"UpdateRestPipelineDto":{"type":"object","properties":{"input":{"type":"object","description":"Pipeline Input","example":{"id":"ac8f828a-708d-4f28-a5b4-0170eaf96843"}},"transformations":{"description":"Pipeline Transformations","example":[{"id":"b2579a1a-2874-47f6-b609-7568a2930468"},{"id":"6bac1a1a-3037-474f-8211-c3ceb8ea04e8"}],"type":"array","items":{"type":"string"}},"output":{"type":"object","description":"Pipeline Output","example":{"id":"06f9ce35-d9c0-4f95-a49b-c09ea00b8e48"}},"tags":{"description":"Pipeline Tags","example":[],"type":"array","items":{"type":"string"}},"name":{"type":"string","description":"Pipeline Name","example":"Dadosfera Pipeline"},"description":{"type":"string","description":"Pipeline Description","example":"Example pipeline"}}},"CreateRestUserDto":{"type":"object","properties":{"email":{"type":"string","description":"User Email","example":"dev@dadosfera.ai"},"password":{"type":"string","description":"User Password","example":"dadospassword123"},"username":{"type":"string","description":"User Username","example":"dev_fera"},"name":{"type":"string","description":"User name","example":"Fulano da Silva"},"customer_id":{"type":"string","description":"Customer id","example":"dadosfera"},"rules":{"type":"string","description":"User rules","example":"['admin']"}},"required":["email","password","username","name","customer_id","rules"]},"UserAuthDTO":{"type":"object","properties":{"username":{"type":"string","description":"User username","example":"dev_fera"},"password":{"type":"string","description":"User password","example":"dadospassword123"}},"required":["username","password"]},"UserConfirmationDTO":{"type":"object","properties":{"username":{"type":"string","description":"User username","example":"dev_fera"},"confirmationCode":{"type":"string","description":"Received Confirmation Code","example":"315246"}},"required":["username","confirmationCode"]},"ResendCodeDTO":{"type":"object","properties":{"username":{"type":"string","description":"User username","example":"dev_fera"}},"required":["username"]}}}} \ No newline at end of file