node-server-engine 1.3.4 → 1.3.6
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.
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write # required to push tags/commits
|
|
14
|
+
id-token: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0 # required for tagging
|
|
21
|
+
|
|
22
|
+
- name: Setup Node.js
|
|
23
|
+
uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: 20
|
|
26
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
27
|
+
|
|
28
|
+
- name: Configure git identity
|
|
29
|
+
run: |
|
|
30
|
+
git config user.name "github-actions[bot]"
|
|
31
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: npm ci
|
|
35
|
+
|
|
36
|
+
- name: Lint
|
|
37
|
+
run: npm run lint
|
|
38
|
+
|
|
39
|
+
# - name: Test
|
|
40
|
+
# run: npm run test
|
|
41
|
+
|
|
42
|
+
- name: Bump version (no git tag)
|
|
43
|
+
run: npm version patch --no-git-tag-version
|
|
44
|
+
|
|
45
|
+
- name: Push version tag only
|
|
46
|
+
run: |
|
|
47
|
+
git push origin "v$(node -p "require('./package.json').version")"
|
|
48
|
+
|
|
49
|
+
- name: Build package
|
|
50
|
+
run: npm run build --if-present
|
|
51
|
+
|
|
52
|
+
- name: Publish to npm
|
|
53
|
+
run: npm publish
|
|
54
|
+
env:
|
|
55
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -22,9 +22,9 @@ function loadTlsConfig() {
|
|
|
22
22
|
exports.tlsConfig = tlsConfig = undefined;
|
|
23
23
|
if (process.env.TLS_REQUEST_KEY || process.env.TLS_SERVER_KEY) {
|
|
24
24
|
// Fetch TLS secrets using unified utility
|
|
25
|
-
const key = (0, _.getSecretOrFile)(
|
|
26
|
-
const cert = (0, _.getSecretOrFile)(
|
|
27
|
-
const ca = (0, _.getSecretOrFile)(
|
|
25
|
+
const key = (0, _.getSecretOrFile)('TLS_SERVER_KEY');
|
|
26
|
+
const cert = (0, _.getSecretOrFile)('TLS_SERVER_CERT');
|
|
27
|
+
const ca = (0, _.getSecretOrFile)('TLS_CA');
|
|
28
28
|
|
|
29
29
|
// Passphrase is read directly from env variables
|
|
30
30
|
const passphrase = process.env.TLS_REQUEST_KEY_PASSPHRASE ?? process.env.TLS_SERVER_KEY_PASSPHRASE;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tlsConfig.js","names":["_https","_interopRequireDefault","require","_tlsConfig","_EngineError","_","tlsConfig","exports","httpsAgent","loadTlsConfig","validateTlsConfig","undefined","process","env","TLS_REQUEST_KEY","TLS_SERVER_KEY","key","getSecretOrFile","cert","
|
|
1
|
+
{"version":3,"file":"tlsConfig.js","names":["_https","_interopRequireDefault","require","_tlsConfig","_EngineError","_","tlsConfig","exports","httpsAgent","loadTlsConfig","validateTlsConfig","undefined","process","env","TLS_REQUEST_KEY","TLS_SERVER_KEY","key","getSecretOrFile","cert","ca","passphrase","TLS_REQUEST_KEY_PASSPHRASE","TLS_SERVER_KEY_PASSPHRASE","https","Agent","EngineError","message"],"sources":["../../../src/utils/tlsConfig/tlsConfig.ts"],"sourcesContent":["import https, { Agent } from 'https';\nimport { TlsConfig } from './tlsConfig.types';\nimport { validateTlsConfig } from './tlsConfig.validate';\nimport { EngineError } from 'entities/EngineError';\nimport { getSecretOrFile } from 'utils';\n\nexport let tlsConfig: undefined | TlsConfig;\nexport let httpsAgent: undefined | Agent;\n\n/**\n * Load TLS config by its environment setting (local files or GCP secrets)\n */\nexport function loadTlsConfig(): void {\n validateTlsConfig();\n tlsConfig = undefined;\n\n if (process.env.TLS_REQUEST_KEY || process.env.TLS_SERVER_KEY) {\n // Fetch TLS secrets using unified utility\n const key = getSecretOrFile('TLS_SERVER_KEY');\n const cert = getSecretOrFile('TLS_SERVER_CERT');\n const ca = getSecretOrFile('TLS_CA');\n\n // Passphrase is read directly from env variables\n const passphrase =\n process.env.TLS_REQUEST_KEY_PASSPHRASE ??\n process.env.TLS_SERVER_KEY_PASSPHRASE;\n\n tlsConfig = { key, cert, ca, passphrase } as TlsConfig;\n\n httpsAgent = new https.Agent({\n key: tlsConfig.key,\n cert: tlsConfig.cert,\n ca: tlsConfig.ca,\n passphrase: tlsConfig.passphrase\n });\n }\n\n if (!tlsConfig || !(tlsConfig.key && tlsConfig.cert && tlsConfig.ca)) {\n throw new EngineError({\n message: 'TLS environment variables are not set correctly'\n });\n }\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,CAAA,GAAAH,OAAA;AAEO,IAAII,SAAgC,GAAAC,OAAA,CAAAD,SAAA;AACpC,IAAIE,UAA6B,GAAAD,OAAA,CAAAC,UAAA;;AAExC;AACA;AACA;AACO,SAASC,aAAaA,CAAA,EAAS;EACpC,IAAAC,4BAAiB,EAAC,CAAC;EACnBH,OAAA,CAAAD,SAAA,GAAAA,SAAS,GAAGK,SAAS;EAErB,IAAIC,OAAO,CAACC,GAAG,CAACC,eAAe,IAAIF,OAAO,CAACC,GAAG,CAACE,cAAc,EAAE;IAC7D;IACA,MAAMC,GAAG,GAAG,IAAAC,iBAAe,EAAC,gBAAgB,CAAC;IAC7C,MAAMC,IAAI,GAAG,IAAAD,iBAAe,EAAC,iBAAiB,CAAC;IAC/C,MAAME,EAAE,GAAG,IAAAF,iBAAe,EAAC,QAAQ,CAAC;;IAEpC;IACA,MAAMG,UAAU,GACdR,OAAO,CAACC,GAAG,CAACQ,0BAA0B,IACtCT,OAAO,CAACC,GAAG,CAACS,yBAAyB;IAEvCf,OAAA,CAAAD,SAAA,GAAAA,SAAS,GAAG;MAAEU,GAAG;MAAEE,IAAI;MAAEC,EAAE;MAAEC;IAAW,CAAc;IAEtDb,OAAA,CAAAC,UAAA,GAAAA,UAAU,GAAG,IAAIe,cAAK,CAACC,KAAK,CAAC;MAC3BR,GAAG,EAAEV,SAAS,CAACU,GAAG;MAClBE,IAAI,EAAEZ,SAAS,CAACY,IAAI;MACpBC,EAAE,EAAEb,SAAS,CAACa,EAAE;MAChBC,UAAU,EAAEd,SAAS,CAACc;IACxB,CAAC,CAAC;EACJ;EAEA,IAAI,CAACd,SAAS,IAAI,EAAEA,SAAS,CAACU,GAAG,IAAIV,SAAS,CAACY,IAAI,IAAIZ,SAAS,CAACa,EAAE,CAAC,EAAE;IACpE,MAAM,IAAIM,wBAAW,CAAC;MACpBC,OAAO,EAAE;IACX,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-server-engine",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Framework used to develop backend services. This package ships with a lot of features to standardize the creation of services, letting you focus on the business logic.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,15 +16,9 @@ export function loadTlsConfig(): void {
|
|
|
16
16
|
|
|
17
17
|
if (process.env.TLS_REQUEST_KEY || process.env.TLS_SERVER_KEY) {
|
|
18
18
|
// Fetch TLS secrets using unified utility
|
|
19
|
-
const key = getSecretOrFile(
|
|
20
|
-
|
|
21
|
-
);
|
|
22
|
-
const cert = getSecretOrFile(
|
|
23
|
-
process.env.TLS_REQUEST_CERT ?? process.env.TLS_SERVER_CERT!
|
|
24
|
-
);
|
|
25
|
-
const ca = getSecretOrFile(
|
|
26
|
-
process.env.TLS_REQUEST_CA ?? process.env.TLS_CA!
|
|
27
|
-
);
|
|
19
|
+
const key = getSecretOrFile('TLS_SERVER_KEY');
|
|
20
|
+
const cert = getSecretOrFile('TLS_SERVER_CERT');
|
|
21
|
+
const ca = getSecretOrFile('TLS_CA');
|
|
28
22
|
|
|
29
23
|
// Passphrase is read directly from env variables
|
|
30
24
|
const passphrase =
|