@thefirstspine/certificate-authority 1.0.11 → 1.0.13
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 +10 -29
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Self-signed certificate authority to automate & check secure layer for protected endpoints.
|
|
4
4
|
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm i @thefirstspine/certificate-authority
|
|
9
|
-
```
|
|
10
|
-
|
|
11
5
|
## Philosophy
|
|
12
6
|
|
|
13
7
|
Here in TFS we strongly believe that services calls must be verified through private / public key pairs to ensure that the calls are from the good service: IPs are not sufficient for distributed service and DNS can be compromised.
|
|
@@ -25,7 +19,15 @@ INCOMING REQUEST REQUEST GUARD
|
|
|
25
19
|
INCOMING REQUEST REQUEST GUARD PROTECTED RESOURCE
|
|
26
20
|
```
|
|
27
21
|
|
|
28
|
-
##
|
|
22
|
+
## Service documentation
|
|
23
|
+
|
|
24
|
+
### Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm i @thefirstspine/certificate-authority
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Configuration
|
|
29
31
|
|
|
30
32
|
As part of TFS Platform, the validation service will use environment variable.
|
|
31
33
|
|
|
@@ -33,8 +35,6 @@ As part of TFS Platform, the validation service will use environment variable.
|
|
|
33
35
|
|-|-|
|
|
34
36
|
| PRIVATE_KEY | The pivate key to use to validate incoming requests |
|
|
35
37
|
|
|
36
|
-
## Service documentation
|
|
37
|
-
|
|
38
38
|
### ValidatorService
|
|
39
39
|
|
|
40
40
|
Global service to validate incoming requests. This service will use the environment variable `PRIVATE_KEY` to fetch the private key.
|
|
@@ -51,13 +51,9 @@ Challenge the certificate against the private key.
|
|
|
51
51
|
|
|
52
52
|
## CLI documentation
|
|
53
53
|
|
|
54
|
-
In order to use the CLI, the dependency should be installed globally.
|
|
55
|
-
|
|
56
|
-
### tfs-ca-generate
|
|
57
|
-
|
|
58
54
|
Generates files to be validated in the services.
|
|
59
55
|
|
|
60
|
-
Example:
|
|
56
|
+
Example: `npx @thefirstspine/certificate-authority -m=pair -k=private.key -c=public.cert`
|
|
61
57
|
|
|
62
58
|
**Options:**
|
|
63
59
|
|
|
@@ -84,18 +80,3 @@ npm run lint
|
|
|
84
80
|
```bash
|
|
85
81
|
npm publish
|
|
86
82
|
```
|
|
87
|
-
|
|
88
|
-
# How it is used in the TFS Platform?
|
|
89
|
-
|
|
90
|
-
In TFS we use GCP buckets along with Secret Manager to store these generated certificates:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
for SERVICE in arena bots
|
|
94
|
-
do
|
|
95
|
-
tfs-ca-generate --mode=pair --key=private.key --certificate=public.cert --force
|
|
96
|
-
gsutil cp public.cert gs://bucket-artefacts-eu/$SERVICE.cert
|
|
97
|
-
gcloud secrets versions add "secret-$SERVICE-private-key-eu" --data-file=private.key
|
|
98
|
-
done
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
These generated pairs are copied & loaded during the build to ensure that there is no human access to these credentials. Moreover, all the credentials are updated in the Appengines every day at 2:00 AM UTC and stored in environement variables.
|
package/lib/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/commands/generate.command.ts","../src/commands/generate.ts","../src/service/validator.service.ts"],"version":"5.
|
|
1
|
+
{"root":["../src/index.ts","../src/commands/generate.command.ts","../src/commands/generate.ts","../src/service/validator.service.ts"],"version":"5.9.2"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thefirstspine/certificate-authority",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "Self-signed certificate authority to automate & check secure layer for protected endpoints.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"minimist": "^1.2.8"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@types/node": "^
|
|
14
|
+
"@types/node": "^24.5.2",
|
|
15
15
|
"eslint": "^9.9.1",
|
|
16
|
-
"jest": "^
|
|
16
|
+
"jest": "^30.1.3",
|
|
17
17
|
"rimraf": "^6.0.1",
|
|
18
|
-
"ts-jest": "^29.
|
|
19
|
-
"typescript": "^5.
|
|
18
|
+
"ts-jest": "^29.4.4",
|
|
19
|
+
"typescript": "^5.9.2"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "rimraf ./lib && tsc -b",
|