diff --git a/src/start-proxy.test.ts b/src/start-proxy.test.ts index 792944c09..9d2902bcc 100644 --- a/src/start-proxy.test.ts +++ b/src/start-proxy.test.ts @@ -396,13 +396,14 @@ test("credentialToStr - hides passwords", (t) => { const credential = { type: "maven_credential", password: secret, + url: "https://localhost", }; const str = startProxyExports.credentialToStr(credential); t.false(str.includes(secret)); t.is( - "Type: maven_credential; Host: undefined; Url: undefined Username: undefined; Password: true; Token: false", + "Type: maven_credential; Host: undefined; Url: https://localhost Username: undefined; Password: true; Token: false", str, ); }); @@ -412,13 +413,14 @@ test("credentialToStr - hides tokens", (t) => { const credential = { type: "maven_credential", token: secret, + url: "https://localhost", }; const str = startProxyExports.credentialToStr(credential); t.false(str.includes(secret)); t.is( - "Type: maven_credential; Host: undefined; Url: undefined Username: undefined; Password: false; Token: true", + "Type: maven_credential; Host: undefined; Url: https://localhost Username: undefined; Password: false; Token: true", str, ); }); diff --git a/src/start-proxy.ts b/src/start-proxy.ts index 4e4b62c91..755c0a40c 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -455,7 +455,7 @@ export async function getDownloadUrl( * * @param c The credential to convert to a string. */ -export function credentialToStr(c: RawCredential): string { +export function credentialToStr(c: Credential): string { return `Type: ${c.type}; Host: ${c.host}; Url: ${c.url} Username: ${ c.username }; Password: ${c.password !== undefined}; Token: ${c.token !== undefined}`;