From 7d984d8faf2d465c8c83e141d6e8dbdd9a1e25fd Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Mon, 20 May 2024 19:48:21 +0200 Subject: [PATCH] feat(mjs): added crypto imports --- integration-tests/__tests__/alter-table.spec.js | 1 + packages/api/src/controllers/archive.js | 1 + packages/api/src/controllers/auth.js | 1 + packages/api/src/controllers/databaseConnections.js | 1 + packages/api/src/controllers/files.js | 1 + packages/api/src/controllers/runners.js | 1 + packages/api/src/controllers/sessions.js | 1 + packages/api/src/controllers/uploads.js | 1 + packages/api/src/proc/sessionProcess.js | 1 + packages/api/src/shell/download.js | 1 + packages/api/src/utility/DatastoreProxy.js | 1 + packages/api/src/utility/JsonLinesDatabase.js | 1 + packages/api/src/utility/JsonLinesDatastore.js | 1 + packages/api/src/utility/downloadPackage.js | 1 + packages/api/src/utility/sshTunnelProxy.js | 1 + 15 files changed, 15 insertions(+) diff --git a/integration-tests/__tests__/alter-table.spec.js b/integration-tests/__tests__/alter-table.spec.js index c671e7c3..7b6f1e0b 100644 --- a/integration-tests/__tests__/alter-table.spec.js +++ b/integration-tests/__tests__/alter-table.spec.js @@ -3,6 +3,7 @@ const _ = require('lodash'); const fp = require('lodash/fp'); const { testWrapper } = require('../tools'); const engines = require('../engines'); +const crypto = require('crypto'); const { getAlterTableScript, extendDatabaseInfo, generateDbPairingId } = require('dbgate-tools'); function pickImportantTableInfo(table) { diff --git a/packages/api/src/controllers/archive.js b/packages/api/src/controllers/archive.js index 4a6b94e2..75cc39ea 100644 --- a/packages/api/src/controllers/archive.js +++ b/packages/api/src/controllers/archive.js @@ -1,5 +1,6 @@ const fs = require('fs-extra'); const readline = require('readline'); +const crypto = require('crypto'); const path = require('path'); const { archivedir, clearArchiveLinksCache, resolveArchiveFolder } = require('../utility/directories'); const socket = require('../utility/socket'); diff --git a/packages/api/src/controllers/auth.js b/packages/api/src/controllers/auth.js index 7092ed97..bf5b84a1 100644 --- a/packages/api/src/controllers/auth.js +++ b/packages/api/src/controllers/auth.js @@ -4,6 +4,7 @@ const getExpressPath = require('../utility/getExpressPath'); const { getLogins } = require('../utility/hasPermission'); const { getLogger } = require('dbgate-tools'); const AD = require('activedirectory2').promiseWrapper; +const crypto = require('crypto'); const logger = getLogger('auth'); diff --git a/packages/api/src/controllers/databaseConnections.js b/packages/api/src/controllers/databaseConnections.js index 396288ac..65f9fbd2 100644 --- a/packages/api/src/controllers/databaseConnections.js +++ b/packages/api/src/controllers/databaseConnections.js @@ -29,6 +29,7 @@ const processArgs = require('../utility/processArgs'); const { testConnectionPermission } = require('../utility/hasPermission'); const { MissingCredentialsError } = require('../utility/exceptions'); const pipeForkLogs = require('../utility/pipeForkLogs'); +const crypto = require('crypto'); const logger = getLogger('databaseConnections'); diff --git a/packages/api/src/controllers/files.js b/packages/api/src/controllers/files.js index cbfc1364..49ec040c 100644 --- a/packages/api/src/controllers/files.js +++ b/packages/api/src/controllers/files.js @@ -1,5 +1,6 @@ const fs = require('fs-extra'); const path = require('path'); +const crypto = require('crypto'); const { filesdir, archivedir, resolveArchiveFolder, uploadsdir, appdir } = require('../utility/directories'); const getChartExport = require('../utility/getChartExport'); const { hasPermission } = require('../utility/hasPermission'); diff --git a/packages/api/src/controllers/runners.js b/packages/api/src/controllers/runners.js index 75cc3144..114351bc 100644 --- a/packages/api/src/controllers/runners.js +++ b/packages/api/src/controllers/runners.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); const _ = require('lodash'); const path = require('path'); const fs = require('fs-extra'); diff --git a/packages/api/src/controllers/sessions.js b/packages/api/src/controllers/sessions.js index 9499b173..883297d2 100644 --- a/packages/api/src/controllers/sessions.js +++ b/packages/api/src/controllers/sessions.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); const _ = require('lodash'); const connections = require('./connections'); const socket = require('../utility/socket'); diff --git a/packages/api/src/controllers/uploads.js b/packages/api/src/controllers/uploads.js index 18be8355..05964946 100644 --- a/packages/api/src/controllers/uploads.js +++ b/packages/api/src/controllers/uploads.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); const path = require('path'); const { uploadsdir } = require('../utility/directories'); const { getLogger } = require('dbgate-tools'); diff --git a/packages/api/src/proc/sessionProcess.js b/packages/api/src/proc/sessionProcess.js index fb33b248..2f197504 100644 --- a/packages/api/src/proc/sessionProcess.js +++ b/packages/api/src/proc/sessionProcess.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); const path = require('path'); const fs = require('fs'); const _ = require('lodash'); diff --git a/packages/api/src/shell/download.js b/packages/api/src/shell/download.js index d8ad8237..888b8a60 100644 --- a/packages/api/src/shell/download.js +++ b/packages/api/src/shell/download.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); const path = require('path'); const { uploadsdir } = require('../utility/directories'); const { downloadFile } = require('../utility/downloader'); diff --git a/packages/api/src/utility/DatastoreProxy.js b/packages/api/src/utility/DatastoreProxy.js index 6c39fe29..748f1f86 100644 --- a/packages/api/src/utility/DatastoreProxy.js +++ b/packages/api/src/utility/DatastoreProxy.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); const { fork } = require('child_process'); const { handleProcessCommunication } = require('./processComm'); const processArgs = require('../utility/processArgs'); diff --git a/packages/api/src/utility/JsonLinesDatabase.js b/packages/api/src/utility/JsonLinesDatabase.js index 87484961..0528b4b3 100644 --- a/packages/api/src/utility/JsonLinesDatabase.js +++ b/packages/api/src/utility/JsonLinesDatabase.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); const AsyncLock = require('async-lock'); const fs = require('fs-extra'); diff --git a/packages/api/src/utility/JsonLinesDatastore.js b/packages/api/src/utility/JsonLinesDatastore.js index 4854a485..99c12cbf 100644 --- a/packages/api/src/utility/JsonLinesDatastore.js +++ b/packages/api/src/utility/JsonLinesDatastore.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); const fs = require('fs'); const os = require('os'); const rimraf = require('rimraf'); diff --git a/packages/api/src/utility/downloadPackage.js b/packages/api/src/utility/downloadPackage.js index ea895aec..60fb9002 100644 --- a/packages/api/src/utility/downloadPackage.js +++ b/packages/api/src/utility/downloadPackage.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); // const pacote = require('pacote'); const axios = require('axios'); // const tarballExtract = require('tarball-extract'); diff --git a/packages/api/src/utility/sshTunnelProxy.js b/packages/api/src/utility/sshTunnelProxy.js index f63bcfd8..b848ac78 100644 --- a/packages/api/src/utility/sshTunnelProxy.js +++ b/packages/api/src/utility/sshTunnelProxy.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); const { getLogger } = require('dbgate-tools'); const { getSshTunnel } = require('./sshTunnel'); const logger = getLogger('sshTunnelProxy');