@liflig/load-secrets 1.0.49 → 1.1.0
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/.github/workflows/ci.yaml +1 -1
- package/.tool-versions +1 -1
- package/Makefile +4 -0
- package/biome.jsonc +52 -0
- package/lib/cli/reporter.js +1 -1
- package/lib/cli/reporter.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/load-secrets/index.js.map +1 -1
- package/lib/load-secrets/load-secrets.js +4 -3
- package/lib/load-secrets/load-secrets.js.map +1 -1
- package/package.json +8 -12
- package/src/cli/reporter.ts +23 -23
- package/src/index.ts +1 -1
- package/src/load-secrets/index.ts +2 -2
- package/src/load-secrets/load-secrets.ts +130 -131
- package/src/load-secrets/types.ts +16 -16
- package/eslint.config.mjs +0 -33
package/.tool-versions
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
nodejs
|
|
1
|
+
nodejs 24.3.0
|
package/Makefile
CHANGED
package/biome.jsonc
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"ignoreUnknown": false,
|
|
10
|
+
"includes": ["src/**"]
|
|
11
|
+
},
|
|
12
|
+
"formatter": {
|
|
13
|
+
"formatWithErrors": false,
|
|
14
|
+
"indentStyle": "space",
|
|
15
|
+
"indentWidth": 2,
|
|
16
|
+
"lineWidth": 80
|
|
17
|
+
},
|
|
18
|
+
"linter": {
|
|
19
|
+
"rules": {
|
|
20
|
+
"recommended": true,
|
|
21
|
+
"complexity": {
|
|
22
|
+
"noStaticOnlyClass": "off",
|
|
23
|
+
"noForEach": "off"
|
|
24
|
+
},
|
|
25
|
+
"correctness": {
|
|
26
|
+
"noUnusedImports": "warn"
|
|
27
|
+
},
|
|
28
|
+
"suspicious": {
|
|
29
|
+
"noExplicitAny": "off"
|
|
30
|
+
},
|
|
31
|
+
"style": {
|
|
32
|
+
"useSelfClosingElements": "warn",
|
|
33
|
+
"noParameterAssign": "error",
|
|
34
|
+
"useAsConstAssertion": "error",
|
|
35
|
+
"useDefaultParameterLast": "error",
|
|
36
|
+
"useEnumInitializers": "error",
|
|
37
|
+
"useSingleVarDeclarator": "error",
|
|
38
|
+
"noUnusedTemplateLiteral": "error",
|
|
39
|
+
"useNumberNamespace": "error",
|
|
40
|
+
"noInferrableTypes": "error",
|
|
41
|
+
"noUselessElse": "error",
|
|
42
|
+
"noNonNullAssertion": "off"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"javascript": {
|
|
47
|
+
"formatter": {
|
|
48
|
+
"semicolons": "asNeeded",
|
|
49
|
+
"quoteStyle": "double"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
package/lib/cli/reporter.js
CHANGED
package/lib/cli/reporter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../src/cli/reporter.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../src/cli/reporter.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAE1B,MAAM,UAAU,cAAc,CAAC,IAA6B;IAC1D,OAAO,IAAI,WAAW,CAAC;QACrB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO;QACvB,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc;KACtC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,MAA0B;IAC3C,QAAQ,CAAC,SAAS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,CAAA;IAC3D,CAAC;CACF"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/load-secrets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/load-secrets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -86,6 +86,7 @@ class LoadSecrets {
|
|
|
86
86
|
}
|
|
87
87
|
const tagsToUpdate = tags.filter((expectedTag) => {
|
|
88
88
|
const existing = secret.Tags.find((it) => it.Key === expectedTag.Key);
|
|
89
|
+
// biome-ignore lint/suspicious/noDoubleEquals: Carryover from eslint
|
|
89
90
|
return existing == null || existing.Value != expectedTag.Value;
|
|
90
91
|
});
|
|
91
92
|
if (tagsToUpdate.length > 0) {
|
|
@@ -135,7 +136,7 @@ class LoadSecrets {
|
|
|
135
136
|
secretValue = await this.handleStringUpdate();
|
|
136
137
|
}
|
|
137
138
|
else {
|
|
138
|
-
throw new Error(
|
|
139
|
+
throw new Error("Unsupported type");
|
|
139
140
|
}
|
|
140
141
|
this.reporter.log("Storing secret value:");
|
|
141
142
|
this.reporter.log(this.reporter.format.yellowBright(secretValue.replace(/^/gm, " ")));
|
|
@@ -264,7 +265,7 @@ class LoadSecrets {
|
|
|
264
265
|
if (answer.trim() === "") {
|
|
265
266
|
return false;
|
|
266
267
|
}
|
|
267
|
-
index = parseInt(answer);
|
|
268
|
+
index = Number.parseInt(answer);
|
|
268
269
|
if (!secrets[index]) {
|
|
269
270
|
throw new Error();
|
|
270
271
|
}
|
|
@@ -286,7 +287,7 @@ class LoadSecrets {
|
|
|
286
287
|
this.reporter.log("");
|
|
287
288
|
const matchedSecretGroups = secretGroups.filter((it) => it.accountId === currentAccount.Account);
|
|
288
289
|
if (matchedSecretGroups.length === 0) {
|
|
289
|
-
this.reporter.error(
|
|
290
|
+
this.reporter.error("No secrets specified for this account - aborting");
|
|
290
291
|
return;
|
|
291
292
|
}
|
|
292
293
|
for (const secretGroup of matchedSecretGroups) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-secrets.js","sourceRoot":"","sources":["../../src/load-secrets/load-secrets.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,mCAAmC,EACnC,+BAA+B,EAC/B,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,WAAW;IACE,kBAAkB,GACjC,EAAE,CAAC;IACY,SAAS,CAAY;IAErB,QAAQ,CAAc;IACtB,MAAM,CAAU;IAEjC,YAAY,KAAiD;QAC3D,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC;YAC7B,MAAM,EAAE,WAAW;SACpB,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAEO,WAAW,CAAC,MAAc;QAChC,IAAI,CAAC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YACrC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAA;YACvE,OAAM;QACR,CAAC;QAED,KAAK,MAAM,WAAW,IAAI,mBAAmB,EAAE,CAAC;YAC9C,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAA;QACpC,CAAC;QAED,oCAAoC;QACpC,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAA,CAAC;IAC5D,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAsC;IACnE,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC;QAClC,QAAQ,EAAE,cAAc,CAAC,EAAE,CAAC;QAC5B,gFAAgF;QAChF,wBAAwB;QACxB,MAAM,EAAE,KAAK;KACd,CAAC,CAAA;IAEF,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACtD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,CAAA;QACpD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;IACtB,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liflig/load-secrets",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Library for loading project secrets into AWS Secrets Manager",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -12,31 +12,27 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"prepare": "npm run build && husky",
|
|
14
14
|
"build": "tsc",
|
|
15
|
-
"lint": "
|
|
16
|
-
"lint:fix": "
|
|
15
|
+
"lint": "biome check",
|
|
16
|
+
"lint:fix": "biome check --write",
|
|
17
17
|
"semantic-release": "semantic-release"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@aws-sdk/client-secrets-manager": "3.
|
|
24
|
-
"@aws-sdk/client-sts": "3.
|
|
23
|
+
"@aws-sdk/client-secrets-manager": "3.840.0",
|
|
24
|
+
"@aws-sdk/client-sts": "3.840.0",
|
|
25
25
|
"chalk": "5.4.1",
|
|
26
26
|
"read": "4.1.0",
|
|
27
27
|
"typescript": "5.8.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
+
"@biomejs/biome": "2.0.6",
|
|
30
31
|
"@commitlint/cli": "19.8.1",
|
|
31
32
|
"@commitlint/config-conventional": "19.8.1",
|
|
32
|
-
"@
|
|
33
|
-
"@types/node": "22.15.32",
|
|
33
|
+
"@types/node": "24.0.8",
|
|
34
34
|
"@types/read": "0.0.32",
|
|
35
|
-
"eslint": "9.29.0",
|
|
36
|
-
"eslint-config-prettier": "10.1.5",
|
|
37
|
-
"eslint-plugin-prettier": "5.5.0",
|
|
38
35
|
"husky": "9.1.7",
|
|
39
|
-
"semantic-release": "24.2.
|
|
40
|
-
"typescript-eslint": "8.35.0"
|
|
36
|
+
"semantic-release": "24.2.6"
|
|
41
37
|
}
|
|
42
38
|
}
|
package/src/cli/reporter.ts
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import readline from "node:readline"
|
|
2
|
+
import chalk from "chalk"
|
|
3
3
|
|
|
4
|
-
const CLEAR_WHOLE_LINE = 0
|
|
4
|
+
const CLEAR_WHOLE_LINE = 0
|
|
5
5
|
|
|
6
6
|
export function createReporter(argv: Record<string, unknown>): CLIReporter {
|
|
7
7
|
return new CLIReporter({
|
|
8
8
|
verbose: !!argv.verbose,
|
|
9
9
|
nonInteractive: !!argv.nonInteractive,
|
|
10
|
-
})
|
|
10
|
+
})
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function clearLine(stdout: NodeJS.WriteStream) {
|
|
14
|
-
readline.clearLine(stdout, CLEAR_WHOLE_LINE)
|
|
15
|
-
readline.cursorTo(stdout, 0)
|
|
14
|
+
readline.clearLine(stdout, CLEAR_WHOLE_LINE)
|
|
15
|
+
readline.cursorTo(stdout, 0)
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export class CLIReporter {
|
|
19
19
|
public constructor(
|
|
20
20
|
opts: {
|
|
21
|
-
nonInteractive?: boolean
|
|
22
|
-
verbose?: boolean
|
|
21
|
+
nonInteractive?: boolean
|
|
22
|
+
verbose?: boolean
|
|
23
23
|
} = {},
|
|
24
24
|
) {
|
|
25
|
-
this.nonInteractive = !!opts.nonInteractive
|
|
26
|
-
this.isVerbose = !!opts.verbose
|
|
25
|
+
this.nonInteractive = !!opts.nonInteractive
|
|
26
|
+
this.isVerbose = !!opts.verbose
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
public stdout = process.stdout
|
|
30
|
-
public stderr = process.stderr
|
|
31
|
-
public nonInteractive: boolean
|
|
32
|
-
public isVerbose: boolean
|
|
33
|
-
public format: typeof chalk = chalk
|
|
29
|
+
public stdout = process.stdout
|
|
30
|
+
public stderr = process.stderr
|
|
31
|
+
public nonInteractive: boolean
|
|
32
|
+
public isVerbose: boolean
|
|
33
|
+
public format: typeof chalk = chalk
|
|
34
34
|
|
|
35
35
|
public error(msg: string): void {
|
|
36
|
-
clearLine(this.stderr)
|
|
37
|
-
this.stderr.write(`${this.format.red("error")} ${msg}\n`)
|
|
36
|
+
clearLine(this.stderr)
|
|
37
|
+
this.stderr.write(`${this.format.red("error")} ${msg}\n`)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
public log(msg: string): void {
|
|
41
|
-
clearLine(this.stdout)
|
|
42
|
-
this.stdout.write(`${msg}\n`)
|
|
41
|
+
clearLine(this.stdout)
|
|
42
|
+
this.stdout.write(`${msg}\n`)
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
public warn(msg: string): void {
|
|
46
|
-
clearLine(this.stderr)
|
|
47
|
-
this.stderr.write(`${this.format.yellow("warning")} ${msg}\n`)
|
|
46
|
+
clearLine(this.stderr)
|
|
47
|
+
this.stderr.write(`${this.format.yellow("warning")} ${msg}\n`)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
public info(msg: string): void {
|
|
51
|
-
clearLine(this.stdout)
|
|
52
|
-
this.stdout.write(`${this.format.blue("info")} ${msg}\n`)
|
|
51
|
+
clearLine(this.stdout)
|
|
52
|
+
this.stdout.write(`${this.format.blue("info")} ${msg}\n`)
|
|
53
53
|
}
|
|
54
54
|
}
|
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as loadSecrets from "./load-secrets"
|
|
1
|
+
export * as loadSecrets from "./load-secrets"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { loadSecretsCli } from "./load-secrets"
|
|
2
|
-
export type { JsonSecret, Secret, SecretGroup } from "./types"
|
|
1
|
+
export { loadSecretsCli } from "./load-secrets"
|
|
2
|
+
export type { JsonSecret, Secret, SecretGroup } from "./types"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
DescribeSecretResponse,
|
|
3
3
|
Tag,
|
|
4
|
-
} from "@aws-sdk/client-secrets-manager"
|
|
4
|
+
} from "@aws-sdk/client-secrets-manager"
|
|
5
5
|
import {
|
|
6
6
|
CreateSecretCommand,
|
|
7
7
|
DescribeSecretCommand,
|
|
@@ -14,43 +14,42 @@ import {
|
|
|
14
14
|
SecretsManagerClient,
|
|
15
15
|
TagResourceCommand,
|
|
16
16
|
UntagResourceCommand,
|
|
17
|
-
} from "@aws-sdk/client-secrets-manager"
|
|
18
|
-
import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts"
|
|
19
|
-
import type { Options } from "read"
|
|
20
|
-
import { read } from "read"
|
|
21
|
-
import type { CLIReporter } from "../cli/reporter"
|
|
22
|
-
import { createReporter } from "../cli/reporter"
|
|
17
|
+
} from "@aws-sdk/client-secrets-manager"
|
|
18
|
+
import { GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts"
|
|
19
|
+
import type { Options } from "read"
|
|
20
|
+
import { read } from "read"
|
|
21
|
+
import type { CLIReporter } from "../cli/reporter"
|
|
22
|
+
import { createReporter } from "../cli/reporter"
|
|
23
23
|
|
|
24
|
-
import type { JsonSecret, Secret, SecretGroup } from "./types"
|
|
24
|
+
import type { JsonSecret, Secret, SecretGroup } from "./types"
|
|
25
25
|
|
|
26
26
|
class LoadSecrets {
|
|
27
|
-
private readonly smClientForRegions: Record<string, SecretsManagerClient> =
|
|
28
|
-
|
|
29
|
-
private readonly stsClient: STSClient;
|
|
27
|
+
private readonly smClientForRegions: Record<string, SecretsManagerClient> = {}
|
|
28
|
+
private readonly stsClient: STSClient
|
|
30
29
|
|
|
31
|
-
private readonly reporter: CLIReporter
|
|
32
|
-
private readonly silent: boolean
|
|
30
|
+
private readonly reporter: CLIReporter
|
|
31
|
+
private readonly silent: boolean
|
|
33
32
|
|
|
34
33
|
constructor(props: { reporter: CLIReporter; silent: boolean }) {
|
|
35
34
|
this.stsClient = new STSClient({
|
|
36
35
|
region: "eu-west-1",
|
|
37
|
-
})
|
|
38
|
-
this.reporter = props.reporter
|
|
39
|
-
this.silent = props.silent
|
|
36
|
+
})
|
|
37
|
+
this.reporter = props.reporter
|
|
38
|
+
this.silent = props.silent
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
private getSmClient(region: string): SecretsManagerClient {
|
|
43
42
|
if (!this.smClientForRegions[region]) {
|
|
44
43
|
this.smClientForRegions[region] = new SecretsManagerClient({
|
|
45
44
|
region,
|
|
46
|
-
})
|
|
45
|
+
})
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
return this.smClientForRegions[region]
|
|
48
|
+
return this.smClientForRegions[region]
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
async getInput(options: Options): Promise<string> {
|
|
53
|
-
return read(options)
|
|
52
|
+
return read(options)
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
async getSecretDetails(
|
|
@@ -60,13 +59,13 @@ class LoadSecrets {
|
|
|
60
59
|
try {
|
|
61
60
|
return await client.send(
|
|
62
61
|
new DescribeSecretCommand({ SecretId: secretId }),
|
|
63
|
-
)
|
|
62
|
+
)
|
|
64
63
|
} catch (e) {
|
|
65
64
|
if (e instanceof ResourceNotFoundException) {
|
|
66
|
-
return null
|
|
65
|
+
return null
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
throw e
|
|
68
|
+
throw e
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
|
|
@@ -74,50 +73,50 @@ class LoadSecrets {
|
|
|
74
73
|
return await this.getInput({
|
|
75
74
|
prompt: "Enter value (Ctrl+C to abort): ",
|
|
76
75
|
silent: this.silent,
|
|
77
|
-
})
|
|
76
|
+
})
|
|
78
77
|
}
|
|
79
78
|
async handleJsonUpdate(secret: JsonSecret) {
|
|
80
|
-
this.reporter.log("The secret is of type JSON with these expected fields:")
|
|
79
|
+
this.reporter.log("The secret is of type JSON with these expected fields:")
|
|
81
80
|
for (const field of secret.fields) {
|
|
82
|
-
const key = typeof field === "string" ? field : field.key
|
|
81
|
+
const key = typeof field === "string" ? field : field.key
|
|
83
82
|
const desc =
|
|
84
83
|
typeof field === "string"
|
|
85
84
|
? ""
|
|
86
85
|
: field.description
|
|
87
86
|
? ` (${field.description})`
|
|
88
|
-
: ""
|
|
89
|
-
this.reporter.log(` - ${key}${desc}`)
|
|
87
|
+
: ""
|
|
88
|
+
this.reporter.log(` - ${key}${desc}`)
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
this.reporter.log("")
|
|
91
|
+
this.reporter.log("")
|
|
93
92
|
|
|
94
93
|
// TODO: Ability to specify full json value as one line.
|
|
95
94
|
|
|
96
|
-
const collectedValues: Record<string, string | null> = {}
|
|
95
|
+
const collectedValues: Record<string, string | null> = {}
|
|
97
96
|
for (const field of secret.fields) {
|
|
98
|
-
const key = typeof field === "string" ? field : field.key
|
|
97
|
+
const key = typeof field === "string" ? field : field.key
|
|
99
98
|
|
|
100
|
-
this.reporter.log(`Field: ${this.reporter.format.greenBright(key)}`)
|
|
99
|
+
this.reporter.log(`Field: ${this.reporter.format.greenBright(key)}`)
|
|
101
100
|
|
|
102
101
|
if (typeof field !== "string" && field.example != null) {
|
|
103
102
|
this.reporter.log(
|
|
104
103
|
`Example: ${this.reporter.format.magentaBright(field.example)}`,
|
|
105
|
-
)
|
|
104
|
+
)
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
collectedValues[key] = await this.getInput({
|
|
109
108
|
prompt: "Enter value (Ctrl+C to abort): ",
|
|
110
109
|
silent: this.silent,
|
|
111
|
-
})
|
|
110
|
+
})
|
|
112
111
|
|
|
113
|
-
this.reporter.log("")
|
|
112
|
+
this.reporter.log("")
|
|
114
113
|
}
|
|
115
114
|
|
|
116
|
-
return JSON.stringify(collectedValues, undefined, " ")
|
|
115
|
+
return JSON.stringify(collectedValues, undefined, " ")
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
getFullName(secretGroup: SecretGroup, secret: Secret) {
|
|
120
|
-
return `${secretGroup.namePrefix}${secret.name}
|
|
119
|
+
return `${secretGroup.namePrefix}${secret.name}`
|
|
121
120
|
}
|
|
122
121
|
|
|
123
122
|
async syncTags(
|
|
@@ -129,33 +128,35 @@ class LoadSecrets {
|
|
|
129
128
|
.Tags!.filter(
|
|
130
129
|
(existingTag) => !tags.some((it) => it.Key! === existingTag.Key!),
|
|
131
130
|
)
|
|
132
|
-
.map((it) => it.Key!)
|
|
131
|
+
.map((it) => it.Key!)
|
|
133
132
|
|
|
134
133
|
if (keysToRemove.length > 0) {
|
|
135
|
-
this.reporter.log(`Removing obsolete tags: ${keysToRemove.join(", ")}`)
|
|
134
|
+
this.reporter.log(`Removing obsolete tags: ${keysToRemove.join(", ")}`)
|
|
136
135
|
await client.send(
|
|
137
136
|
new UntagResourceCommand({
|
|
138
137
|
SecretId: secret.ARN!,
|
|
139
138
|
TagKeys: keysToRemove,
|
|
140
139
|
}),
|
|
141
|
-
)
|
|
140
|
+
)
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
const tagsToUpdate = tags.filter((expectedTag) => {
|
|
145
|
-
const existing = secret.Tags!.find((it) => it.Key! === expectedTag.Key!)
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
const existing = secret.Tags!.find((it) => it.Key! === expectedTag.Key!)
|
|
145
|
+
|
|
146
|
+
// biome-ignore lint/suspicious/noDoubleEquals: Carryover from eslint
|
|
147
|
+
return existing == null || existing.Value != expectedTag.Value
|
|
148
|
+
})
|
|
148
149
|
|
|
149
150
|
if (tagsToUpdate.length > 0) {
|
|
150
151
|
this.reporter.log(
|
|
151
152
|
`Storing tags: ${tagsToUpdate.map((it) => it.Key!).join(", ")}`,
|
|
152
|
-
)
|
|
153
|
+
)
|
|
153
154
|
await client.send(
|
|
154
155
|
new TagResourceCommand({
|
|
155
156
|
SecretId: secret.ARN!,
|
|
156
157
|
Tags: tagsToUpdate,
|
|
157
158
|
}),
|
|
158
|
-
)
|
|
159
|
+
)
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
|
|
@@ -164,75 +165,73 @@ class LoadSecrets {
|
|
|
164
165
|
new GetSecretValueCommand({
|
|
165
166
|
SecretId: secretId,
|
|
166
167
|
}),
|
|
167
|
-
)
|
|
168
|
+
)
|
|
168
169
|
|
|
169
170
|
if (result.SecretString == null) {
|
|
170
|
-
throw new Error("Missing SecretString (is it a binary?)")
|
|
171
|
+
throw new Error("Missing SecretString (is it a binary?)")
|
|
171
172
|
}
|
|
172
173
|
|
|
173
|
-
return result.SecretString
|
|
174
|
+
return result.SecretString
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
async handleUpdate(secretGroup: SecretGroup, secret: Secret) {
|
|
177
|
-
const client = this.getSmClient(secretGroup.region)
|
|
178
|
+
const client = this.getSmClient(secretGroup.region)
|
|
178
179
|
|
|
179
|
-
const fullName = this.getFullName(secretGroup, secret)
|
|
180
|
-
const describeSecret = await this.getSecretDetails(client, fullName)
|
|
180
|
+
const fullName = this.getFullName(secretGroup, secret)
|
|
181
|
+
const describeSecret = await this.getSecretDetails(client, fullName)
|
|
181
182
|
|
|
182
|
-
this.reporter.log(`Secret: ${this.reporter.format.greenBright(fullName)}`)
|
|
183
|
+
this.reporter.log(`Secret: ${this.reporter.format.greenBright(fullName)}`)
|
|
183
184
|
|
|
184
185
|
if (describeSecret == null) {
|
|
185
|
-
this.reporter.log(
|
|
186
|
-
"The secret does not already exist and will be created",
|
|
187
|
-
);
|
|
186
|
+
this.reporter.log("The secret does not already exist and will be created")
|
|
188
187
|
} else {
|
|
189
|
-
this.reporter.log("Current value:")
|
|
188
|
+
this.reporter.log("Current value:")
|
|
190
189
|
this.reporter.log(
|
|
191
190
|
this.reporter.format.yellowBright(
|
|
192
191
|
(await this.getSecretValue(client, fullName)).replace(/^/gm, " "),
|
|
193
192
|
),
|
|
194
|
-
)
|
|
193
|
+
)
|
|
195
194
|
}
|
|
196
195
|
|
|
197
|
-
this.reporter.log("")
|
|
196
|
+
this.reporter.log("")
|
|
198
197
|
|
|
199
|
-
let secretValue: string
|
|
198
|
+
let secretValue: string
|
|
200
199
|
|
|
201
200
|
if (secret.type === "json") {
|
|
202
201
|
try {
|
|
203
|
-
secretValue = await this.handleJsonUpdate(secret)
|
|
202
|
+
secretValue = await this.handleJsonUpdate(secret)
|
|
204
203
|
} catch (e) {
|
|
205
204
|
if (e instanceof Error && e.message === "canceled") {
|
|
206
|
-
this.reporter.log("Aborted")
|
|
207
|
-
return
|
|
205
|
+
this.reporter.log("Aborted")
|
|
206
|
+
return
|
|
208
207
|
}
|
|
209
|
-
throw e
|
|
208
|
+
throw e
|
|
210
209
|
}
|
|
211
210
|
} else if (secret.type === "string") {
|
|
212
|
-
secretValue = await this.handleStringUpdate()
|
|
211
|
+
secretValue = await this.handleStringUpdate()
|
|
213
212
|
} else {
|
|
214
|
-
throw new Error(
|
|
213
|
+
throw new Error("Unsupported type")
|
|
215
214
|
}
|
|
216
215
|
|
|
217
|
-
this.reporter.log("Storing secret value:")
|
|
216
|
+
this.reporter.log("Storing secret value:")
|
|
218
217
|
this.reporter.log(
|
|
219
218
|
this.reporter.format.yellowBright(secretValue.replace(/^/gm, " ")),
|
|
220
|
-
)
|
|
219
|
+
)
|
|
221
220
|
|
|
222
221
|
const tags: Tag[] = [
|
|
223
222
|
{
|
|
224
223
|
Key: "Source",
|
|
225
224
|
Value: "load-secrets script",
|
|
226
225
|
},
|
|
227
|
-
]
|
|
226
|
+
]
|
|
228
227
|
|
|
229
|
-
let arn: string
|
|
230
|
-
let version: string
|
|
231
|
-
let newReplicaRegions: string[]
|
|
232
|
-
let removedReplicaRegions: string[] = []
|
|
228
|
+
let arn: string
|
|
229
|
+
let version: string
|
|
230
|
+
let newReplicaRegions: string[]
|
|
231
|
+
let removedReplicaRegions: string[] = []
|
|
233
232
|
|
|
234
233
|
if (describeSecret == null) {
|
|
235
|
-
newReplicaRegions = secret.replicaRegions ?? []
|
|
234
|
+
newReplicaRegions = secret.replicaRegions ?? []
|
|
236
235
|
const createResult = await client.send(
|
|
237
236
|
new CreateSecretCommand({
|
|
238
237
|
Name: fullName,
|
|
@@ -245,21 +244,21 @@ class LoadSecrets {
|
|
|
245
244
|
SecretString: secretValue,
|
|
246
245
|
Tags: tags,
|
|
247
246
|
}),
|
|
248
|
-
)
|
|
247
|
+
)
|
|
249
248
|
|
|
250
249
|
if (createResult.VersionId == null) {
|
|
251
|
-
throw new Error("Expected versionId")
|
|
250
|
+
throw new Error("Expected versionId")
|
|
252
251
|
}
|
|
253
252
|
|
|
254
|
-
arn = createResult.ARN
|
|
255
|
-
version = createResult.VersionId
|
|
253
|
+
arn = createResult.ARN!
|
|
254
|
+
version = createResult.VersionId
|
|
256
255
|
} else {
|
|
257
256
|
if (describeSecret.DeletedDate != null) {
|
|
258
257
|
await client.send(
|
|
259
258
|
new RestoreSecretCommand({
|
|
260
259
|
SecretId: fullName,
|
|
261
260
|
}),
|
|
262
|
-
)
|
|
261
|
+
)
|
|
263
262
|
}
|
|
264
263
|
|
|
265
264
|
const updateResult = await client.send(
|
|
@@ -267,18 +266,18 @@ class LoadSecrets {
|
|
|
267
266
|
SecretId: fullName,
|
|
268
267
|
SecretString: secretValue,
|
|
269
268
|
}),
|
|
270
|
-
)
|
|
269
|
+
)
|
|
271
270
|
const currentReplicaRegions =
|
|
272
271
|
describeSecret.ReplicationStatus?.map(
|
|
273
272
|
(replicationStatus) => replicationStatus.Region,
|
|
274
|
-
) ?? []
|
|
273
|
+
) ?? []
|
|
275
274
|
newReplicaRegions =
|
|
276
275
|
secret.replicaRegions?.filter(
|
|
277
276
|
(region) => !currentReplicaRegions.includes(region),
|
|
278
|
-
) ?? []
|
|
277
|
+
) ?? []
|
|
279
278
|
removedReplicaRegions = currentReplicaRegions
|
|
280
279
|
.filter((region): region is string => !!region && true)
|
|
281
|
-
.filter((region) => !(secret.replicaRegions || []).includes(region))
|
|
280
|
+
.filter((region) => !(secret.replicaRegions || []).includes(region))
|
|
282
281
|
if (newReplicaRegions.length > 0) {
|
|
283
282
|
await client.send(
|
|
284
283
|
new ReplicateSecretToRegionsCommand({
|
|
@@ -287,7 +286,7 @@ class LoadSecrets {
|
|
|
287
286
|
Region: region,
|
|
288
287
|
})),
|
|
289
288
|
}),
|
|
290
|
-
)
|
|
289
|
+
)
|
|
291
290
|
}
|
|
292
291
|
if (removedReplicaRegions.length > 0) {
|
|
293
292
|
await client.send(
|
|
@@ -295,36 +294,36 @@ class LoadSecrets {
|
|
|
295
294
|
SecretId: fullName,
|
|
296
295
|
RemoveReplicaRegions: removedReplicaRegions,
|
|
297
296
|
}),
|
|
298
|
-
)
|
|
297
|
+
)
|
|
299
298
|
}
|
|
300
299
|
|
|
301
300
|
if (updateResult.VersionId == null) {
|
|
302
|
-
throw new Error("Expected versionId")
|
|
301
|
+
throw new Error("Expected versionId")
|
|
303
302
|
}
|
|
304
303
|
|
|
305
|
-
await this.syncTags(client, describeSecret, tags)
|
|
304
|
+
await this.syncTags(client, describeSecret, tags)
|
|
306
305
|
|
|
307
|
-
arn = updateResult.ARN
|
|
308
|
-
version = updateResult.VersionId
|
|
306
|
+
arn = updateResult.ARN!
|
|
307
|
+
version = updateResult.VersionId
|
|
309
308
|
}
|
|
310
309
|
|
|
311
|
-
this.reporter.log("")
|
|
312
|
-
this.reporter.log("Secret stored:")
|
|
313
|
-
this.reporter.log(`ARN: ${this.reporter.format.greenBright(arn)}`)
|
|
314
|
-
this.reporter.log(`Version: ${this.reporter.format.greenBright(version)}`)
|
|
310
|
+
this.reporter.log("")
|
|
311
|
+
this.reporter.log("Secret stored:")
|
|
312
|
+
this.reporter.log(`ARN: ${this.reporter.format.greenBright(arn)}`)
|
|
313
|
+
this.reporter.log(`Version: ${this.reporter.format.greenBright(version)}`)
|
|
315
314
|
if (newReplicaRegions.length > 0) {
|
|
316
315
|
this.reporter.log(
|
|
317
316
|
`Read replicas added to regions: ${newReplicaRegions
|
|
318
317
|
.map((r) => this.reporter.format.greenBright(r))
|
|
319
318
|
.join(", ")}`,
|
|
320
|
-
)
|
|
319
|
+
)
|
|
321
320
|
}
|
|
322
321
|
if (removedReplicaRegions.length > 0) {
|
|
323
322
|
this.reporter.log(
|
|
324
323
|
`Read replicas removed from regions: ${removedReplicaRegions
|
|
325
324
|
.map((r) => this.reporter.format.redBright(r))
|
|
326
325
|
.join(", ")}`,
|
|
327
|
-
)
|
|
326
|
+
)
|
|
328
327
|
}
|
|
329
328
|
}
|
|
330
329
|
|
|
@@ -335,7 +334,7 @@ class LoadSecrets {
|
|
|
335
334
|
) {
|
|
336
335
|
throw new Error(
|
|
337
336
|
`namePrefix should start and end with /. Current value: ${secretGroup.namePrefix}`,
|
|
338
|
-
)
|
|
337
|
+
)
|
|
339
338
|
}
|
|
340
339
|
}
|
|
341
340
|
|
|
@@ -344,91 +343,91 @@ class LoadSecrets {
|
|
|
344
343
|
? "not yet created"
|
|
345
344
|
: details?.DeletedDate != null
|
|
346
345
|
? `scheduled for deletion ${details.DeletedDate.toISOString()}`
|
|
347
|
-
: `last changed ${details.LastChangedDate?.toISOString() ?? "unknown"}
|
|
346
|
+
: `last changed ${details.LastChangedDate?.toISOString() ?? "unknown"}`
|
|
348
347
|
}
|
|
349
348
|
|
|
350
349
|
/**
|
|
351
350
|
* Returns false if aborted.
|
|
352
351
|
*/
|
|
353
352
|
async selectAndUpdate(secretGroups: SecretGroup[]): Promise<boolean> {
|
|
354
|
-
const secrets: { secretGroup: SecretGroup; secret: Secret }[] = []
|
|
353
|
+
const secrets: { secretGroup: SecretGroup; secret: Secret }[] = []
|
|
355
354
|
|
|
356
|
-
this.reporter.log("Select secret to write:")
|
|
357
|
-
this.reporter.log("")
|
|
355
|
+
this.reporter.log("Select secret to write:")
|
|
356
|
+
this.reporter.log("")
|
|
358
357
|
|
|
359
358
|
for (const secretGroup of secretGroups) {
|
|
360
359
|
this.reporter.log(
|
|
361
360
|
`${secretGroup.description} (prefix: ${secretGroup.namePrefix})`,
|
|
362
|
-
)
|
|
361
|
+
)
|
|
363
362
|
|
|
364
363
|
for (let i = 0; i < secretGroup.secrets.length; i++) {
|
|
365
|
-
const offset = secrets.length
|
|
366
|
-
const secret = secretGroup.secrets[i]
|
|
364
|
+
const offset = secrets.length
|
|
365
|
+
const secret = secretGroup.secrets[i]
|
|
367
366
|
|
|
368
367
|
secrets.push({
|
|
369
368
|
secret: secret,
|
|
370
369
|
secretGroup,
|
|
371
|
-
})
|
|
370
|
+
})
|
|
372
371
|
|
|
373
|
-
const client = this.getSmClient(secretGroup.region)
|
|
372
|
+
const client = this.getSmClient(secretGroup.region)
|
|
374
373
|
const details = await this.getSecretDetails(
|
|
375
374
|
client,
|
|
376
375
|
this.getFullName(secretGroup, secret),
|
|
377
|
-
)
|
|
378
|
-
const desc = this.getSecretDescription(details)
|
|
376
|
+
)
|
|
377
|
+
const desc = this.getSecretDescription(details)
|
|
379
378
|
|
|
380
|
-
this.reporter.log(` (${offset}) ${secret.name} (${desc})`)
|
|
379
|
+
this.reporter.log(` (${offset}) ${secret.name} (${desc})`)
|
|
381
380
|
}
|
|
382
|
-
this.reporter.log("")
|
|
381
|
+
this.reporter.log("")
|
|
383
382
|
}
|
|
384
383
|
|
|
385
|
-
let index: number
|
|
384
|
+
let index: number
|
|
386
385
|
try {
|
|
387
386
|
const answer = await this.getInput({
|
|
388
387
|
prompt: "Enter index (or enter to quit): ",
|
|
389
|
-
})
|
|
388
|
+
})
|
|
390
389
|
if (answer.trim() === "") {
|
|
391
|
-
return false
|
|
390
|
+
return false
|
|
392
391
|
}
|
|
393
392
|
|
|
394
|
-
index = parseInt(answer)
|
|
393
|
+
index = Number.parseInt(answer)
|
|
395
394
|
if (!secrets[index]) {
|
|
396
|
-
throw new Error()
|
|
395
|
+
throw new Error()
|
|
397
396
|
}
|
|
398
397
|
} catch (_) {
|
|
399
|
-
this.reporter.warn("Secret not found - aborting")
|
|
400
|
-
return false
|
|
398
|
+
this.reporter.warn("Secret not found - aborting")
|
|
399
|
+
return false
|
|
401
400
|
}
|
|
402
401
|
|
|
403
|
-
this.reporter.log("")
|
|
404
|
-
await this.handleUpdate(secrets[index].secretGroup, secrets[index].secret)
|
|
405
|
-
this.reporter.log("")
|
|
402
|
+
this.reporter.log("")
|
|
403
|
+
await this.handleUpdate(secrets[index].secretGroup, secrets[index].secret)
|
|
404
|
+
this.reporter.log("")
|
|
406
405
|
|
|
407
|
-
return true
|
|
406
|
+
return true
|
|
408
407
|
}
|
|
409
408
|
|
|
410
409
|
async process(secretGroups: SecretGroup[]) {
|
|
411
|
-
this.reporter.info("Checking account for current credentials")
|
|
410
|
+
this.reporter.info("Checking account for current credentials")
|
|
412
411
|
this.reporter.info(
|
|
413
412
|
"If any error is given, make sure you have valid credentials active",
|
|
414
|
-
)
|
|
413
|
+
)
|
|
415
414
|
const currentAccount = await this.stsClient.send(
|
|
416
415
|
new GetCallerIdentityCommand({}),
|
|
417
|
-
)
|
|
416
|
+
)
|
|
418
417
|
|
|
419
|
-
this.reporter.info(`Running for account ${currentAccount.Account!}`)
|
|
420
|
-
this.reporter.log("")
|
|
418
|
+
this.reporter.info(`Running for account ${currentAccount.Account!}`)
|
|
419
|
+
this.reporter.log("")
|
|
421
420
|
|
|
422
421
|
const matchedSecretGroups = secretGroups.filter(
|
|
423
422
|
(it) => it.accountId === currentAccount.Account!,
|
|
424
|
-
)
|
|
423
|
+
)
|
|
425
424
|
if (matchedSecretGroups.length === 0) {
|
|
426
|
-
this.reporter.error(
|
|
427
|
-
return
|
|
425
|
+
this.reporter.error("No secrets specified for this account - aborting")
|
|
426
|
+
return
|
|
428
427
|
}
|
|
429
428
|
|
|
430
429
|
for (const secretGroup of matchedSecretGroups) {
|
|
431
|
-
this.checkSecretGroup(secretGroup)
|
|
430
|
+
this.checkSecretGroup(secretGroup)
|
|
432
431
|
}
|
|
433
432
|
|
|
434
433
|
// eslint-disable-next-line no-empty
|
|
@@ -445,10 +444,10 @@ export function loadSecretsCli(props: { secretGroups: SecretGroup[] }): void {
|
|
|
445
444
|
// For now, we show the secrets, so that we get positive feedback that the value
|
|
446
445
|
// is correctly entered.
|
|
447
446
|
silent: false,
|
|
448
|
-
})
|
|
447
|
+
})
|
|
449
448
|
|
|
450
449
|
loadSecrets.process(props.secretGroups).catch((error) => {
|
|
451
|
-
console.error(error.stack || error.message || error)
|
|
452
|
-
process.exitCode = 1
|
|
453
|
-
})
|
|
450
|
+
console.error(error.stack || error.message || error)
|
|
451
|
+
process.exitCode = 1
|
|
452
|
+
})
|
|
454
453
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export interface BaseSecret {
|
|
2
|
-
name: string
|
|
3
|
-
description?: string
|
|
2
|
+
name: string
|
|
3
|
+
description?: string
|
|
4
4
|
/**
|
|
5
5
|
* A list of regions to create read replicas
|
|
6
6
|
* of the secret in.
|
|
7
7
|
*/
|
|
8
|
-
replicaRegions?: string[]
|
|
8
|
+
replicaRegions?: string[]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export type JsonSecretSimpleField = string
|
|
11
|
+
export type JsonSecretSimpleField = string
|
|
12
12
|
|
|
13
13
|
export interface JsonSecretDescribedField {
|
|
14
|
-
key: string
|
|
15
|
-
description?: string
|
|
16
|
-
example?: string
|
|
14
|
+
key: string
|
|
15
|
+
description?: string
|
|
16
|
+
example?: string
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -21,20 +21,20 @@ export interface JsonSecretDescribedField {
|
|
|
21
21
|
* and do not require JSON formating.
|
|
22
22
|
*/
|
|
23
23
|
export interface StringSecret extends BaseSecret {
|
|
24
|
-
type: "string"
|
|
24
|
+
type: "string"
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export interface JsonSecret extends BaseSecret {
|
|
28
|
-
type: "json"
|
|
29
|
-
fields: (JsonSecretSimpleField | JsonSecretDescribedField)[]
|
|
28
|
+
type: "json"
|
|
29
|
+
fields: (JsonSecretSimpleField | JsonSecretDescribedField)[]
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export type Secret = JsonSecret | StringSecret
|
|
32
|
+
export type Secret = JsonSecret | StringSecret
|
|
33
33
|
|
|
34
34
|
export interface SecretGroup {
|
|
35
|
-
accountId: string
|
|
36
|
-
region: string
|
|
37
|
-
description: string
|
|
38
|
-
namePrefix: string
|
|
39
|
-
secrets: Secret[]
|
|
35
|
+
accountId: string
|
|
36
|
+
region: string
|
|
37
|
+
description: string
|
|
38
|
+
namePrefix: string
|
|
39
|
+
secrets: Secret[]
|
|
40
40
|
}
|
package/eslint.config.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import eslint from "@eslint/js";
|
|
2
|
-
import prettierPluginRecommended from "eslint-plugin-prettier/recommended";
|
|
3
|
-
import tseslint from "typescript-eslint";
|
|
4
|
-
|
|
5
|
-
export default tseslint.config(
|
|
6
|
-
{
|
|
7
|
-
ignores: ["lib/"],
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
extends: [
|
|
11
|
-
eslint.configs.recommended,
|
|
12
|
-
...tseslint.configs.recommended,
|
|
13
|
-
// Must be last to override other rules
|
|
14
|
-
prettierPluginRecommended,
|
|
15
|
-
],
|
|
16
|
-
|
|
17
|
-
rules: {
|
|
18
|
-
"@typescript-eslint/no-unused-vars": [
|
|
19
|
-
"error",
|
|
20
|
-
{
|
|
21
|
-
argsIgnorePattern: "^_",
|
|
22
|
-
varsIgnorePattern: "^_",
|
|
23
|
-
caughtErrorsIgnorePattern: "^_",
|
|
24
|
-
ignoreRestSiblings: true,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
28
|
-
"@typescript-eslint/consistent-type-imports": "error",
|
|
29
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
30
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
);
|