Skip to content

Commit a9c11bc

Browse files
committed
chore(security): minor updates
1 parent c4f50c8 commit a9c11bc

File tree

13 files changed

+588
-561
lines changed

13 files changed

+588
-561
lines changed

.eslintrc.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ overrides:
5050
ecmaVersion: 2020
5151
project: ./**/tsconfig.*
5252
rules:
53+
prettier/prettier: off
5354
'@typescript-eslint/naming-convention':
5455
[
5556
error,
5657
{ selector: default, format: [camelCase] },
58+
{ selector: import, modifiers: [default], format: null },
5759
{ selector: objectLiteralProperty, format: null },
5860
{ selector: enumMember, format: [PascalCase] },
5961
{ selector: typeProperty, format: null },
@@ -63,6 +65,7 @@ overrides:
6365
format: [camelCase, UPPER_CASE],
6466
leadingUnderscore: allow,
6567
},
68+
{ selector: variable, modifiers: [destructured], format: null },
6669
{
6770
selector: parameter,
6871
format: [camelCase],
@@ -77,8 +80,9 @@ overrides:
7780
},
7881

7982
{ selector: typeLike, format: [PascalCase] },
83+
{ selector: parameter, modifiers: [destructured], format: null },
8084
]
81-
'@typescript-eslint/restrict-template-expressions': off
85+
'@typescript-eslint/restrict-template-expressions': 0
8286
'@typescript-eslint/no-shadow': warn
8387
'@typescript-eslint/no-unused-vars':
8488
[
@@ -114,6 +118,7 @@ rules:
114118
*/
115119
onNonMatchingHeader: append
116120
nonMatchingTolerance: 0.7
121+
'@typescript-eslint/no-shadow': [warn, { allow: [_] }]
117122
sonarjs/no-duplicate-string: [warn, { threshold: 5 }]
118123
sonarjs/cognitive-complexity: warn
119124
eslint-comments/no-unused-disable: off
@@ -126,14 +131,24 @@ rules:
126131
eslint-comments/no-use: off
127132
no-secrets/no-secrets: [error, { tolerance: 5 }]
128133
no-empty-label: off
129-
no-warning-comments: off
134+
no-warning-comments: 0
130135
node/no-missing-import: off
131136
import/no-unresolved: off
132137
unicorn/prefer-spread: off
138+
unicorn/prevent-abbreviations:
139+
- warn
140+
- replacements:
141+
db: false
142+
req: false
143+
res: false
144+
err: false
145+
doc: false
146+
docs: false
133147
no-constructor-bind/no-constructor-bind: error
134148
no-constructor-bind/no-constructor-state: error
135149
sort-imports: [warn, { allowSeparatedGroups: true }]
136150
ava/no-ignored-test-files: off
137151
ava/no-import-test-files: off
138152
ava/no-skip-test: warn
139153
ava/no-skip-assert: warn
154+
ava/use-test: off

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
updates:
3-
- package-ecosystem: 'github-actions'
4-
directory: '/'
3+
- package-ecosystem: github-actions
4+
directory: /
55
schedule:
6-
interval: 'daily'
6+
interval: daily

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: 'CodeQL'
12+
name: CodeQL
1313

1414
on:
1515
push:
@@ -18,7 +18,7 @@ on:
1818
# The branches below must be a subset of the branches above
1919
branches: [master]
2020
schedule:
21-
- cron: '25 20 * * 4'
21+
- cron: 25 20 * * 4
2222

2323
jobs:
2424
analyze:
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
language: ['javascript']
31+
language: [javascript]
3232
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
3333
# Learn more:
3434
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,6 @@ dist
153153
.yarn/*
154154
!.yarn/releases
155155
!.yarn/plugins
156+
!.yarn/patches
156157
!.yarn/versions
157158
.pnp.*

.yarn/releases/yarn-4.2.2.cjs renamed to .yarn/releases/yarn-4.3.1.cjs

Lines changed: 313 additions & 313 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ packageExtensions:
44
pkg-conf: ^3.0.0
55
chalk@5.0.1:
66
dependencies:
7-
"#ansi-styles": "npm:ansi-styles@6.1.0"
8-
"#supports-color": "npm:supports-color@9.2.2"
7+
"#ansi-styles": npm:ansi-styles@6.1.0
8+
"#supports-color": npm:supports-color@9.2.2
99

10-
yarnPath: .yarn/releases/yarn-4.2.2.cjs
10+
yarnPath: .yarn/releases/yarn-4.3.1.cjs

package.json

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trellisfw/monitor",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"description": "A Trellis microservice to respond to monitor pings, spawn and check things internally, and respond with success or fail",
55
"main": "dist/index.js",
66
"type": "module",
@@ -36,15 +36,15 @@
3636
"dependencies": {
3737
"@oada/client": "5.1.0",
3838
"convict": "^6.2.4",
39-
"debug": "^4.3.4",
39+
"debug": "^4.3.5",
4040
"dotenv": "^16.4.5",
4141
"express": "^4.19.2",
4242
"ksuid": "^3.0.0",
43-
"micromatch": "^4.0.5",
43+
"micromatch": "^4.0.7",
4444
"moment": "^2.30.1",
4545
"node-cron": "^3.0.3",
4646
"tiny-json-http": "^7.5.1",
47-
"tslib": "^2.6.2"
47+
"tslib": "^2.6.3"
4848
},
4949
"devDependencies": {
5050
"@ava/typescript": "^5.0.0",
@@ -53,14 +53,14 @@
5353
"@types/convict": "^6.1.6",
5454
"@types/debug": "^4.1.12",
5555
"@types/express": "^4.17.21",
56-
"@types/micromatch": "^4.0.7",
57-
"@types/node": "20.12.12",
56+
"@types/micromatch": "^4.0.9",
57+
"@types/node": "20.14.11",
5858
"@types/node-cron": "^3.0.11",
5959
"@types/sinonjs__fake-timers": "^8.1.5",
6060
"@types/tiny-json-http": "^7.3.4",
61-
"@typescript-eslint/eslint-plugin": "^7.10.0",
62-
"@typescript-eslint/parser": "^7.10.0",
63-
"@yarnpkg/sdks": "^3.1.2",
61+
"@typescript-eslint/eslint-plugin": "^7.16.1",
62+
"@typescript-eslint/parser": "^7.16.1",
63+
"@yarnpkg/sdks": "^3.1.3",
6464
"ava": "6.1.3",
6565
"ava-nock": "^2.1.0",
6666
"cross-env": "^7.0.3",
@@ -75,28 +75,31 @@
7575
"eslint-plugin-escompat": "^3.4.0",
7676
"eslint-plugin-eslint-comments": "^3.2.0",
7777
"eslint-plugin-filenames": "^1.3.2",
78-
"eslint-plugin-github": "^5.0.0-2",
78+
"eslint-plugin-github": "^5.0.1",
7979
"eslint-plugin-i18n-text": "^1.0.1",
8080
"eslint-plugin-import": "^2.29.1",
8181
"eslint-plugin-no-constructor-bind": "^2.0.4",
8282
"eslint-plugin-no-only-tests": "^3.1.0",
8383
"eslint-plugin-no-secrets": "^1.0.2",
8484
"eslint-plugin-node": "^11.1.0",
85-
"eslint-plugin-notice": "^0.9.10",
85+
"eslint-plugin-notice": "^1.0.0",
8686
"eslint-plugin-optimize-regex": "^1.2.1",
8787
"eslint-plugin-prettier": "^5.1.3",
88-
"eslint-plugin-promise": "^6.1.1",
89-
"eslint-plugin-regexp": "^2.5.0",
90-
"eslint-plugin-security": "^3.0.0",
88+
"eslint-plugin-promise": "^6.4.0",
89+
"eslint-plugin-regexp": "^2.6.0",
90+
"eslint-plugin-security": "^3.0.1",
9191
"eslint-plugin-sonarjs": "^1.0.3",
92-
"eslint-plugin-unicorn": "^53.0.0",
92+
"eslint-plugin-unicorn": "^54.0.0",
9393
"isomorphic-timers-promises": "^1.0.1",
9494
"minimist": "^1.2.8",
9595
"nock": "^13.5.4",
96-
"prettier": "^3.2.5",
97-
"typescript": "^5.4.5"
96+
"prettier": "^3.3.3",
97+
"typescript": "^5.5.3"
9898
},
99-
"packageManager": "yarn@4.2.2",
99+
"resolutions": {
100+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
101+
},
102+
"packageManager": "yarn@4.3.1",
100103
"volta": {
101104
"node": "20.13.1"
102105
}

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18+
// eslint-disable-next-line unicorn/import-style
1819
import { dirname, join } from 'node:path';
1920
import url from 'node:url';
2021

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
* limitations under the License.
1616
*/
1717

18+
import config from './config.js';
19+
20+
// eslint-disable-next-line unicorn/import-style
1821
import { join } from 'node:path';
1922
import { readdir } from 'node:fs/promises';
2023

@@ -31,8 +34,6 @@ import * as testers from './testers.js';
3134
import type { TestResult as ITestResult } from './testers.js';
3235
import { notifySlack } from './notifiers.js';
3336

34-
import config from './config.js';
35-
3637
const error = debug('trellis-monitor:error');
3738
const info = debug('trellis-monitor:info');
3839
const trace = debug('trellis-monitor:trace');

test/service.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ test('should fail on check after posting stale asn-staging ksuid key', async (t)
112112
t.is(status, 'failure');
113113
} catch (error: unknown) {
114114
// @ts-expect-error errors are annoying
115-
if (!['ECONNREFUSED', 'ENETUNREACH'].includes(error.code)) {
115+
if (!['ECONNREFUSED', 'ENETUNREACH'].includes(`${error.code}`)) {
116116
// Service is running, but something went wrong
117117
throw error as Error;
118118
}

test/setup.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
* limitations under the License.
1616
*/
1717

18+
import test from 'ava';
19+
1820
import { fileURLToPath } from 'node:url';
1921

2022
import { configure, setupTests } from 'ava-nock';
21-
import test from 'ava';
2223

23-
// import FakeTimers from '@sinonjs/fake-timers';
24+
// Import FakeTimers from '@sinonjs/fake-timers';
2425

2526
// Fake the time
2627
/*
@@ -59,9 +60,10 @@ export default function setup(
5960
fixtureDir,
6061
headerFilter: {
6162
// Don't record tokens
63+
// eslint-disable-next-line unicorn/no-null
6264
'authorization': () => null,
6365
// Don't record content lengths?
64-
// eslint-disable-next-line @typescript-eslint/naming-convention
66+
// eslint-disable-next-line @typescript-eslint/naming-convention, unicorn/no-null
6567
'content-length': () => null,
6668
'content-location': filterVariables,
6769
...headerFilter,

test/staleKsuidKeys.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { setTimeout } from 'isomorphic-timers-promises';
18+
import config from '../dist/config.js';
1919

2020
import test from 'ava';
2121

22+
import ksuid from 'ksuid';
23+
import { setTimeout } from 'isomorphic-timers-promises';
24+
2225
import type { OADAClient } from '@oada/client';
2326
import { connect } from '@oada/client';
24-
import ksuid from 'ksuid';
2527

2628
import setup from './setup.js';
2729

28-
import config from '../dist/config.js';
2930
import { staleKsuidKeys } from '../dist/testers.js';
3031

3132
const { domain, token } = config.get('oada');

0 commit comments

Comments
 (0)