streamby-core 0.24.8 → 0.24.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,8 +15,11 @@ const project_1 = require("./routes/project");
|
|
|
15
15
|
const export_1 = require("./routes/export");
|
|
16
16
|
const credential_1 = require("./routes/credential");
|
|
17
17
|
const auth_2 = require("../services/auth");
|
|
18
|
+
const encryption_1 = require("../utils/encryption");
|
|
18
19
|
function createStreamByRouter(config) {
|
|
19
20
|
const router = express_1.default.Router();
|
|
21
|
+
if (config.encrypt)
|
|
22
|
+
(0, encryption_1.setEncryptionKey)(config.encrypt);
|
|
20
23
|
(0, connectionManager_1.initConnections)(config.databases || []);
|
|
21
24
|
const adapter = config.adapter || (0, storage_1.createStorageProvider)(config.storageProviders);
|
|
22
25
|
if (config.databases) {
|
package/dist/types/index.d.ts
CHANGED
package/dist/utils/encryption.js
CHANGED
|
@@ -37,7 +37,7 @@ exports.isEncryptionKeySet = exports.decrypt = exports.encrypt = exports.setEncr
|
|
|
37
37
|
const crypto = __importStar(require("crypto"));
|
|
38
38
|
const ALGORITHM = 'aes-256-cbc';
|
|
39
39
|
const IV_LENGTH = 16; // For AES, this is always 16
|
|
40
|
-
let ENCRYPTION_KEY =
|
|
40
|
+
let ENCRYPTION_KEY = undefined;
|
|
41
41
|
const setEncryptionKey = (key) => {
|
|
42
42
|
if (key.length !== 64) { // 32 bytes * 2 hex characters per byte
|
|
43
43
|
throw new Error('Invalid encryption key length. Key must be 32 bytes (64 hexadecimal characters).');
|