Skip to content

Commit 980a6d8

Browse files
authored
improvement(db): enforce SSL everywhere where a DB connection is established (#1522)
* improvement(db): enforce SSL everywhere where a DB connection is established * remove extraneous comment
1 parent 35d857e commit 980a6d8

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

apps/sim/lib/workflows/db-helpers.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,7 @@ export async function loadWorkflowFromNormalizedTables(
150150
})
151151

152152
// Sanitize any invalid custom tools in agent blocks to prevent client crashes
153-
const { blocks: sanitizedBlocks, warnings } = sanitizeAgentToolsInBlocks(blocksMap)
154-
if (warnings.length > 0) {
155-
logger.warn(`Sanitized workflow ${workflowId} tools with ${warnings.length} warning(s)`, {
156-
warnings,
157-
})
158-
}
153+
const { blocks: sanitizedBlocks } = sanitizeAgentToolsInBlocks(blocksMap)
159154

160155
// Convert edges to the expected format
161156
const edgesArray: Edge[] = edges.map((edge) => ({

apps/sim/socket-server/database/operations.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const socketDb = drizzle(
1818
max: 25,
1919
onnotice: () => {},
2020
debug: false,
21+
ssl: 'require',
2122
}),
2223
{ schema }
2324
)

apps/sim/socket-server/rooms/manager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const db = drizzle(
1515
connect_timeout: 20,
1616
max: 5,
1717
onnotice: () => {},
18+
ssl: 'require',
1819
}),
1920
{ schema }
2021
)

packages/db/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const postgresClient = postgres(connectionString, {
1616
connect_timeout: 30,
1717
max: 80,
1818
onnotice: () => {},
19+
ssl: 'require',
1920
})
2021

2122
const drizzleClient = drizzle(postgresClient, { schema })

packages/db/scripts/migrate-deployment-versions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ const postgresClient = postgres(CONNECTION_STRING, {
123123
connect_timeout: 30,
124124
max: 10,
125125
onnotice: () => {},
126+
ssl: 'require',
126127
})
127128
const db = drizzle(postgresClient)
128129

packages/db/scripts/register-sso-provider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ const postgresClient = postgres(CONNECTION_STRING, {
147147
connect_timeout: 30,
148148
max: 10,
149149
onnotice: () => {},
150+
ssl: 'require',
150151
})
151152
const db = drizzle(postgresClient)
152153

0 commit comments

Comments
 (0)