Move credentialToStr and add tests

This commit is contained in:
Michael B. Gale
2026-01-29 10:07:51 +00:00
parent b2ff80ddac
commit 2a384c1c14
4 changed files with 32 additions and 9 deletions
+11
View File
@@ -277,3 +277,14 @@ export async function getDownloadUrl(
version: UPDATEJOB_PROXY_VERSION,
};
}
/**
* Pretty-prints a `Credential` value to a string, but hides the actual password or token values.
*
* @param c The credential to convert to a 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}`;
}