@git.zone/cli 7.2.4 → 7.2.5
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@git.zone/cli',
|
|
6
|
-
version: '7.2.
|
|
6
|
+
version: '7.2.5',
|
|
7
7
|
description: 'A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxlQUFlO0lBQ3JCLE9BQU8sRUFBRSxPQUFPO0lBQ2hCLFdBQVcsRUFBRSwrTEFBK0w7Q0FDN00sQ0FBQSJ9
|
|
@@ -22,9 +22,9 @@ export interface IReleaseCommandFailureContext {
|
|
|
22
22
|
export declare const releaseCommandOutputTailLength = 500;
|
|
23
23
|
/**
|
|
24
24
|
* Removes credentials from command output: private keys, URL userinfo,
|
|
25
|
-
* authorization headers, credential settings in JSON,
|
|
26
|
-
* query strings
|
|
27
|
-
* them, as listed in {@link credentialPatterns}. Git and pnpm echo remote and
|
|
25
|
+
* authorization, API key and cookie headers, credential settings in JSON,
|
|
26
|
+
* YAML, npm configuration, query strings, environment variables and options,
|
|
27
|
+
* and tokens whose shape identifies them, as listed in {@link credentialPatterns}. Git and pnpm echo remote and
|
|
28
28
|
* registry URLs in their errors, and project commands can print anything.
|
|
29
29
|
*/
|
|
30
30
|
export declare const redactCommandOutput: (textArg: string) => string;
|
|
@@ -4,10 +4,10 @@ export const releaseCommandOutputTailLength = 500;
|
|
|
4
4
|
const ansiEscapePattern = /\u001b(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007\u001b]*(?:\u0007|\u001b\\)|[@-Z\\-_])/g;
|
|
5
5
|
/**
|
|
6
6
|
* Name endings that mark a credential setting: NPM_TOKEN, DEPLOY_SECRET,
|
|
7
|
-
* MINIO_SECRET_KEY, secretKey, DB_PASSWORD, OPENAI_API_KEY,
|
|
8
|
-
* AWS_SECRET_ACCESS_KEY, GIT_CREDENTIALS.
|
|
7
|
+
* MINIO_SECRET_KEY, secretKey, DB_PASSWORD, GPG_PASSPHRASE, OPENAI_API_KEY,
|
|
8
|
+
* x-api-key, AWS_SECRET_ACCESS_KEY, GIT_CREDENTIALS.
|
|
9
9
|
*/
|
|
10
|
-
const credentialNameEndings = String.raw `token|secret(?:_?key)?|passw(?:or)?d|
|
|
10
|
+
const credentialNameEndings = String.raw `token|secret(?:[_-]?key)?|passw(?:or)?d|passphrase|api[_-]?key|access[_-]?key|private[_-]?key|credentials?`;
|
|
11
11
|
/**
|
|
12
12
|
* A name of `charsArg` characters that ends in one of `endingsArg`, or in
|
|
13
13
|
* PASS or PWD. PASS counts only as the whole name or after a _ or -, so BYPASS
|
|
@@ -15,10 +15,22 @@ const credentialNameEndings = String.raw `token|secret(?:_?key)?|passw(?:or)?d|a
|
|
|
15
15
|
* which hold directories, are none either.
|
|
16
16
|
*/
|
|
17
17
|
const credentialName = (charsArg, endingsArg) => String.raw `(?:${charsArg}*(?:${endingsArg})|(?:${charsArg}*[_-])?pass|${charsArg}*[_-]pwd)`;
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Name endings of object keys, environment variables and options, which also
|
|
20
|
+
* name a credential by AUTH or AUTHORIZATION, or a one-time password by OTP:
|
|
21
|
+
* Docker's "auth", HTTPAUTH, BASIC_AUTH, --registry-auth, npm's --otp.
|
|
22
|
+
*/
|
|
23
|
+
const credentialKeyEndings = String.raw `${credentialNameEndings}|auth(?:orization)?|otp`;
|
|
24
|
+
/** An environment variable or option name: NPM_TOKEN, DB_PASS, HTTPAUTH, --token. */
|
|
25
|
+
const settingName = credentialName(String.raw `\w`, credentialKeyEndings);
|
|
26
|
+
/**
|
|
27
|
+
* A key whose value follows its colon without quotes, as in YAML and log
|
|
28
|
+
* lines: password: …, GPG_PASSPHRASE: …, x-access-token: …, db_pass: …. PASS
|
|
29
|
+
* and PWD count only after a _ or -, because test runners print "pass: 12",
|
|
30
|
+
* and AUTH does not count, because "auth: required" is a message, not a
|
|
31
|
+
* setting.
|
|
32
|
+
*/
|
|
33
|
+
const colonSettingName = String.raw `[\w-]*(?:${credentialNameEndings}|[_-](?:pass|pwd))`;
|
|
22
34
|
/**
|
|
23
35
|
* A setting value: a quoted string, or the text up to the next whitespace. A
|
|
24
36
|
* quote the line never closes hides the value to the end of the line.
|
|
@@ -58,6 +70,19 @@ const credentialPatterns = [
|
|
|
58
70
|
pattern: new RegExp(String.raw `("${credentialName(String.raw `[^"\n]`, credentialKeyEndings)}"[ \t]*:[ \t]*")(?:[^"\\\n]|\\.)*("?)`, "gi"),
|
|
59
71
|
replacement: "$1***$2",
|
|
60
72
|
},
|
|
73
|
+
// Unquoted values under a credential key in YAML and log lines:
|
|
74
|
+
// password: hunter2, token: abc, GPG_PASSPHRASE: …. The colon follows the
|
|
75
|
+
// name directly, so "Unexpected token : in JSON" keeps its text, and null,
|
|
76
|
+
// undefined, true and false stay, so a printout still says that a token
|
|
77
|
+
// was missing. A quoted value is left to the next pattern, and this one
|
|
78
|
+
// runs first, so it never takes a hidden quoted value and the comma after
|
|
79
|
+
// it for a value of its own. A Bearer, Basic or token scheme before the
|
|
80
|
+
// value stays, as in the header pattern below, so PRIVATE-TOKEN: Bearer …
|
|
81
|
+
// and X-Auth-Token: Basic … hide the credential, not the scheme.
|
|
82
|
+
{
|
|
83
|
+
pattern: new RegExp(String.raw `((?<![\w-])${colonSettingName}:[ \t]*(?:(?:bearer|basic|token)[ \t]+)?)(?!(?:null|undefined|true|false)(?:[\s,;)\]}]|$))[^\s"'\x60]\S*`, "gi"),
|
|
84
|
+
replacement: "$1***",
|
|
85
|
+
},
|
|
61
86
|
// Quoted values under a credential key in JavaScript object and YAML
|
|
62
87
|
// printouts: password: '…', secretKey: "…", token: '…', apiKey: '…',
|
|
63
88
|
// 'PRIVATE-TOKEN': '…', authorization: 'Bearer …'. \x60 is the backtick
|
|
@@ -68,9 +93,19 @@ const credentialPatterns = [
|
|
|
68
93
|
replacement: "$1***",
|
|
69
94
|
},
|
|
70
95
|
// HTTP headers: Authorization and Proxy-Authorization, with or without a
|
|
71
|
-
// scheme,
|
|
96
|
+
// scheme, GitLab's PRIVATE-TOKEN, JOB-TOKEN and Deploy-Token, Api-Key, and
|
|
97
|
+
// X- headers whose name ends in a credential word: X-Api-Key,
|
|
98
|
+
// X-Auth-Token, X-Registry-Auth, X-Amz-Security-Token. The part of an X-
|
|
99
|
+
// name before that word is at most 40 characters long.
|
|
72
100
|
{
|
|
73
|
-
pattern: /(\b(?:authorization|(?:private|job|deploy)-token)[ \t]*:[ \t]*(?:(?:bearer|basic|token)[ \t]+)?)\S+/gi,
|
|
101
|
+
pattern: /(\b(?:authorization|(?:private|job|deploy)-token|api-key|x-[a-z0-9-]{0,40}?(?:token|api-key|secret|auth))[ \t]*:[ \t]*(?:(?:bearer|basic|token)[ \t]+)?)\S+/gi,
|
|
102
|
+
replacement: "$1***",
|
|
103
|
+
},
|
|
104
|
+
// Cookie and Set-Cookie headers. A cookie list holds spaces ("a=1; b=2"),
|
|
105
|
+
// so the value is hidden to the line end. The header name stands on its
|
|
106
|
+
// own, so a package such as tough-cookie: 4.1.3 keeps its version.
|
|
107
|
+
{
|
|
108
|
+
pattern: /((?<![\w-])(?:set-)?cookie[ \t]*:[ \t]*)\S[^\r\n]*/gi,
|
|
74
109
|
replacement: "$1***",
|
|
75
110
|
},
|
|
76
111
|
// npm credential settings in .npmrc lines and npm_config_ variables:
|
|
@@ -87,8 +122,8 @@ const credentialPatterns = [
|
|
|
87
122
|
},
|
|
88
123
|
// Environment variables and options whose name ends in a credential word:
|
|
89
124
|
// NPM_TOKEN=, NODE_AUTH_TOKEN=, GITHUB_TOKEN=, GITEA_TOKEN=, *_SECRET=,
|
|
90
|
-
// SECRET_KEY=, *_PASSWORD=, DB_PASS=, MYSQL_PWD=,
|
|
91
|
-
// AWS_SECRET_ACCESS_KEY=, --token=. A value without quotes is hidden to the
|
|
125
|
+
// SECRET_KEY=, *_PASSWORD=, *_PASSPHRASE=, DB_PASS=, MYSQL_PWD=,
|
|
126
|
+
// *_API_KEY=, AWS_SECRET_ACCESS_KEY=, HTTPAUTH=, BASIC_AUTH=, --token=. A value without quotes is hidden to the
|
|
92
127
|
// next whitespace, & included. BYPASS=, PWD= and OLDPWD= keep their
|
|
93
128
|
// values, as credentialName describes. Query parameters, names that follow a ? or & (looked up at
|
|
94
129
|
// most 64 characters back), are left to the pattern above, which keeps the
|
|
@@ -97,11 +132,54 @@ const credentialPatterns = [
|
|
|
97
132
|
pattern: new RegExp(String.raw `(\b(?=${settingName}[ \t]*=)(?<![?&][\w.-]{0,63})${settingName}[ \t]*=[ \t]*)${settingValue}`, "gi"),
|
|
98
133
|
replacement: "$1***",
|
|
99
134
|
},
|
|
135
|
+
// Environment variables whose upper-case name ends in _KEY: SSH_KEY=,
|
|
136
|
+
// DEPLOY_KEY=, SIGNING_KEY=, and SSH_KEY: in a YAML env block. KEY alone
|
|
137
|
+
// names too much to count in other names, so only an upper-case name, as
|
|
138
|
+
// environment variables are written, counts: sort_key=, cacheKey: and
|
|
139
|
+
// primary_key: keep their values. PUBLIC_KEY holds no secret and keeps its
|
|
140
|
+
// value too. Query parameters are left to the pattern for them, as above.
|
|
141
|
+
{
|
|
142
|
+
pattern: new RegExp(String.raw `(\b(?<![?&][\w.-]{0,63})[A-Z0-9_]*(?<!PUBLIC)_KEY(?:[ \t]*=|:)[ \t]*)${settingValue}`, "g"),
|
|
143
|
+
replacement: "$1***",
|
|
144
|
+
},
|
|
100
145
|
// Credential options followed by their value: --token …, --password …,
|
|
101
|
-
// --secret
|
|
102
|
-
//
|
|
146
|
+
// --secret …, --auth-token …, --npm-token …, --api-key …, --passphrase …,
|
|
147
|
+
// --otp ….
|
|
148
|
+
// The name ends in a credential word, so --password-stdin, --token-file
|
|
149
|
+
// and --secret-id keep the argument after them, and a --no- option takes
|
|
150
|
+
// no value.
|
|
151
|
+
{
|
|
152
|
+
pattern: new RegExp(String.raw `((?<![\w-])--(?!no-)${credentialName(String.raw `[\w-]`, credentialKeyEndings)}[ \t]+)${settingValue}`, "gi"),
|
|
153
|
+
replacement: "$1***",
|
|
154
|
+
},
|
|
155
|
+
// The password after -p in a registry login: docker login -u ci -p …,
|
|
156
|
+
// podman login -p=…. -p names a port or a path in most other commands, so
|
|
157
|
+
// it counts only after docker, podman, buildah, nerdctl or skopeo login,
|
|
158
|
+
// at most 256 characters further on the line. --password-stdin takes no
|
|
159
|
+
// value and keeps the argument after it.
|
|
160
|
+
{
|
|
161
|
+
pattern: new RegExp(String.raw `(\b(?:docker|podman|buildah|nerdctl|skopeo)[ \t]+login\b[^\n]{0,256}?[ \t]-p(?:[ \t]+|=))${settingValue}`, "gi"),
|
|
162
|
+
replacement: "$1***",
|
|
163
|
+
},
|
|
164
|
+
// The password in a user:password argument after -u or --user: curl -u
|
|
165
|
+
// ci:…, curl --user "ci:…". The user stays. -u names a user in curl,
|
|
166
|
+
// docker login and many other commands, but also git push -u origin and
|
|
167
|
+
// sort -u, so only a value that holds a colon counts. Two runs of digits
|
|
168
|
+
// are a uid:gid (docker run -u 1000:1000) and a value that goes on with //
|
|
169
|
+
// is a URL (-u https://host), so both keep their text. The user is at most
|
|
170
|
+
// 256 characters long.
|
|
171
|
+
{
|
|
172
|
+
pattern: /((?<![\w-])(?:-u|--user)(?:[ \t]+|=))(?![0-9]{1,32}:[0-9]{1,32}(?!\S))(?:("[^:"\n]{0,256}:)[^"\n]*("?)|('[^:'\n]{0,256}:)[^'\n]*('?)|([^\s:"']{0,256}:)(?!\/\/)\S+)/g,
|
|
173
|
+
replacement: "$1$2$4$6***$3$5",
|
|
174
|
+
},
|
|
175
|
+
// .netrc entries: machine host login ci password …, on one line or across
|
|
176
|
+
// lines, default login ci password …, and machine host password … login
|
|
177
|
+
// ci. A bare password counts only with a login in the same entry, before
|
|
178
|
+
// it or right after its value, so "machine learning password policy" and
|
|
179
|
+
// "the default password is admin" keep their text. An account may stand
|
|
180
|
+
// before and after the login.
|
|
103
181
|
{
|
|
104
|
-
pattern: new RegExp(String.raw `((
|
|
182
|
+
pattern: new RegExp(String.raw `(\b(?:machine[ \t]+\S+|default)(?:\s+account[ \t]+\S+)?(?:\s+login[ \t]+\S+(?:\s+account[ \t]+\S+)?\s+password[ \t]+|\s+password[ \t]+(?=${settingValue}\s+login[ \t])))${settingValue}`, "g"),
|
|
105
183
|
replacement: "$1***",
|
|
106
184
|
},
|
|
107
185
|
// npm access tokens.
|
|
@@ -127,9 +205,9 @@ const credentialPatterns = [
|
|
|
127
205
|
];
|
|
128
206
|
/**
|
|
129
207
|
* Removes credentials from command output: private keys, URL userinfo,
|
|
130
|
-
* authorization headers, credential settings in JSON,
|
|
131
|
-
* query strings
|
|
132
|
-
* them, as listed in {@link credentialPatterns}. Git and pnpm echo remote and
|
|
208
|
+
* authorization, API key and cookie headers, credential settings in JSON,
|
|
209
|
+
* YAML, npm configuration, query strings, environment variables and options,
|
|
210
|
+
* and tokens whose shape identifies them, as listed in {@link credentialPatterns}. Git and pnpm echo remote and
|
|
133
211
|
* registry URLs in their errors, and project commands can print anything.
|
|
134
212
|
*/
|
|
135
213
|
export const redactCommandOutput = (textArg) => credentialPatterns.reduce((textSoFar, { pattern, replacement }) => textSoFar.replace(pattern, replacement), textArg);
|
|
@@ -174,4 +252,4 @@ export const describeCommandFailure = (resultArg, contextArg) => {
|
|
|
174
252
|
};
|
|
175
253
|
/** Appends the failure detail of a command to the sentence that names its step. */
|
|
176
254
|
export const formatCommandFailure = (messageArg, resultArg, contextArg) => `${messageArg} ${describeCommandFailure(resultArg, contextArg)}`;
|
|
177
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
255
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5jb21tYW5kZmFpbHVyZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3RzL21vZF9yZWxlYXNlL2hlbHBlcnMuY29tbWFuZGZhaWx1cmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxrQkFBa0IsQ0FBQztBQXNCNUMsOERBQThEO0FBQzlELE1BQU0sQ0FBQyxNQUFNLDhCQUE4QixHQUFHLEdBQUcsQ0FBQztBQUVsRCxNQUFNLGlCQUFpQixHQUNyQixnRkFBZ0YsQ0FBQztBQVNuRjs7OztHQUlHO0FBQ0gsTUFBTSxxQkFBcUIsR0FBRyxNQUFNLENBQUMsR0FBRyxDQUFBLDRHQUE0RyxDQUFDO0FBRXJKOzs7OztHQUtHO0FBQ0gsTUFBTSxjQUFjLEdBQUcsQ0FBQyxRQUFnQixFQUFFLFVBQWtCLEVBQVUsRUFBRSxDQUN0RSxNQUFNLENBQUMsR0FBRyxDQUFBLE1BQU0sUUFBUSxPQUFPLFVBQVUsUUFBUSxRQUFRLGVBQWUsUUFBUSxXQUFXLENBQUM7QUFFOUY7Ozs7R0FJRztBQUNILE1BQU0sb0JBQW9CLEdBQUcsTUFBTSxDQUFDLEdBQUcsQ0FBQSxHQUFHLHFCQUFxQix5QkFBeUIsQ0FBQztBQUV6RixxRkFBcUY7QUFDckYsTUFBTSxXQUFXLEdBQUcsY0FBYyxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUEsSUFBSSxFQUFFLG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ixDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsTUFBTSxPQUFPLEdBQ2pFLElBQUksQ0FBQyxDQUFDLENBQUMsS0FBSyxVQUFVLEtBQUssSUFBSSxFQUFFLENBQUMsQ0FBQyxDQUFDLEVBQ3RDLEVBQUUsQ0FBQztBQUNMLENBQUMsQ0FBQztBQUVGLG1GQUFtRjtBQUNuRixNQUFNLENBQUMsTUFBTSxvQkFBb0IsR0FBRyxDQUNsQyxVQUFrQixFQUNsQixTQUF5QyxFQUN6QyxVQUF5QyxFQUNqQyxFQUFFLENBQUMsR0FBRyxVQUFVLElBQUksc0JBQXNCLENBQUMsU0FBUyxFQUFFLFVBQVUsQ0FBQyxFQUFFLENBQUMifQ==
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@git.zone/cli",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "7.2.
|
|
4
|
+
"version": "7.2.5",
|
|
5
5
|
"description": "A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
|
7
7
|
"typings": "dist_ts/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@git.zone/tsbuild": "^5.0.0",
|
|
44
44
|
"@git.zone/tspack": "^1.4.1",
|
|
45
45
|
"@git.zone/tsrun": "^3.0.0",
|
|
46
|
-
"@git.zone/tstest": "^6.2.
|
|
46
|
+
"@git.zone/tstest": "^6.2.1",
|
|
47
47
|
"@types/node": "^26.6.1"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@git.zone/cli',
|
|
6
|
-
version: '7.2.
|
|
6
|
+
version: '7.2.5',
|
|
7
7
|
description: 'A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.'
|
|
8
8
|
}
|
|
@@ -35,10 +35,10 @@ interface ICredentialPattern {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Name endings that mark a credential setting: NPM_TOKEN, DEPLOY_SECRET,
|
|
38
|
-
* MINIO_SECRET_KEY, secretKey, DB_PASSWORD, OPENAI_API_KEY,
|
|
39
|
-
* AWS_SECRET_ACCESS_KEY, GIT_CREDENTIALS.
|
|
38
|
+
* MINIO_SECRET_KEY, secretKey, DB_PASSWORD, GPG_PASSPHRASE, OPENAI_API_KEY,
|
|
39
|
+
* x-api-key, AWS_SECRET_ACCESS_KEY, GIT_CREDENTIALS.
|
|
40
40
|
*/
|
|
41
|
-
const credentialNameEndings = String.raw`token|secret(?:_?key)?|passw(?:or)?d|
|
|
41
|
+
const credentialNameEndings = String.raw`token|secret(?:[_-]?key)?|passw(?:or)?d|passphrase|api[_-]?key|access[_-]?key|private[_-]?key|credentials?`;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* A name of `charsArg` characters that ends in one of `endingsArg`, or in
|
|
@@ -49,11 +49,24 @@ const credentialNameEndings = String.raw`token|secret(?:_?key)?|passw(?:or)?d|ap
|
|
|
49
49
|
const credentialName = (charsArg: string, endingsArg: string): string =>
|
|
50
50
|
String.raw`(?:${charsArg}*(?:${endingsArg})|(?:${charsArg}*[_-])?pass|${charsArg}*[_-]pwd)`;
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Name endings of object keys, environment variables and options, which also
|
|
54
|
+
* name a credential by AUTH or AUTHORIZATION, or a one-time password by OTP:
|
|
55
|
+
* Docker's "auth", HTTPAUTH, BASIC_AUTH, --registry-auth, npm's --otp.
|
|
56
|
+
*/
|
|
57
|
+
const credentialKeyEndings = String.raw`${credentialNameEndings}|auth(?:orization)?|otp`;
|
|
58
|
+
|
|
59
|
+
/** An environment variable or option name: NPM_TOKEN, DB_PASS, HTTPAUTH, --token. */
|
|
60
|
+
const settingName = credentialName(String.raw`\w`, credentialKeyEndings);
|
|
54
61
|
|
|
55
|
-
/**
|
|
56
|
-
|
|
62
|
+
/**
|
|
63
|
+
* A key whose value follows its colon without quotes, as in YAML and log
|
|
64
|
+
* lines: password: …, GPG_PASSPHRASE: …, x-access-token: …, db_pass: …. PASS
|
|
65
|
+
* and PWD count only after a _ or -, because test runners print "pass: 12",
|
|
66
|
+
* and AUTH does not count, because "auth: required" is a message, not a
|
|
67
|
+
* setting.
|
|
68
|
+
*/
|
|
69
|
+
const colonSettingName = String.raw`[\w-]*(?:${credentialNameEndings}|[_-](?:pass|pwd))`;
|
|
57
70
|
|
|
58
71
|
/**
|
|
59
72
|
* A setting value: a quoted string, or the text up to the next whitespace. A
|
|
@@ -99,6 +112,22 @@ const credentialPatterns: ReadonlyArray<ICredentialPattern> = [
|
|
|
99
112
|
),
|
|
100
113
|
replacement: "$1***$2",
|
|
101
114
|
},
|
|
115
|
+
// Unquoted values under a credential key in YAML and log lines:
|
|
116
|
+
// password: hunter2, token: abc, GPG_PASSPHRASE: …. The colon follows the
|
|
117
|
+
// name directly, so "Unexpected token : in JSON" keeps its text, and null,
|
|
118
|
+
// undefined, true and false stay, so a printout still says that a token
|
|
119
|
+
// was missing. A quoted value is left to the next pattern, and this one
|
|
120
|
+
// runs first, so it never takes a hidden quoted value and the comma after
|
|
121
|
+
// it for a value of its own. A Bearer, Basic or token scheme before the
|
|
122
|
+
// value stays, as in the header pattern below, so PRIVATE-TOKEN: Bearer …
|
|
123
|
+
// and X-Auth-Token: Basic … hide the credential, not the scheme.
|
|
124
|
+
{
|
|
125
|
+
pattern: new RegExp(
|
|
126
|
+
String.raw`((?<![\w-])${colonSettingName}:[ \t]*(?:(?:bearer|basic|token)[ \t]+)?)(?!(?:null|undefined|true|false)(?:[\s,;)\]}]|$))[^\s"'\x60]\S*`,
|
|
127
|
+
"gi",
|
|
128
|
+
),
|
|
129
|
+
replacement: "$1***",
|
|
130
|
+
},
|
|
102
131
|
// Quoted values under a credential key in JavaScript object and YAML
|
|
103
132
|
// printouts: password: '…', secretKey: "…", token: '…', apiKey: '…',
|
|
104
133
|
// 'PRIVATE-TOKEN': '…', authorization: 'Bearer …'. \x60 is the backtick
|
|
@@ -112,10 +141,20 @@ const credentialPatterns: ReadonlyArray<ICredentialPattern> = [
|
|
|
112
141
|
replacement: "$1***",
|
|
113
142
|
},
|
|
114
143
|
// HTTP headers: Authorization and Proxy-Authorization, with or without a
|
|
115
|
-
// scheme,
|
|
144
|
+
// scheme, GitLab's PRIVATE-TOKEN, JOB-TOKEN and Deploy-Token, Api-Key, and
|
|
145
|
+
// X- headers whose name ends in a credential word: X-Api-Key,
|
|
146
|
+
// X-Auth-Token, X-Registry-Auth, X-Amz-Security-Token. The part of an X-
|
|
147
|
+
// name before that word is at most 40 characters long.
|
|
116
148
|
{
|
|
117
149
|
pattern:
|
|
118
|
-
/(\b(?:authorization|(?:private|job|deploy)-token)[ \t]*:[ \t]*(?:(?:bearer|basic|token)[ \t]+)?)\S+/gi,
|
|
150
|
+
/(\b(?:authorization|(?:private|job|deploy)-token|api-key|x-[a-z0-9-]{0,40}?(?:token|api-key|secret|auth))[ \t]*:[ \t]*(?:(?:bearer|basic|token)[ \t]+)?)\S+/gi,
|
|
151
|
+
replacement: "$1***",
|
|
152
|
+
},
|
|
153
|
+
// Cookie and Set-Cookie headers. A cookie list holds spaces ("a=1; b=2"),
|
|
154
|
+
// so the value is hidden to the line end. The header name stands on its
|
|
155
|
+
// own, so a package such as tough-cookie: 4.1.3 keeps its version.
|
|
156
|
+
{
|
|
157
|
+
pattern: /((?<![\w-])(?:set-)?cookie[ \t]*:[ \t]*)\S[^\r\n]*/gi,
|
|
119
158
|
replacement: "$1***",
|
|
120
159
|
},
|
|
121
160
|
// npm credential settings in .npmrc lines and npm_config_ variables:
|
|
@@ -136,8 +175,8 @@ const credentialPatterns: ReadonlyArray<ICredentialPattern> = [
|
|
|
136
175
|
},
|
|
137
176
|
// Environment variables and options whose name ends in a credential word:
|
|
138
177
|
// NPM_TOKEN=, NODE_AUTH_TOKEN=, GITHUB_TOKEN=, GITEA_TOKEN=, *_SECRET=,
|
|
139
|
-
// SECRET_KEY=, *_PASSWORD=, DB_PASS=, MYSQL_PWD=,
|
|
140
|
-
// AWS_SECRET_ACCESS_KEY=, --token=. A value without quotes is hidden to the
|
|
178
|
+
// SECRET_KEY=, *_PASSWORD=, *_PASSPHRASE=, DB_PASS=, MYSQL_PWD=,
|
|
179
|
+
// *_API_KEY=, AWS_SECRET_ACCESS_KEY=, HTTPAUTH=, BASIC_AUTH=, --token=. A value without quotes is hidden to the
|
|
141
180
|
// next whitespace, & included. BYPASS=, PWD= and OLDPWD= keep their
|
|
142
181
|
// values, as credentialName describes. Query parameters, names that follow a ? or & (looked up at
|
|
143
182
|
// most 64 characters back), are left to the pattern above, which keeps the
|
|
@@ -149,16 +188,69 @@ const credentialPatterns: ReadonlyArray<ICredentialPattern> = [
|
|
|
149
188
|
),
|
|
150
189
|
replacement: "$1***",
|
|
151
190
|
},
|
|
191
|
+
// Environment variables whose upper-case name ends in _KEY: SSH_KEY=,
|
|
192
|
+
// DEPLOY_KEY=, SIGNING_KEY=, and SSH_KEY: in a YAML env block. KEY alone
|
|
193
|
+
// names too much to count in other names, so only an upper-case name, as
|
|
194
|
+
// environment variables are written, counts: sort_key=, cacheKey: and
|
|
195
|
+
// primary_key: keep their values. PUBLIC_KEY holds no secret and keeps its
|
|
196
|
+
// value too. Query parameters are left to the pattern for them, as above.
|
|
197
|
+
{
|
|
198
|
+
pattern: new RegExp(
|
|
199
|
+
String.raw`(\b(?<![?&][\w.-]{0,63})[A-Z0-9_]*(?<!PUBLIC)_KEY(?:[ \t]*=|:)[ \t]*)${settingValue}`,
|
|
200
|
+
"g",
|
|
201
|
+
),
|
|
202
|
+
replacement: "$1***",
|
|
203
|
+
},
|
|
152
204
|
// Credential options followed by their value: --token …, --password …,
|
|
153
|
-
// --secret
|
|
154
|
-
//
|
|
205
|
+
// --secret …, --auth-token …, --npm-token …, --api-key …, --passphrase …,
|
|
206
|
+
// --otp ….
|
|
207
|
+
// The name ends in a credential word, so --password-stdin, --token-file
|
|
208
|
+
// and --secret-id keep the argument after them, and a --no- option takes
|
|
209
|
+
// no value.
|
|
210
|
+
{
|
|
211
|
+
pattern: new RegExp(
|
|
212
|
+
String.raw`((?<![\w-])--(?!no-)${credentialName(String.raw`[\w-]`, credentialKeyEndings)}[ \t]+)${settingValue}`,
|
|
213
|
+
"gi",
|
|
214
|
+
),
|
|
215
|
+
replacement: "$1***",
|
|
216
|
+
},
|
|
217
|
+
// The password after -p in a registry login: docker login -u ci -p …,
|
|
218
|
+
// podman login -p=…. -p names a port or a path in most other commands, so
|
|
219
|
+
// it counts only after docker, podman, buildah, nerdctl or skopeo login,
|
|
220
|
+
// at most 256 characters further on the line. --password-stdin takes no
|
|
221
|
+
// value and keeps the argument after it.
|
|
155
222
|
{
|
|
156
223
|
pattern: new RegExp(
|
|
157
|
-
String.raw`(
|
|
224
|
+
String.raw`(\b(?:docker|podman|buildah|nerdctl|skopeo)[ \t]+login\b[^\n]{0,256}?[ \t]-p(?:[ \t]+|=))${settingValue}`,
|
|
158
225
|
"gi",
|
|
159
226
|
),
|
|
160
227
|
replacement: "$1***",
|
|
161
228
|
},
|
|
229
|
+
// The password in a user:password argument after -u or --user: curl -u
|
|
230
|
+
// ci:…, curl --user "ci:…". The user stays. -u names a user in curl,
|
|
231
|
+
// docker login and many other commands, but also git push -u origin and
|
|
232
|
+
// sort -u, so only a value that holds a colon counts. Two runs of digits
|
|
233
|
+
// are a uid:gid (docker run -u 1000:1000) and a value that goes on with //
|
|
234
|
+
// is a URL (-u https://host), so both keep their text. The user is at most
|
|
235
|
+
// 256 characters long.
|
|
236
|
+
{
|
|
237
|
+
pattern:
|
|
238
|
+
/((?<![\w-])(?:-u|--user)(?:[ \t]+|=))(?![0-9]{1,32}:[0-9]{1,32}(?!\S))(?:("[^:"\n]{0,256}:)[^"\n]*("?)|('[^:'\n]{0,256}:)[^'\n]*('?)|([^\s:"']{0,256}:)(?!\/\/)\S+)/g,
|
|
239
|
+
replacement: "$1$2$4$6***$3$5",
|
|
240
|
+
},
|
|
241
|
+
// .netrc entries: machine host login ci password …, on one line or across
|
|
242
|
+
// lines, default login ci password …, and machine host password … login
|
|
243
|
+
// ci. A bare password counts only with a login in the same entry, before
|
|
244
|
+
// it or right after its value, so "machine learning password policy" and
|
|
245
|
+
// "the default password is admin" keep their text. An account may stand
|
|
246
|
+
// before and after the login.
|
|
247
|
+
{
|
|
248
|
+
pattern: new RegExp(
|
|
249
|
+
String.raw`(\b(?:machine[ \t]+\S+|default)(?:\s+account[ \t]+\S+)?(?:\s+login[ \t]+\S+(?:\s+account[ \t]+\S+)?\s+password[ \t]+|\s+password[ \t]+(?=${settingValue}\s+login[ \t])))${settingValue}`,
|
|
250
|
+
"g",
|
|
251
|
+
),
|
|
252
|
+
replacement: "$1***",
|
|
253
|
+
},
|
|
162
254
|
// npm access tokens.
|
|
163
255
|
{ pattern: /\bnpm_[A-Za-z0-9]{36}\b/g, replacement: "***" },
|
|
164
256
|
// GitHub classic personal, OAuth, user, server and refresh tokens, and
|
|
@@ -184,9 +276,9 @@ const credentialPatterns: ReadonlyArray<ICredentialPattern> = [
|
|
|
184
276
|
|
|
185
277
|
/**
|
|
186
278
|
* Removes credentials from command output: private keys, URL userinfo,
|
|
187
|
-
* authorization headers, credential settings in JSON,
|
|
188
|
-
* query strings
|
|
189
|
-
* them, as listed in {@link credentialPatterns}. Git and pnpm echo remote and
|
|
279
|
+
* authorization, API key and cookie headers, credential settings in JSON,
|
|
280
|
+
* YAML, npm configuration, query strings, environment variables and options,
|
|
281
|
+
* and tokens whose shape identifies them, as listed in {@link credentialPatterns}. Git and pnpm echo remote and
|
|
190
282
|
* registry URLs in their errors, and project commands can print anything.
|
|
191
283
|
*/
|
|
192
284
|
export const redactCommandOutput = (textArg: string): string =>
|