Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions backend/src/data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ import {
OpenApiSpec,
Alert,
Session,
Connections,
ApiEndpointTest,
ApiKey,
BlockFields,
InstanceSettings,
AuthenticationConfig,
AggregateTraceDataHourly,
Attack,
Webhook,
Expand Down Expand Up @@ -51,6 +48,7 @@ import { dropArrayFields1677803493465 } from "migrations/1677803493465-drop-arra
import { removeTraceHash1678477672617 } from "migrations/1678477672617-remove-trace-hash"
import { addResourcePermsEndpoint1679174209000 } from "migrations/1679174209000-add-resource-perms-endpoint"
import { apiEndpointTokenColumns1679515538397 } from "migrations/1679515538397-api-endpoint-token-columns"
import { dropBlockFieldAuthenticationTables1679774815747 } from "migrations/1679774815747-drop-block-field-authentication-tables"

export const AppDataSource: DataSource = new DataSource({
type: "postgres",
Expand All @@ -62,12 +60,9 @@ export const AppDataSource: DataSource = new DataSource({
OpenApiSpec,
Alert,
Session,
Connections,
ApiEndpointTest,
ApiKey,
BlockFields,
InstanceSettings,
AuthenticationConfig,
AggregateTraceDataHourly,
Attack,
MetloConfig,
Expand Down Expand Up @@ -107,6 +102,7 @@ export const AppDataSource: DataSource = new DataSource({
removeTraceHash1678477672617,
addResourcePermsEndpoint1679174209000,
apiEndpointTokenColumns1679515538397,
dropBlockFieldAuthenticationTables1679774815747,
],
migrationsRun: runMigration,
logging: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { MigrationInterface, QueryRunner } from "typeorm"

export class dropBlockFieldAuthenticationTables1679774815747
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE IF EXISTS "authentication_config"`)
await queryRunner.query(`DROP TABLE IF EXISTS "block_fields"`)
await queryRunner.query(`DROP TABLE IF EXISTS "connections"`)
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE IF NOT EXISTS "authentication_config" ("uuid" uuid NOT NULL DEFAULT uuid_generate_v4(), "host" character varying NOT NULL, "authType" "public"."auth_type_enum" NOT NULL, "headerKey" character varying, "jwtUserPath" character varying, "cookieName" character varying, CONSTRAINT "PK_9b463ac4dad1b0cf46a6fad5575" PRIMARY KEY ("uuid"))`,
)
await queryRunner.query(
`CREATE TABLE IF NOT EXISTS "block_fields" ("uuid" uuid NOT NULL DEFAULT uuid_generate_v4(), "path" character varying NOT NULL, "pathRegex" character varying NOT NULL, "method" "public"."disable_rest_method_enum" NOT NULL, "host" character varying NOT NULL, "numberParams" integer NOT NULL DEFAULT '0', "disabledPaths" jsonb, CONSTRAINT "PK_af4435534e7494a34ce5330fba7" PRIMARY KEY ("uuid"))`,
)
await queryRunner.query(
`CREATE TABLE IF NOT EXISTS "connections" ("uuid" uuid NOT NULL DEFAULT uuid_generate_v4(), "connectionType" "public"."connection_type_enum" NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "name" character varying NOT NULL, "aws" jsonb, "aws_meta" jsonb, "gcp" jsonb, "gcp_meta" jsonb, CONSTRAINT "PK_fd0e765308bb2b80af73ba85de6" PRIMARY KEY ("uuid"))`,
)
}
}
21 changes: 0 additions & 21 deletions backend/src/models/authentication-config.ts

This file was deleted.

36 changes: 0 additions & 36 deletions backend/src/models/block-fields.ts

This file was deleted.

104 changes: 0 additions & 104 deletions backend/src/models/connections.ts

This file was deleted.

9 changes: 0 additions & 9 deletions backend/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ import { ApiTrace } from "models/api-trace"
import { OpenApiSpec } from "models/openapi-spec"
import { Alert } from "models/alert"
import { Session } from "models/sessions"
import { Connections } from "./connections"
import { ApiEndpointTest } from "./api-endpoint-test"
import { ApiKey } from "./keys"
import { BlockFields } from "./block-fields"
import { InstanceSettings } from "./instance-settings"
import { AuthenticationConfig } from "./authentication-config"
import { AggregateTraceDataHourly } from "./aggregate-trace-data-hourly"
import { Attack } from "./attack"
import { Webhook } from "./webhook"
Expand All @@ -23,12 +20,9 @@ export type DatabaseModel =
| OpenApiSpec
| Alert
| Session
| Connections
| ApiEndpointTest
| ApiKey
| BlockFields
| InstanceSettings
| AuthenticationConfig
| AggregateTraceDataHourly
| Attack
| Webhook
Expand All @@ -42,12 +36,9 @@ export {
OpenApiSpec,
Alert,
Session,
Connections,
ApiEndpointTest,
ApiKey,
BlockFields,
InstanceSettings,
AuthenticationConfig,
AggregateTraceDataHourly,
Attack,
Webhook,
Expand Down
Loading