@hugoalh/github-sodium 5.0.1 → 5.0.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/README.md +53 -38
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -0
- package/package.json +23 -11
package/README.md
CHANGED
|
@@ -1,52 +1,71 @@
|
|
|
1
|
-
# GitHub Sodium (
|
|
1
|
+
# GitHub Sodium (JavaScript)
|
|
2
2
|
|
|
3
|
-
[
|
|
4
|
-
[](https://www.codefactor.io/repository/github/hugoalh-studio/github-sodium-nodejs)
|
|
3
|
+
[**⚖️** MIT](./LICENSE.md)
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
| [](https://www.npmjs.com/package/@hugoalh/github-sodium) |  |  |
|
|
5
|
+
**🗂️**
|
|
6
|
+
[](https://github.com/hugoalh-studio/github-sodium-js)
|
|
7
|
+
[](https://www.npmjs.com/package/@hugoalh/github-sodium)
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
**🆙**  ()
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
A JavaScript module to provide an easier sodium for GitHub secrets.
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
This project is based on [libsodium.js](https://github.com/jedisct1/libsodium.js) with optimization for GitHub secrets.
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
## 🎯 Target
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
- Bun ^ v1.0.0
|
|
18
|
+
- Cloudflare Workers
|
|
19
|
+
- Deno >= v1.34.0
|
|
20
|
+
> **🛡️ Require Permission**
|
|
21
|
+
>
|
|
22
|
+
> *N/A*
|
|
23
|
+
- NodeJS >= v16.13.0
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
- TypeScript >= v5.1.0 *\[Development\]*
|
|
23
|
-
- **Require Permission:** *N/A*
|
|
24
|
-
- **Domain/Registry:**
|
|
25
|
-
- [NPM](https://www.npmjs.com/package/@hugoalh/github-sodium)
|
|
26
|
-
```sh
|
|
27
|
-
bun add @hugoalh/github-sodium[@<Tag>]
|
|
28
|
-
```
|
|
29
|
-
```js
|
|
30
|
-
import ... from "@hugoalh/github-sodium[@<Tag>]";
|
|
31
|
-
```
|
|
25
|
+
## 🔰 Usage
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
### Via Installation
|
|
34
28
|
|
|
35
|
-
|
|
29
|
+
> **🎯 Supported Target**
|
|
30
|
+
>
|
|
31
|
+
> - Cloudflare Workers
|
|
32
|
+
> - NodeJS
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
1. Install via console/shell/terminal:
|
|
35
|
+
- Via NPM
|
|
36
|
+
```sh
|
|
37
|
+
npm install @hugoalh/github-sodium[@<Tag>]
|
|
38
|
+
```
|
|
39
|
+
- Via PNPM
|
|
40
|
+
```sh
|
|
41
|
+
pnpm add @hugoalh/github-sodium[@<Tag>]
|
|
42
|
+
```
|
|
43
|
+
- Via Yarn
|
|
44
|
+
```sh
|
|
45
|
+
yarn add @hugoalh/github-sodium[@<Tag>]
|
|
46
|
+
```
|
|
47
|
+
2. Import at the script (`<ScriptName>.js`):
|
|
45
48
|
```js
|
|
46
49
|
import ... from "@hugoalh/github-sodium";
|
|
47
50
|
```
|
|
51
|
+
> **ℹ️ Note**
|
|
52
|
+
>
|
|
53
|
+
> Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `package.json`](./package.json) property `exports` for available sub paths.
|
|
54
|
+
|
|
55
|
+
### Via NPM Specifier
|
|
48
56
|
|
|
49
|
-
>
|
|
57
|
+
> **🎯 Supported Target**
|
|
58
|
+
>
|
|
59
|
+
> - Bun
|
|
60
|
+
> - Deno
|
|
61
|
+
|
|
62
|
+
1. Import at the script (`<ScriptName>.js`):
|
|
63
|
+
```js
|
|
64
|
+
import ... from "npm:@hugoalh/github-sodium[@<Tag>]";
|
|
65
|
+
```
|
|
66
|
+
> **ℹ️ Note**
|
|
67
|
+
>
|
|
68
|
+
> Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `package.json`](./package.json) property `exports` for available sub paths.
|
|
50
69
|
|
|
51
70
|
## 🧩 API
|
|
52
71
|
|
|
@@ -61,13 +80,9 @@ This project is based on libsodium.js ([GitHub](https://github.com/jedisct1/libs
|
|
|
61
80
|
function seal(publicKey: string, value: string): string;
|
|
62
81
|
```
|
|
63
82
|
|
|
64
|
-
> **ℹ️ Notice:** Documentation is included inside the script file.
|
|
65
|
-
|
|
66
83
|
## ✍️ Example
|
|
67
84
|
|
|
68
85
|
- ```js
|
|
69
|
-
import { GitHubSodiumSealer } from "@hugoalh/github-sodium";
|
|
70
|
-
|
|
71
86
|
new GitHubSodiumSealer("base64-encoded-public-key").encrypt("plain-text-secret");
|
|
72
87
|
//=> "+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0="
|
|
73
88
|
```
|
package/dist/main.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
export declare class GitHubSodiumSealer {
|
|
5
5
|
#private;
|
|
6
6
|
/**
|
|
7
|
+
* Initialize GitHub sodium sealer.
|
|
7
8
|
* @param {string} publicKey Organization's or repository's public key, which need for encrypt value to secret value before create or update a secret.
|
|
8
9
|
*/
|
|
9
10
|
constructor(publicKey: string);
|
package/dist/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,kBAAkB;;IAE9B
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,kBAAkB;;IAE9B;;;OAGG;gBACS,SAAS,EAAE,MAAM;IAM7B;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAM9B;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CAGrD;AACD,eAAe,kBAAkB,CAAC;AAClC;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7D"}
|
package/dist/main.js
CHANGED
|
@@ -6,6 +6,7 @@ await libsodium.ready;
|
|
|
6
6
|
export class GitHubSodiumSealer {
|
|
7
7
|
#publicKeyBuffer;
|
|
8
8
|
/**
|
|
9
|
+
* Initialize GitHub sodium sealer.
|
|
9
10
|
* @param {string} publicKey Organization's or repository's public key, which need for encrypt value to secret value before create or update a secret.
|
|
10
11
|
*/
|
|
11
12
|
constructor(publicKey) {
|
package/package.json
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hugoalh/github-sodium",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "A module to provide an easier sodium for GitHub secrets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github",
|
|
7
7
|
"sodium"
|
|
8
8
|
],
|
|
9
|
-
"homepage": "https://github.com/hugoalh-studio/github-sodium-
|
|
9
|
+
"homepage": "https://github.com/hugoalh-studio/github-sodium-js#readme",
|
|
10
10
|
"bugs": {
|
|
11
|
-
"url": "https://github.com/hugoalh-studio/github-sodium-
|
|
11
|
+
"url": "https://github.com/hugoalh-studio/github-sodium-js/issues"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": "hugoalh",
|
|
15
|
+
"files": [
|
|
16
|
+
"asset/**",
|
|
17
|
+
"bin/**",
|
|
18
|
+
"dist/**",
|
|
19
|
+
"lib/**",
|
|
20
|
+
"LICENSE*.md",
|
|
21
|
+
"package.json",
|
|
22
|
+
"README*.md"
|
|
23
|
+
],
|
|
15
24
|
"type": "module",
|
|
16
25
|
"main": "./dist/main.js",
|
|
17
26
|
"exports": {
|
|
@@ -21,20 +30,23 @@
|
|
|
21
30
|
"types": "./dist/main.d.ts",
|
|
22
31
|
"repository": {
|
|
23
32
|
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/hugoalh-studio/github-sodium-
|
|
33
|
+
"url": "git+https://github.com/hugoalh-studio/github-sodium-js.git"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc"
|
|
25
37
|
},
|
|
26
38
|
"dependencies": {
|
|
27
|
-
"libsodium-wrappers": "
|
|
39
|
+
"libsodium-wrappers": "0.7.13"
|
|
28
40
|
},
|
|
29
41
|
"devDependencies": {
|
|
30
|
-
"@stylistic/eslint-plugin": "^1.
|
|
42
|
+
"@stylistic/eslint-plugin": "^1.7.0",
|
|
31
43
|
"@types/libsodium-wrappers": "^0.7.13",
|
|
32
|
-
"@types/node": "^20.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
34
|
-
"@typescript-eslint/parser": "^
|
|
35
|
-
"eslint": "^8.
|
|
44
|
+
"@types/node": "^20.12.2",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
46
|
+
"@typescript-eslint/parser": "^7.4.0",
|
|
47
|
+
"eslint": "^8.57.0",
|
|
36
48
|
"eslint-plugin-only-warn": "^1.1.0",
|
|
37
|
-
"typescript": "^5.
|
|
49
|
+
"typescript": "^5.4.3"
|
|
38
50
|
},
|
|
39
51
|
"engines": {
|
|
40
52
|
"node": ">=16.13.0"
|