mirror of
https://github.com/github/codeql-action.git
synced 2026-05-01 11:20:11 +00:00
Group OIDC schemas into an array
This commit is contained in:
Generated
+11
-7
@@ -122045,6 +122045,11 @@ var jfrogConfigSchema = {
|
||||
function isJFrogConfig(config) {
|
||||
return validateSchema(jfrogConfigSchema, config);
|
||||
}
|
||||
var oidcSchemas = [
|
||||
{ schema: azureConfigSchema, name: "Azure" },
|
||||
{ schema: awsConfigSchema, name: "AWS" },
|
||||
{ schema: jfrogConfigSchema, name: "JFrog" }
|
||||
];
|
||||
function credentialToStr(credential) {
|
||||
let result = `Type: ${credential.type};`;
|
||||
const appendIfDefined = (name, val) => {
|
||||
@@ -122107,13 +122112,12 @@ function cloneCredential(schema2, obj) {
|
||||
return result;
|
||||
}
|
||||
function getAuthConfig(config) {
|
||||
if (isAzureConfig(config)) {
|
||||
return cloneCredential(azureConfigSchema, config);
|
||||
} else if (isAWSConfig(config)) {
|
||||
return cloneCredential(awsConfigSchema, config);
|
||||
} else if (isJFrogConfig(config)) {
|
||||
return cloneCredential(jfrogConfigSchema, config);
|
||||
} else if (isToken(config)) {
|
||||
for (const oidcSchema of oidcSchemas) {
|
||||
if (validateSchema(oidcSchema.schema, config)) {
|
||||
return cloneCredential(oidcSchema.schema, config);
|
||||
}
|
||||
}
|
||||
if (isToken(config)) {
|
||||
if (isDefined2(config.token)) {
|
||||
core8.setSecret(config.token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user