More debugging of credentials

This commit is contained in:
Marco Gario 2024-08-13 13:31:10 +00:00
parent 3b3012e891
commit e4afb79aeb
3 changed files with 10 additions and 3 deletions

View file

@ -37,6 +37,9 @@ const UPDATEJOB_PROXY_URL = "https://github.com/github/codeql-action/releases/do
const PROXY_USER = "proxy_user";
const KEY_SIZE = 2048;
const KEY_EXPIRY_YEARS = 2;
function CredentialToStr(c) {
return `Type: ${c.type}; Host: ${c.host}; Username: ${c.username}; Password: ${c.password !== undefined}; Token: ${c.token !== undefined}`;
}
const CERT_SUBJECT = [
{
name: "commonName",
@ -87,7 +90,7 @@ async function runWrapper() {
core.saveState("proxy-log-file", proxyLogFilePath);
// Get the configuration options
const credentials = getCredentials();
logger.debug(`Credentials loaded for the following URLs:\n ${credentials.map(c => c.host).join("\n")}`);
logger.info(`Credentials loaded for the following URLs:\n ${credentials.map(c => CredentialToStr(c)).join("\n")}`);
const ca = generateCertificateAuthority();
const proxyAuth = getProxyAuth();
const proxyConfig = {

File diff suppressed because one or more lines are too long

View file

@ -30,6 +30,10 @@ export type Credential = {
token?: string;
};
function CredentialToStr(c: Credential): string {
return `Type: ${c.type}; Host: ${c.host}; Username: ${c.username}; Password: ${c.password !== undefined}; Token: ${c.token !== undefined}`
}
export type BasicAuthCredentials = {
username: string;
password: string;
@ -99,7 +103,7 @@ async function runWrapper() {
// Get the configuration options
const credentials = getCredentials();
logger.debug(`Credentials loaded for the following URLs:\n ${credentials.map(c => c.host).join("\n")}`)
logger.info(`Credentials loaded for the following URLs:\n ${credentials.map(c => CredentialToStr(c)).join("\n")}`);
const ca = generateCertificateAuthority();
const proxyAuth = getProxyAuth();