Archived
1
0

Format redacted arg lines

Pushing straight to main again.
This commit is contained in:
Asher 2023-05-05 14:44:40 -08:00
parent 3f7db15fde
commit 5708e6ce32
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
2 changed files with 13 additions and 13 deletions

View File

@ -433,10 +433,7 @@ export const parse = (
throw new Error("--cert-key is missing")
}
logger.debug(() => [
`parsed ${opts?.configFile ? "config" : "command line"}`,
field("args", redactArgs(args)),
])
logger.debug(() => [`parsed ${opts?.configFile ? "config" : "command line"}`, field("args", redactArgs(args))])
return args
}
@ -446,11 +443,11 @@ export const parse = (
*/
export const redactArgs = (args: UserProvidedArgs): UserProvidedArgs => {
return {
...args,
password: args.password ? "<redacted>" : undefined,
"hashed-password": args["hashed-password"] ? "<redacted>" : undefined,
"github-auth": args["github-auth"] ? "<redacted>" : undefined,
}
...args,
password: args.password ? "<redacted>" : undefined,
"hashed-password": args["hashed-password"] ? "<redacted>" : undefined,
"github-auth": args["github-auth"] ? "<redacted>" : undefined,
}
}
/**

View File

@ -182,10 +182,13 @@ export class ChildProcess extends Process {
},
this.logger,
)
this.logger.debug("got message", field("message", {
type: message.type,
args: redactArgs(message.args),
}))
this.logger.debug(
"got message",
field("message", {
type: message.type,
args: redactArgs(message.args),
}),
)
return message.args
}