@drawbridge/drawbridge-utils 0.0.9 → 0.0.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.
- package/README.md +1 -1
- package/dist/encrypt.cjs +1 -1
- package/dist/encrypt.d.cts +1 -1
- package/dist/encrypt.d.ts +1 -1
- package/dist/encrypt.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Exports:
|
|
|
33
33
|
const { encrypt, decrypt } = require( '@drawbridge/drawbridge-utils/encrypt' );
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
Server-only because it uses Node `crypto` and reads `process.env.
|
|
36
|
+
Server-only because it uses Node `crypto` and reads `process.env.ENCRYPT_CONNECTION_SECRET`. Exposed as a sub-export so client bundles don't pull Node built-ins.
|
|
37
37
|
|
|
38
38
|
## Build & publish
|
|
39
39
|
|
package/dist/encrypt.cjs
CHANGED
|
@@ -35,7 +35,7 @@ __export(encrypt_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(encrypt_exports);
|
|
36
36
|
var import_crypto = __toESM(require("crypto"), 1);
|
|
37
37
|
var ALGORITHM = "aes-256-gcm";
|
|
38
|
-
var getKey = () => Buffer.from(process.env.
|
|
38
|
+
var getKey = () => Buffer.from(process.env.ENCRYPT_CONNECTION_SECRET, "hex");
|
|
39
39
|
var encrypt = (value) => {
|
|
40
40
|
const iv = import_crypto.default.randomBytes(12);
|
|
41
41
|
const cipher = import_crypto.default.createCipheriv(ALGORITHM, getKey(), iv);
|
package/dist/encrypt.d.cts
CHANGED
package/dist/encrypt.d.ts
CHANGED
package/dist/encrypt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// encrypt.js
|
|
2
2
|
import crypto from "crypto";
|
|
3
3
|
var ALGORITHM = "aes-256-gcm";
|
|
4
|
-
var getKey = () => Buffer.from(process.env.
|
|
4
|
+
var getKey = () => Buffer.from(process.env.ENCRYPT_CONNECTION_SECRET, "hex");
|
|
5
5
|
var encrypt = (value) => {
|
|
6
6
|
const iv = crypto.randomBytes(12);
|
|
7
7
|
const cipher = crypto.createCipheriv(ALGORITHM, getKey(), iv);
|
package/package.json
CHANGED