@dynamatix/gb-schemas 0.18.0 → 0.18.2
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.
- package/index.js +0 -2
- package/package.json +1 -1
- package/utils/encryption.js +1 -1
- package/utils/index.js +1 -0
package/index.js
CHANGED
package/package.json
CHANGED
package/utils/encryption.js
CHANGED
|
@@ -7,7 +7,7 @@ const SECRET_KEY = Buffer.from(process.env.ENCRYPTION_KEY, 'hex'); // 32 bytes f
|
|
|
7
7
|
const IV_LENGTH = 16; // AES-GCM IV length
|
|
8
8
|
const EXCLUDED_COLLECTIONS = process.env.EXCLUDED_COLLECTIONS?.split(",") || []; // Excluded collections from encryption
|
|
9
9
|
|
|
10
|
-
// Encrypt an object (ignores _id and fields from excluded collections)
|
|
10
|
+
// Encrypt an object (ignores _id and fields from excluded collections).
|
|
11
11
|
export const encryptObject = (obj, collectionName) => {
|
|
12
12
|
// Skip encryption if the collection is excluded
|
|
13
13
|
if (EXCLUDED_COLLECTIONS.includes(collectionName)) {
|
package/utils/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { encryptObject, decryptObject } from './encryption.js';
|