mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-10 05:29:07 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ddd5edcfd | ||
|
|
67d47a9642 | ||
|
|
1a2153d62f | ||
|
|
d4ba45fd03 | ||
|
|
82f1035a5e |
@@ -9,7 +9,7 @@ maestro:
|
|||||||
cookie_secret: "ff7bc13823edb2ae50d248e5780bddc9d4b31c36"
|
cookie_secret: "ff7bc13823edb2ae50d248e5780bddc9d4b31c36"
|
||||||
redis_database: "1"
|
redis_database: "1"
|
||||||
platform_api_url: https://xs2hkhq07k.execute-api.us-east-1.amazonaws.com
|
platform_api_url: https://xs2hkhq07k.execute-api.us-east-1.amazonaws.com
|
||||||
storage_explorer_api_url: "http://storage-explorer-{customer}.data-apps.svc.cluster.local/api"
|
storage_explorer_api_url: "http://storage-explorer-{customer}.data-apps.svc.cluster.local:8000/api"
|
||||||
|
|
||||||
hostname: maestro.stg.dadosfera.ai
|
hostname: maestro.stg.dadosfera.ai
|
||||||
|
|
||||||
|
|||||||
+33
-28
@@ -7275,10 +7275,37 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/platform/pipelines/catalog/tables": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "PlatformApiController_getAvailableTables",
|
||||||
|
"summary": "Get all tables available",
|
||||||
|
"parameters": [],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Platform API"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/platform/pipelines/catalog/schemas": {
|
"/platform/pipelines/catalog/schemas": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "PlatformApiController_getAvailableSchemas",
|
"operationId": "PlatformApiController_getAvailableSchemas",
|
||||||
"summary": "Get available schemas",
|
"summary": "Get all schemas available",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
@@ -7305,14 +7332,17 @@
|
|||||||
"/platform/pipelines/catalog/tables/validate": {
|
"/platform/pipelines/catalog/tables/validate": {
|
||||||
"post": {
|
"post": {
|
||||||
"operationId": "PlatformApiController_validateTableAndSchema",
|
"operationId": "PlatformApiController_validateTableAndSchema",
|
||||||
"summary": "Validate Table and Schema",
|
"summary": "Validate tables and schemas",
|
||||||
"parameters": [],
|
"parameters": [],
|
||||||
"requestBody": {
|
"requestBody": {
|
||||||
"required": true,
|
"required": true,
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/components/schemas/ValidationTableDTO"
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10088,15 +10118,6 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"identifier_columns": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"destination": {
|
|
||||||
"type": "object"
|
|
||||||
},
|
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
@@ -10105,8 +10126,6 @@
|
|||||||
"name",
|
"name",
|
||||||
"columns",
|
"columns",
|
||||||
"references",
|
"references",
|
||||||
"identifier_columns",
|
|
||||||
"destination",
|
|
||||||
"type"
|
"type"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -11515,20 +11534,6 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"providers"
|
"providers"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"ValidationTableDTO": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"tables": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"tables"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+4
-5
@@ -17,7 +17,7 @@
|
|||||||
"@aws-sdk/signature-v4": "^3.370.0",
|
"@aws-sdk/signature-v4": "^3.370.0",
|
||||||
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
||||||
"@dadosfera/protospack": "2.5.3",
|
"@dadosfera/protospack": "2.5.3",
|
||||||
"@dadosfera/protospack-v2": "3.38.0-beta.27",
|
"@dadosfera/protospack-v2": "^3.38.0-beta.26",
|
||||||
"@grpc/grpc-js": "^1.9.3",
|
"@grpc/grpc-js": "^1.9.3",
|
||||||
"@grpc/proto-loader": "^0.7.9",
|
"@grpc/proto-loader": "^0.7.9",
|
||||||
"@nestjs/cli": "^9.5.0",
|
"@nestjs/cli": "^9.5.0",
|
||||||
@@ -1744,10 +1744,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@dadosfera/protospack-v2": {
|
"node_modules/@dadosfera/protospack-v2": {
|
||||||
"version": "3.38.0-beta.27",
|
"version": "3.38.0-beta.26",
|
||||||
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.38.0-beta.27.tgz",
|
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.38.0-beta.26.tgz",
|
||||||
"integrity": "sha512-lvV3g/SyPLFVfdtxoc/l1fCtl0o/X9Dv/KOdmDAXQyRJRjd3/81V83rwomp3UtI5IYGYuSbREgolH+X3aNYF7w==",
|
"integrity": "sha512-N8NS7+djLGy0wJXk00+4oupqd/wBIQ1f+YBBhK2y9x4guFXYK1KWIrPZhPj+gaU8g2KNkqKoT7SnE9PXNxlLSQ==",
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@grpc/grpc-js": "^1.9.3",
|
"@grpc/grpc-js": "^1.9.3",
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@
|
|||||||
"@aws-sdk/signature-v4": "^3.370.0",
|
"@aws-sdk/signature-v4": "^3.370.0",
|
||||||
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
||||||
"@dadosfera/protospack": "2.5.3",
|
"@dadosfera/protospack": "2.5.3",
|
||||||
"@dadosfera/protospack-v2": "3.38.0-beta.27",
|
"@dadosfera/protospack-v2": "^3.38.0-beta.26",
|
||||||
"@grpc/grpc-js": "^1.9.3",
|
"@grpc/grpc-js": "^1.9.3",
|
||||||
"@grpc/proto-loader": "^0.7.9",
|
"@grpc/proto-loader": "^0.7.9",
|
||||||
"@nestjs/cli": "^9.5.0",
|
"@nestjs/cli": "^9.5.0",
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ export class AuthController {
|
|||||||
const accessToken = req.cookies['ddf-auth'];
|
const accessToken = req.cookies['ddf-auth'];
|
||||||
const refreshToken = req.cookies['ddf-refresh-auth'];
|
const refreshToken = req.cookies['ddf-refresh-auth'];
|
||||||
const userId = req.cookies['ddf-user-id'];
|
const userId = req.cookies['ddf-user-id'];
|
||||||
const resourceHost = req.headers["host"]
|
const resourceHost = req.headers["x-original-url"] as string || "" ;
|
||||||
|
|
||||||
const hasUserSession = Boolean(accessToken) && Boolean(userId);
|
const hasUserSession = Boolean(accessToken) && Boolean(userId);
|
||||||
this.logger.info('Has User Session: ' + hasUserSession);
|
this.logger.info('Has User Session: ' + hasUserSession);
|
||||||
|
|||||||
@@ -14,13 +14,6 @@ export class TableColumns {
|
|||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
references: Column[];
|
references: Column[];
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
identifier_columns: string[];
|
|
||||||
@ApiProperty()
|
|
||||||
destination: Record<'raw' | 'qualify', {
|
|
||||||
table_name: string;
|
|
||||||
table_schema: string;
|
|
||||||
}> | null;
|
|
||||||
@ApiProperty()
|
|
||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
export class AvailableEntity {
|
export class AvailableEntity {
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import { ElasticsearchService } from '../../services/elasticsearch';
|
|||||||
import { DynamoDBService, ReferenceColumn } from '../../services/dynamodb';
|
import { DynamoDBService, ReferenceColumn } from '../../services/dynamodb';
|
||||||
import { CustomersService } from '../customers/customers.service';
|
import { CustomersService } from '../customers/customers.service';
|
||||||
import { validateCronAgainstScheduleLimit } from '../../utils/cron-validation';
|
import { validateCronAgainstScheduleLimit } from '../../utils/cron-validation';
|
||||||
import { ValidationTableDTO } from './platform-api.dto';
|
|
||||||
|
|
||||||
|
|
||||||
type ValidateTablesDTO = {
|
type ValidateTablesDTO = {
|
||||||
@@ -729,10 +728,26 @@ export class PlatformApiController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== PIPELINE VALIDATION ====================
|
// ==================== Catalog ROUTES ====================
|
||||||
|
|
||||||
|
@Get('pipelines/catalog/tables')
|
||||||
|
@ApiOperation({ summary: 'Get all tables available' })
|
||||||
|
@RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.GET)
|
||||||
|
async getAvailableTables(
|
||||||
|
@User() user: RequestUser,
|
||||||
|
@Query() query: Record<string, string>,
|
||||||
|
) {
|
||||||
|
return this.platformApiService.proxy(
|
||||||
|
'GET',
|
||||||
|
'/catalog/tables',
|
||||||
|
user,
|
||||||
|
undefined,
|
||||||
|
query,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@Get('pipelines/catalog/schemas')
|
@Get('pipelines/catalog/schemas')
|
||||||
@ApiOperation({ summary: 'Get available schemas' })
|
@ApiOperation({ summary: 'Get all schemas available' })
|
||||||
@RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.GET)
|
@RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.GET)
|
||||||
async getAvailableSchemas(
|
async getAvailableSchemas(
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@@ -740,7 +755,7 @@ export class PlatformApiController {
|
|||||||
) {
|
) {
|
||||||
return this.platformApiService.proxy(
|
return this.platformApiService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
`/catalog/schemas`,
|
'/catalog/schemas',
|
||||||
user,
|
user,
|
||||||
undefined,
|
undefined,
|
||||||
query,
|
query,
|
||||||
@@ -748,18 +763,18 @@ export class PlatformApiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Post('pipelines/catalog/tables/validate')
|
@Post('pipelines/catalog/tables/validate')
|
||||||
@ApiOperation({ summary: 'Validate Table and Schema' })
|
@ApiOperation({ summary: 'Validate tables and schemas' })
|
||||||
@RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.GET)
|
@RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.UPDATE)
|
||||||
async validateTableAndSchema(
|
async validateTableAndSchema(
|
||||||
@Body() payload: ValidationTableDTO,
|
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Query() query: Record<string, string>,
|
@Query() query: Record<string, string>,
|
||||||
|
@Body() validateTablesDto: ValidateTablesDTO[]
|
||||||
) {
|
) {
|
||||||
return this.platformApiService.proxy(
|
return this.platformApiService.proxy(
|
||||||
'POST',
|
'POST',
|
||||||
`/catalog/tables/validate`,
|
'/catalog/tables/validate',
|
||||||
user,
|
user,
|
||||||
payload,
|
validateTablesDto,
|
||||||
query,
|
query,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import { ApiProperty } from "@nestjs/swagger";
|
|
||||||
|
|
||||||
export class ValidationTableDTO {
|
|
||||||
@ApiProperty()
|
|
||||||
tables: Array<{
|
|
||||||
table_name: string;
|
|
||||||
table_schema: string;
|
|
||||||
}>
|
|
||||||
}
|
|
||||||
@@ -113,7 +113,7 @@ export class StorageExplorerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get customer-specific storage-explorer URL
|
// Get customer-specific storage-explorer URL
|
||||||
const baseUrl = STORAGE_EXPLORER_CONFIG.getUrl(user.customer_id);
|
const baseUrl = STORAGE_EXPLORER_CONFIG.getUrl(user.customer_name);
|
||||||
const url = new URL(`${baseUrl}${path}`);
|
const url = new URL(`${baseUrl}${path}`);
|
||||||
|
|
||||||
// Add query params
|
// Add query params
|
||||||
|
|||||||
Reference in New Issue
Block a user