renovate 44.14.3 → 44.14.4
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/dist/proxy.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { addSecretForSanitizing } from "./util/sanitize.js";
|
|
1
2
|
import { logger } from "./logger/index.js";
|
|
3
|
+
import { parseUrl } from "./util/url.js";
|
|
2
4
|
import { isNonEmptyString } from "@sindresorhus/is";
|
|
3
5
|
import { createGlobalProxyAgent } from "global-agent";
|
|
4
6
|
//#region lib/proxy.ts
|
|
@@ -7,7 +9,12 @@ const envVars = [
|
|
|
7
9
|
"HTTPS_PROXY",
|
|
8
10
|
"NO_PROXY"
|
|
9
11
|
];
|
|
12
|
+
const proxyEnvVarsWithCredentials = ["HTTP_PROXY", "HTTPS_PROXY"];
|
|
10
13
|
let agent = false;
|
|
14
|
+
function sanitizeProxyCredentials(envVar) {
|
|
15
|
+
const uri = parseUrl(process.env[envVar]);
|
|
16
|
+
if (uri?.password) addSecretForSanitizing(uri.password, "global");
|
|
17
|
+
}
|
|
11
18
|
function bootstrap() {
|
|
12
19
|
envVars.forEach((envVar) => {
|
|
13
20
|
/* v8 ignore next -- env is case-insensitive on windows */
|
|
@@ -17,6 +24,7 @@ function bootstrap() {
|
|
|
17
24
|
process.env[envVar.toLowerCase()] = process.env[envVar];
|
|
18
25
|
}
|
|
19
26
|
});
|
|
27
|
+
proxyEnvVarsWithCredentials.forEach(sanitizeProxyCredentials);
|
|
20
28
|
if (isNonEmptyString(process.env.HTTP_PROXY) || isNonEmptyString(process.env.HTTPS_PROXY)) {
|
|
21
29
|
createGlobalProxyAgent({ environmentVariableNamespace: "" });
|
|
22
30
|
agent = true;
|
package/dist/proxy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","names":[],"sources":["../lib/proxy.ts"],"sourcesContent":["import { isNonEmptyString } from '@sindresorhus/is';\nimport { createGlobalProxyAgent } from 'global-agent';\nimport { logger } from './logger/index.ts';\n\nconst envVars = ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY'];\n\nlet agent = false;\n\nexport function bootstrap(): void {\n envVars.forEach((envVar) => {\n /* v8 ignore next -- env is case-insensitive on windows */\n if (\n typeof process.env[envVar] === 'undefined' &&\n typeof process.env[envVar.toLowerCase()] !== 'undefined'\n ) {\n process.env[envVar] = process.env[envVar.toLowerCase()];\n }\n\n if (process.env[envVar]) {\n logger.debug(`Detected ${envVar} value in env`);\n process.env[envVar.toLowerCase()] = process.env[envVar];\n }\n });\n\n if (\n isNonEmptyString(process.env.HTTP_PROXY) ||\n isNonEmptyString(process.env.HTTPS_PROXY)\n ) {\n createGlobalProxyAgent({\n environmentVariableNamespace: '',\n });\n agent = true;\n } else {\n // for testing only, does not reset global agent\n agent = false;\n }\n}\n\n// will be used by our http layer later\nexport function hasProxy(): boolean {\n return agent === true;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxy.js","names":[],"sources":["../lib/proxy.ts"],"sourcesContent":["import { isNonEmptyString } from '@sindresorhus/is';\nimport { createGlobalProxyAgent } from 'global-agent';\nimport { logger } from './logger/index.ts';\nimport { addSecretForSanitizing } from './util/sanitize.ts';\nimport { parseUrl } from './util/url.ts';\n\nconst envVars = ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY'];\nconst proxyEnvVarsWithCredentials = ['HTTP_PROXY', 'HTTPS_PROXY'];\n\nlet agent = false;\n\nfunction sanitizeProxyCredentials(envVar: string): void {\n const uri = parseUrl(process.env[envVar]);\n if (uri?.password) {\n addSecretForSanitizing(uri.password, 'global');\n }\n}\n\nexport function bootstrap(): void {\n envVars.forEach((envVar) => {\n /* v8 ignore next -- env is case-insensitive on windows */\n if (\n typeof process.env[envVar] === 'undefined' &&\n typeof process.env[envVar.toLowerCase()] !== 'undefined'\n ) {\n process.env[envVar] = process.env[envVar.toLowerCase()];\n }\n\n if (process.env[envVar]) {\n logger.debug(`Detected ${envVar} value in env`);\n process.env[envVar.toLowerCase()] = process.env[envVar];\n }\n });\n\n proxyEnvVarsWithCredentials.forEach(sanitizeProxyCredentials);\n\n if (\n isNonEmptyString(process.env.HTTP_PROXY) ||\n isNonEmptyString(process.env.HTTPS_PROXY)\n ) {\n createGlobalProxyAgent({\n environmentVariableNamespace: '',\n });\n agent = true;\n } else {\n // for testing only, does not reset global agent\n agent = false;\n }\n}\n\n// will be used by our http layer later\nexport function hasProxy(): boolean {\n return agent === true;\n}\n"],"mappings":";;;;;;AAMA,MAAM,UAAU;CAAC;CAAc;CAAe;AAAU;AACxD,MAAM,8BAA8B,CAAC,cAAc,aAAa;AAEhE,IAAI,QAAQ;AAEZ,SAAS,yBAAyB,QAAsB;CACtD,MAAM,MAAM,SAAS,QAAQ,IAAI,OAAO;CACxC,IAAI,KAAK,UACP,uBAAuB,IAAI,UAAU,QAAQ;AAEjD;AAEA,SAAgB,YAAkB;CAChC,QAAQ,SAAS,WAAW;;EAE1B,IACE,OAAO,QAAQ,IAAI,YAAY,eAC/B,OAAO,QAAQ,IAAI,OAAO,YAAY,OAAO,aAE7C,QAAQ,IAAI,UAAU,QAAQ,IAAI,OAAO,YAAY;EAGvD,IAAI,QAAQ,IAAI,SAAS;GACvB,OAAO,MAAM,YAAY,OAAO,cAAc;GAC9C,QAAQ,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI;EAClD;CACF,CAAC;CAED,4BAA4B,QAAQ,wBAAwB;CAE5D,IACE,iBAAiB,QAAQ,IAAI,UAAU,KACvC,iBAAiB,QAAQ,IAAI,WAAW,GACxC;EACA,uBAAuB,EACrB,8BAA8B,GAChC,CAAC;EACD,QAAQ;CACV,OAEE,QAAQ;AAEZ;AAGA,SAAgB,WAAoB;CAClC,OAAO,UAAU;AACnB"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { CombinedHostRule, HostRule } from "../types/host-rules.js";
|
|
2
2
|
import "../types/index.js";
|
|
3
3
|
//#region lib/util/host-rules.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Fields within `HostRule`s that must have their value registered for sanitising through `sanitize.addSecretForSanitizing()`.
|
|
6
|
+
*
|
|
7
|
+
* Kept in sync with `redactedFields` through tests.
|
|
8
|
+
*/
|
|
9
|
+
declare const confidentialFields: (keyof HostRule)[];
|
|
4
10
|
interface LegacyHostRule {
|
|
5
11
|
hostName?: string;
|
|
6
12
|
domainName?: string;
|
|
@@ -32,5 +38,5 @@ declare function findAll({ hostType }: {
|
|
|
32
38
|
declare function getAll(): HostRule[];
|
|
33
39
|
declare function clear(): void;
|
|
34
40
|
//#endregion
|
|
35
|
-
export { HostRuleSearch, LegacyHostRule, add, clear, find, findAll, getAll, hostType, hosts, matchesHost, migrateRule };
|
|
41
|
+
export { HostRuleSearch, LegacyHostRule, add, clear, confidentialFields, find, findAll, getAll, hostType, hosts, matchesHost, migrateRule };
|
|
36
42
|
//# sourceMappingURL=host-rules.d.ts.map
|
package/dist/util/host-rules.js
CHANGED
|
@@ -6,6 +6,18 @@ import { isHttpUrl, massageHostUrl, parseUrl } from "./url.js";
|
|
|
6
6
|
import { isFalsy, isString, isTruthy, isUndefined } from "@sindresorhus/is";
|
|
7
7
|
//#region lib/util/host-rules.ts
|
|
8
8
|
let hostRules = [];
|
|
9
|
+
/**
|
|
10
|
+
* Fields within `HostRule`s that must have their value registered for sanitising through `sanitize.addSecretForSanitizing()`.
|
|
11
|
+
*
|
|
12
|
+
* Kept in sync with `redactedFields` through tests.
|
|
13
|
+
*/
|
|
14
|
+
const confidentialFields = [
|
|
15
|
+
"password",
|
|
16
|
+
"token",
|
|
17
|
+
"httpsPrivateKey",
|
|
18
|
+
"httpsCertificate",
|
|
19
|
+
"httpsCertificateAuthority"
|
|
20
|
+
];
|
|
9
21
|
function migrateRule(rule) {
|
|
10
22
|
const cloned = clone(rule);
|
|
11
23
|
delete cloned.hostName;
|
|
@@ -28,7 +40,6 @@ function migrateRule(rule) {
|
|
|
28
40
|
}
|
|
29
41
|
function add(params) {
|
|
30
42
|
const rule = migrateRule(params);
|
|
31
|
-
const confidentialFields = ["password", "token"];
|
|
32
43
|
if (rule.matchHost) {
|
|
33
44
|
rule.matchHost = massageHostUrl(rule.matchHost);
|
|
34
45
|
rule.resolvedHost = parseUrl(rule.matchHost)?.hostname ?? rule.matchHost;
|
|
@@ -125,6 +136,6 @@ function clear() {
|
|
|
125
136
|
clearRepoSanitizedSecretsList();
|
|
126
137
|
}
|
|
127
138
|
//#endregion
|
|
128
|
-
export { add, clear, find, findAll, getAll, hostType, hosts, matchesHost, migrateRule };
|
|
139
|
+
export { add, clear, confidentialFields, find, findAll, getAll, hostType, hosts, matchesHost, migrateRule };
|
|
129
140
|
|
|
130
141
|
//# sourceMappingURL=host-rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-rules.js","names":[],"sources":["../../lib/util/host-rules.ts"],"sourcesContent":["import { isFalsy, isString, isTruthy, isUndefined } from '@sindresorhus/is';\nimport { logger } from '../logger/index.ts';\nimport type { CombinedHostRule, HostRule } from '../types/index.ts';\nimport { clone } from './clone.ts';\nimport * as sanitize from './sanitize.ts';\nimport { toBase64 } from './string.ts';\nimport { isHttpUrl, massageHostUrl, parseUrl } from './url.ts';\n\nlet hostRules: HostRule[] = [];\n\nexport interface LegacyHostRule {\n hostName?: string;\n domainName?: string;\n baseUrl?: string;\n host?: string;\n endpoint?: string;\n}\n\nexport function migrateRule(rule: LegacyHostRule & HostRule): HostRule {\n const cloned: LegacyHostRule & HostRule = clone(rule);\n delete cloned.hostName;\n delete cloned.domainName;\n delete cloned.baseUrl;\n const result: HostRule = cloned;\n\n const { matchHost } = result;\n const { hostName, domainName, baseUrl } = rule;\n const hostValues = [matchHost, hostName, domainName, baseUrl].filter(Boolean);\n if (hostValues.length === 1) {\n const [matchHost] = hostValues;\n result.matchHost = matchHost;\n } else if (hostValues.length > 1) {\n throw new Error(\n `hostRules cannot contain more than one host-matching field - use \"matchHost\" only.`,\n );\n }\n\n return result;\n}\n\nexport function add(params: HostRule): void {\n const rule = migrateRule(params);\n\n
|
|
1
|
+
{"version":3,"file":"host-rules.js","names":[],"sources":["../../lib/util/host-rules.ts"],"sourcesContent":["import { isFalsy, isString, isTruthy, isUndefined } from '@sindresorhus/is';\nimport { logger } from '../logger/index.ts';\nimport type { CombinedHostRule, HostRule } from '../types/index.ts';\nimport { clone } from './clone.ts';\nimport * as sanitize from './sanitize.ts';\nimport { toBase64 } from './string.ts';\nimport { isHttpUrl, massageHostUrl, parseUrl } from './url.ts';\n\nlet hostRules: HostRule[] = [];\n\n/**\n * Fields within `HostRule`s that must have their value registered for sanitising through `sanitize.addSecretForSanitizing()`.\n *\n * Kept in sync with `redactedFields` through tests.\n */\nexport const confidentialFields: (keyof HostRule)[] = [\n 'password',\n 'token',\n 'httpsPrivateKey',\n /* not actually sensitive, but redacted nonetheless */\n 'httpsCertificate',\n /* not actually sensitive, but redacted nonetheless */\n 'httpsCertificateAuthority',\n];\n\nexport interface LegacyHostRule {\n hostName?: string;\n domainName?: string;\n baseUrl?: string;\n host?: string;\n endpoint?: string;\n}\n\nexport function migrateRule(rule: LegacyHostRule & HostRule): HostRule {\n const cloned: LegacyHostRule & HostRule = clone(rule);\n delete cloned.hostName;\n delete cloned.domainName;\n delete cloned.baseUrl;\n const result: HostRule = cloned;\n\n const { matchHost } = result;\n const { hostName, domainName, baseUrl } = rule;\n const hostValues = [matchHost, hostName, domainName, baseUrl].filter(Boolean);\n if (hostValues.length === 1) {\n const [matchHost] = hostValues;\n result.matchHost = matchHost;\n } else if (hostValues.length > 1) {\n throw new Error(\n `hostRules cannot contain more than one host-matching field - use \"matchHost\" only.`,\n );\n }\n\n return result;\n}\n\nexport function add(params: HostRule): void {\n const rule = migrateRule(params);\n\n if (rule.matchHost) {\n rule.matchHost = massageHostUrl(rule.matchHost);\n const parsedUrl = parseUrl(rule.matchHost);\n rule.resolvedHost = parsedUrl?.hostname ?? rule.matchHost;\n confidentialFields.forEach((field) => {\n if (rule[field]) {\n logger.debug(\n // TODO: types (#22198)\n `Adding ${field} authentication for ${rule.matchHost!} (hostType=${\n rule.hostType\n }) to hostRules`,\n );\n }\n });\n }\n confidentialFields.forEach((field) => {\n const secret = rule[field];\n if (isString(secret) && secret.length > 3) {\n sanitize.addSecretForSanitizing(secret);\n }\n });\n if (rule.username && rule.password) {\n sanitize.addSecretForSanitizing(\n toBase64(`${rule.username}:${rule.password}`),\n );\n }\n hostRules.push(rule);\n}\n\nexport interface HostRuleSearch {\n hostType?: string;\n url?: string;\n readOnly?: boolean;\n}\n\nexport function matchesHost(url: string, matchHost: string): boolean {\n const parsedUrl = parseUrl(url);\n if (!parsedUrl) {\n return false;\n }\n\n const parsedMatchHost = parseUrl(matchHost);\n if (isHttpUrl(parsedUrl) && isHttpUrl(parsedMatchHost)) {\n return parsedUrl.href.startsWith(parsedMatchHost!.href);\n }\n\n const { hostname } = parsedUrl;\n if (!hostname) {\n return false;\n }\n\n if (hostname === matchHost) {\n return true;\n }\n\n const topLevelSuffix = matchHost.startsWith('.')\n ? matchHost\n : `.${matchHost}`;\n return hostname.endsWith(topLevelSuffix);\n}\n\nfunction fromShorterToLongerMatchHost(a: HostRule, b: HostRule): number {\n if (!a.matchHost || !b.matchHost) {\n return 0;\n }\n return a.matchHost.length - b.matchHost.length;\n}\n\nfunction hostRuleRank({ hostType, matchHost, readOnly }: HostRule): number {\n if ((hostType || readOnly) && matchHost) {\n return 3;\n }\n\n if (matchHost) {\n return 2;\n }\n\n if (hostType) {\n return 1;\n }\n\n return 0;\n}\n\nfunction fromLowerToHigherRank(a: HostRule, b: HostRule): number {\n return hostRuleRank(a) - hostRuleRank(b);\n}\n\nexport function find(search: HostRuleSearch): CombinedHostRule {\n if ([search.hostType, search.url].every(isFalsy)) {\n logger.warn({ search }, 'Invalid hostRules search');\n return {};\n }\n\n // Sort primarily by rank, and secondarily by matchHost length\n const sortedRules = hostRules\n .sort(fromShorterToLongerMatchHost)\n .sort(fromLowerToHigherRank);\n\n const matchedRules: HostRule[] = [];\n for (const rule of sortedRules) {\n let hostTypeMatch = true;\n let hostMatch = true;\n let readOnlyMatch = true;\n\n if (rule.hostType) {\n hostTypeMatch = false;\n // v8 ignore else -- TODO: add test #40625\n if (search.hostType === rule.hostType) {\n hostTypeMatch = true;\n }\n }\n\n if (rule.matchHost && rule.resolvedHost) {\n hostMatch = false;\n if (search.url) {\n hostMatch = matchesHost(search.url, rule.matchHost);\n }\n }\n\n if (!isUndefined(rule.readOnly)) {\n readOnlyMatch = false;\n // v8 ignore else -- TODO: add test #40625\n if (search.readOnly === rule.readOnly) {\n readOnlyMatch = true;\n hostTypeMatch = true; // When we match `readOnly`, we don't care about `hostType`\n }\n }\n\n if (hostTypeMatch && readOnlyMatch && hostMatch) {\n matchedRules.push(clone(rule));\n }\n }\n\n const res: HostRule = Object.assign({}, ...matchedRules);\n delete res.hostType;\n delete res.resolvedHost;\n delete res.matchHost;\n delete res.readOnly;\n return res;\n}\n\nexport function hosts({ hostType }: { hostType: string }): string[] {\n return hostRules\n .filter((rule) => rule.hostType === hostType)\n .map((rule) => rule.resolvedHost)\n .filter(isTruthy);\n}\n\nexport function hostType({ url }: { url: string }): string | null {\n return (\n hostRules\n .filter((rule) => rule.matchHost && matchesHost(url, rule.matchHost))\n .sort(fromShorterToLongerMatchHost)\n .map((rule) => rule.hostType)\n .filter(isTruthy)\n .pop() ?? null\n );\n}\n\nexport function findAll({ hostType }: { hostType: string }): HostRule[] {\n return hostRules.filter((rule) => rule.hostType === hostType);\n}\n\n/**\n * @returns a deep copy of all known host rules without any filtering\n */\nexport function getAll(): HostRule[] {\n return clone(hostRules);\n}\n\nexport function clear(): void {\n logger.debug('Clearing hostRules');\n hostRules = [];\n sanitize.clearRepoSanitizedSecretsList();\n}\n"],"mappings":";;;;;;;AAQA,IAAI,YAAwB,CAAC;;;;;;AAO7B,MAAa,qBAAyC;CACpD;CACA;CACA;CAEA;CAEA;AACF;AAUA,SAAgB,YAAY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;CAEjC;CAEA,MAAM,MAAgB,OAAO,OAAO,CAAC,GAAG,GAAG,YAAY;CACvD,OAAO,IAAI;CACX,OAAO,IAAI;CACX,OAAO,IAAI;CACX,OAAO,IAAI;CACX,OAAO;AACT;AAEA,SAAgB,MAAM,EAAE,YAA4C;CAClE,OAAO,UACJ,QAAQ,SAAS,KAAK,aAAa,QAAQ,CAAC,CAC5C,KAAK,SAAS,KAAK,YAAY,CAAC,CAChC,OAAO,QAAQ;AACpB;AAEA,SAAgB,SAAS,EAAE,OAAuC;CAChE,OACE,UACG,QAAQ,SAAS,KAAK,aAAa,YAAY,KAAK,KAAK,SAAS,CAAC,CAAC,CACpE,KAAK,4BAA4B,CAAC,CAClC,KAAK,SAAS,KAAK,QAAQ,CAAC,CAC5B,OAAO,QAAQ,CAAC,CAChB,IAAI,KAAK;AAEhB;AAEA,SAAgB,QAAQ,EAAE,YAA8C;CACtE,OAAO,UAAU,QAAQ,SAAS,KAAK,aAAa,QAAQ;AAC9D;;;;AAKA,SAAgB,SAAqB;CACnC,OAAO,MAAM,SAAS;AACxB;AAEA,SAAgB,QAAc;CAC5B,OAAO,MAAM,oBAAoB;CACjC,YAAY,CAAC;CACb,8BAAuC;AACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.js","names":[],"sources":["../../lib/util/sanitize.ts"],"sourcesContent":["import { isNonEmptyString } from '@sindresorhus/is';\nimport { toBase64 } from './string.ts';\n\nconst globalSecrets = new Set<string>();\nconst repoSecrets = new Set<string>();\n\nexport const redactedFields = [\n 'authorization',\n 'token',\n 'githubAppKey',\n 'npmToken',\n 'npmrc',\n 'privateKey',\n 'privateKeyOld',\n 'gitPrivateKey',\n 'forkToken',\n 'password',\n 'httpsCertificate',\n 'httpsPrivateKey',\n 'httpsCertificateAuthority',\n];\n\n// TODO: returns null or undefined only when input is null or undefined.\nexport function sanitize(input: string): string;\nexport function sanitize(\n input: string | null | undefined,\n): string | null | undefined;\nexport function sanitize(\n input: string | null | undefined,\n): string | null | undefined {\n if (!input) {\n return input;\n }\n let output: string = input;\n [globalSecrets, repoSecrets].forEach((secrets) => {\n secrets.forEach((secret) => {\n while (output.includes(secret)) {\n output = output.replace(secret, '**redacted**');\n }\n });\n });\n return output;\n}\n\nconst GITHUB_APP_TOKEN_PREFIX = 'x-access-token:';\n\nexport function addSecretForSanitizing(\n secret: string | undefined,\n type = 'repo',\n): void {\n if (!isNonEmptyString(secret)) {\n return;\n }\n const secrets = type === 'repo' ? repoSecrets : globalSecrets;\n secrets.add(secret);\n secrets.add(toBase64(secret));\n if (secret.startsWith(GITHUB_APP_TOKEN_PREFIX)) {\n const trimmedSecret = secret.replace(GITHUB_APP_TOKEN_PREFIX, '');\n secrets.add(trimmedSecret);\n secrets.add(toBase64(trimmedSecret));\n }\n}\n\nexport function clearRepoSanitizedSecretsList(): void {\n repoSecrets.clear();\n}\n\nexport function clearGlobalSanitizedSecretsList(): void {\n globalSecrets.clear();\n}\n"],"mappings":";;;AAGA,MAAM,gCAAgB,IAAI,IAAY;AACtC,MAAM,8BAAc,IAAI,IAAY;AAEpC,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"sanitize.js","names":[],"sources":["../../lib/util/sanitize.ts"],"sourcesContent":["import { isNonEmptyString } from '@sindresorhus/is';\nimport { toBase64 } from './string.ts';\n\nconst globalSecrets = new Set<string>();\nconst repoSecrets = new Set<string>();\n\nexport const redactedFields = [\n 'authorization',\n 'token',\n 'githubAppKey',\n 'npmToken',\n 'npmrc',\n 'privateKey',\n 'privateKeyOld',\n 'gitPrivateKey',\n 'forkToken',\n 'password',\n /* not actually sensitive, but redacted nonetheless */\n 'httpsCertificate',\n 'httpsPrivateKey',\n /* not actually sensitive, but redacted nonetheless */\n 'httpsCertificateAuthority',\n];\n\n// TODO: returns null or undefined only when input is null or undefined.\nexport function sanitize(input: string): string;\nexport function sanitize(\n input: string | null | undefined,\n): string | null | undefined;\nexport function sanitize(\n input: string | null | undefined,\n): string | null | undefined {\n if (!input) {\n return input;\n }\n let output: string = input;\n [globalSecrets, repoSecrets].forEach((secrets) => {\n secrets.forEach((secret) => {\n while (output.includes(secret)) {\n output = output.replace(secret, '**redacted**');\n }\n });\n });\n return output;\n}\n\nconst GITHUB_APP_TOKEN_PREFIX = 'x-access-token:';\n\nexport function addSecretForSanitizing(\n secret: string | undefined,\n type = 'repo',\n): void {\n if (!isNonEmptyString(secret)) {\n return;\n }\n const secrets = type === 'repo' ? repoSecrets : globalSecrets;\n secrets.add(secret);\n secrets.add(toBase64(secret));\n if (secret.startsWith(GITHUB_APP_TOKEN_PREFIX)) {\n const trimmedSecret = secret.replace(GITHUB_APP_TOKEN_PREFIX, '');\n secrets.add(trimmedSecret);\n secrets.add(toBase64(trimmedSecret));\n }\n}\n\nexport function clearRepoSanitizedSecretsList(): void {\n repoSecrets.clear();\n}\n\nexport function clearGlobalSanitizedSecretsList(): void {\n globalSecrets.clear();\n}\n"],"mappings":";;;AAGA,MAAM,gCAAgB,IAAI,IAAY;AACtC,MAAM,8BAAc,IAAI,IAAY;AAEpC,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;AACF;AAOA,SAAgB,SACd,OAC2B;CAC3B,IAAI,CAAC,OACH,OAAO;CAET,IAAI,SAAiB;CACrB,CAAC,eAAe,WAAW,CAAC,CAAC,SAAS,YAAY;EAChD,QAAQ,SAAS,WAAW;GAC1B,OAAO,OAAO,SAAS,MAAM,GAC3B,SAAS,OAAO,QAAQ,QAAQ,cAAc;EAElD,CAAC;CACH,CAAC;CACD,OAAO;AACT;AAEA,MAAM,0BAA0B;AAEhC,SAAgB,uBACd,QACA,OAAO,QACD;CACN,IAAI,CAAC,iBAAiB,MAAM,GAC1B;CAEF,MAAM,UAAU,SAAS,SAAS,cAAc;CAChD,QAAQ,IAAI,MAAM;CAClB,QAAQ,IAAI,SAAS,MAAM,CAAC;CAC5B,IAAI,OAAO,WAAW,uBAAuB,GAAG;EAC9C,MAAM,gBAAgB,OAAO,QAAQ,yBAAyB,EAAE;EAChE,QAAQ,IAAI,aAAa;EACzB,QAAQ,IAAI,SAAS,aAAa,CAAC;CACrC;AACF;AAEA,SAAgB,gCAAsC;CACpD,YAAY,MAAM;AACpB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "renovate",
|
|
3
3
|
"description": "Automated dependency updates. Flexible so you don't need to be.",
|
|
4
|
-
"version": "44.14.
|
|
4
|
+
"version": "44.14.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"renovate": "dist/renovate.js",
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
"graphql": "16.14.2",
|
|
268
268
|
"husky": "9.1.7",
|
|
269
269
|
"jest-extended": "7.0.0",
|
|
270
|
-
"lint-staged": "17.
|
|
270
|
+
"lint-staged": "17.3.0",
|
|
271
271
|
"markdownlint-cli2": "0.23.2",
|
|
272
272
|
"markdownlint-cli2-formatter-template": "0.0.4",
|
|
273
273
|
"memfs": "4.64.0",
|
package/renovate-schema.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$id": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
-
"title": "JSON schema for Renovate 44.14.
|
|
3
|
+
"title": "JSON schema for Renovate 44.14.4 config files (https://renovatebot.com/)",
|
|
4
4
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
-
"x-renovate-version": "44.14.
|
|
5
|
+
"x-renovate-version": "44.14.4",
|
|
6
6
|
"allowComments": true,
|
|
7
7
|
"type": "object",
|
|
8
8
|
"definitions": {
|