@hugoalh/github-sodium 2.0.2 → 2.0.3
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/lib/github-sodium-sealer.js +5 -5
- package/lib/github-sodium-sealer.mjs +5 -5
- package/lib/seal.js +1 -1
- package/lib/seal.mjs +1 -1
- package/package.json +7 -3
|
@@ -13,9 +13,9 @@ class GitHubSodiumSealer {
|
|
|
13
13
|
constructor(publicKey) {
|
|
14
14
|
if (!advancedDetermine.isString(publicKey, { empty: false })) {
|
|
15
15
|
throw new TypeError(`Argument \`publicKey\` must be type of string (non-empty)!`);
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
17
|
this.#publicKeyStorage = Buffer.from(publicKey, "base64");
|
|
18
|
-
}
|
|
18
|
+
}
|
|
19
19
|
/**
|
|
20
20
|
* @method
|
|
21
21
|
* @param {string} value Value that need to encrypt as secret value.
|
|
@@ -24,8 +24,8 @@ class GitHubSodiumSealer {
|
|
|
24
24
|
encrypt(value) {
|
|
25
25
|
if (!advancedDetermine.isString(value, { empty: false })) {
|
|
26
26
|
throw new TypeError(`Argument \`value\` must be type of string (non-empty)!`);
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
return Buffer.from(tweetsodium.seal(Buffer.from(value), this.#publicKeyStorage)).toString("base64");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
31
|
module.exports = GitHubSodiumSealer;
|
|
@@ -14,9 +14,9 @@ class GitHubSodiumSealer {
|
|
|
14
14
|
constructor(publicKey) {
|
|
15
15
|
if (!adIsString(publicKey, { empty: false })) {
|
|
16
16
|
throw new TypeError(`Argument \`publicKey\` must be type of string (non-empty)!`);
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
this.#publicKeyStorage = Buffer.from(publicKey, "base64");
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
20
|
/**
|
|
21
21
|
* @method
|
|
22
22
|
* @param {string} value Value that need to encrypt as secret value.
|
|
@@ -25,8 +25,8 @@ class GitHubSodiumSealer {
|
|
|
25
25
|
encrypt(value) {
|
|
26
26
|
if (!adIsString(value, { empty: false })) {
|
|
27
27
|
throw new TypeError(`Argument \`value\` must be type of string (non-empty)!`);
|
|
28
|
-
}
|
|
28
|
+
}
|
|
29
29
|
return Buffer.from(libsodium.crypto_box_seal(Buffer.from(value), this.#publicKeyStorage)).toString("base64");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
32
|
export default GitHubSodiumSealer;
|
package/lib/seal.js
CHANGED
package/lib/seal.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hugoalh/github-sodium",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "A module to provide an easier sodium for GitHub secret.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github",
|
|
@@ -24,12 +24,16 @@
|
|
|
24
24
|
"url": "git+https://github.com/hugoalh-studio/github-sodium-nodejs.git"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@hugoalh/advanced-determine": "^7.
|
|
27
|
+
"@hugoalh/advanced-determine": "^7.2.0",
|
|
28
28
|
"libsodium-wrappers": "^0.7.10",
|
|
29
29
|
"tweetsodium": "0.0.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/libsodium-wrappers": "^0.7.
|
|
32
|
+
"@types/libsodium-wrappers": "^0.7.10",
|
|
33
|
+
"@types/node": "^18.8.4",
|
|
34
|
+
"eslint": "^8.25.0",
|
|
35
|
+
"eslint-plugin-only-warn": "^1.0.3",
|
|
36
|
+
"typescript": "^4.8.4"
|
|
33
37
|
},
|
|
34
38
|
"engines": {
|
|
35
39
|
"node": ">=10.13.0"
|