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) {
@@ -72,6 +72,7 @@ export interface StreamByConfig {
72
72
  authProvider: AuthProvider;
73
73
  databases?: DatabaseCredential[];
74
74
  adapter?: StorageAdapter;
75
+ encrypt?: string;
75
76
  }
76
77
  export interface Auth {
77
78
  userId: string;
@@ -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 = process.env.STREAMBY_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).');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "streamby-core",
3
- "version": "0.24.8",
3
+ "version": "0.24.10",
4
4
  "description": "StreamBy middleware framework for media storage management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",