Skip to content

Commit dba74ad

Browse files
committed
Register credentials extracted from proxy configuration as secrets to mask in logs
1 parent 466d6ce commit dba74ad

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

lib/start-proxy.js

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/start-proxy.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import * as core from "@actions/core";
2+
13
import { parseLanguage, Language } from "./languages";
24
import { Logger } from "./logging";
35
import { ConfigurationError } from "./util";
@@ -63,6 +65,14 @@ export function getCredentials(
6365

6466
const out: Credential[] = [];
6567
for (const e of parsed) {
68+
// Mask credentials to reduce change of accidental leakage in logs.
69+
if (e.password !== undefined) {
70+
core.setSecret(e.password);
71+
}
72+
if (e.token !== undefined) {
73+
core.setSecret(e.token);
74+
}
75+
6676
if (e.url === undefined && e.host === undefined) {
6777
// The proxy needs one of these to work. If both are defined, the url has the precedence.
6878
throw new ConfigurationError(

0 commit comments

Comments
 (0)