mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Fix OIDC credential property names
This commit is contained in:
49
lib/start-proxy-action.js
generated
49
lib/start-proxy-action.js
generated
@@ -121709,15 +121709,15 @@ function isToken(config) {
|
||||
return "token" in config && isStringOrUndefined(config.token);
|
||||
}
|
||||
function isAzureConfig(config) {
|
||||
return "tenant_id" in config && "client_id" in config && isDefined2(config.tenant_id) && isDefined2(config.client_id) && isString(config.tenant_id) && isString(config.client_id);
|
||||
return "tenant-id" in config && "client-id" in config && isDefined2(config["tenant-id"]) && isDefined2(config["client-id"]) && isString(config["tenant-id"]) && isString(config["client-id"]);
|
||||
}
|
||||
function isAWSConfig(config) {
|
||||
const requiredProperties = [
|
||||
"aws_region",
|
||||
"account_id",
|
||||
"role_name",
|
||||
"aws-region",
|
||||
"account-id",
|
||||
"role-name",
|
||||
"domain",
|
||||
"domain_owner"
|
||||
"domain-owner"
|
||||
];
|
||||
for (const property of requiredProperties) {
|
||||
if (!(property in config) || !isDefined2(config[property]) || !isString(config[property])) {
|
||||
@@ -121733,10 +121733,10 @@ function isJFrogConfig(config) {
|
||||
if ("audience" in config && !isStringOrUndefined(config.audience)) {
|
||||
return false;
|
||||
}
|
||||
if ("identity_mapping_name" in config && !isStringOrUndefined(config.identity_mapping_name)) {
|
||||
if ("identity-mapping-name" in config && !isStringOrUndefined(config["identity-mapping-name"])) {
|
||||
return false;
|
||||
}
|
||||
return "jfrog_oidc_provider_name" in config && isDefined2(config.jfrog_oidc_provider_name) && isString(config.jfrog_oidc_provider_name);
|
||||
return "jfrog-oidc-provider-name" in config && isDefined2(config["jfrog-oidc-provider-name"]) && isString(config["jfrog-oidc-provider-name"]);
|
||||
}
|
||||
function credentialToStr(credential) {
|
||||
let result = `Type: ${credential.type};`;
|
||||
@@ -121760,18 +121760,21 @@ function credentialToStr(credential) {
|
||||
appendIfDefined("Token", isDefined2(credential.token) ? "***" : void 0);
|
||||
}
|
||||
if (isAzureConfig(credential)) {
|
||||
appendIfDefined("Tenant", credential.tenant_id);
|
||||
appendIfDefined("Client", credential.client_id);
|
||||
appendIfDefined("Tenant", credential["tenant-id"]);
|
||||
appendIfDefined("Client", credential["client-id"]);
|
||||
} else if (isAWSConfig(credential)) {
|
||||
appendIfDefined("AWS Region", credential.aws_region);
|
||||
appendIfDefined("AWS Account", credential.account_id);
|
||||
appendIfDefined("AWS Role", credential.role_name);
|
||||
appendIfDefined("AWS Region", credential["aws-region"]);
|
||||
appendIfDefined("AWS Account", credential["account-id"]);
|
||||
appendIfDefined("AWS Role", credential["role-name"]);
|
||||
appendIfDefined("AWS Domain", credential.domain);
|
||||
appendIfDefined("AWS Domain Owner", credential.domain_owner);
|
||||
appendIfDefined("AWS Domain Owner", credential["domain-owner"]);
|
||||
appendIfDefined("AWS Audience", credential.audience);
|
||||
} else if (isJFrogConfig(credential)) {
|
||||
appendIfDefined("JFrog Provider", credential.jfrog_oidc_provider_name);
|
||||
appendIfDefined("JFrog Identity Mapping", credential.identity_mapping_name);
|
||||
appendIfDefined("JFrog Provider", credential["jfrog-oidc-provider-name"]);
|
||||
appendIfDefined(
|
||||
"JFrog Identity Mapping",
|
||||
credential["identity-mapping-name"]
|
||||
);
|
||||
appendIfDefined("JFrog Audience", credential.audience);
|
||||
}
|
||||
return result;
|
||||
@@ -122188,22 +122191,22 @@ function getRegistryAddress(registry) {
|
||||
function getAuthConfig(config) {
|
||||
if (isAzureConfig(config)) {
|
||||
return {
|
||||
tenant_id: config.tenant_id,
|
||||
client_id: config.client_id
|
||||
"tenant-id": config["tenant-id"],
|
||||
"client-id": config["client-id"]
|
||||
};
|
||||
} else if (isAWSConfig(config)) {
|
||||
return {
|
||||
aws_region: config.aws_region,
|
||||
account_id: config.account_id,
|
||||
role_name: config.role_name,
|
||||
"aws-region": config["aws-region"],
|
||||
"account-id": config["account-id"],
|
||||
"role-name": config["role-name"],
|
||||
domain: config.domain,
|
||||
domain_owner: config.domain_owner,
|
||||
"domain-owner": config["domain-owner"],
|
||||
audience: config.audience
|
||||
};
|
||||
} else if (isJFrogConfig(config)) {
|
||||
return {
|
||||
jfrog_oidc_provider_name: config.jfrog_oidc_provider_name,
|
||||
identity_mapping_name: config.identity_mapping_name,
|
||||
"jfrog-oidc-provider-name": config["jfrog-oidc-provider-name"],
|
||||
"identity-mapping-name": config["identity-mapping-name"],
|
||||
audience: config.audience
|
||||
};
|
||||
} else if (isToken(config)) {
|
||||
|
||||
Reference in New Issue
Block a user