Group OIDC schemas into an array

This commit is contained in:
Michael B. Gale
2026-04-25 17:07:33 +01:00
parent 2acf81942b
commit 530fcb3bbf
6 changed files with 51 additions and 52 deletions
+8 -7
View File
@@ -30,13 +30,14 @@ export function getAuthConfig(
): AuthConfig {
// Start by checking for the OIDC configurations, since they have required properties
// which we can use to identify them.
if (types.isAzureConfig(config)) {
return cloneCredential(types.azureConfigSchema, config);
} else if (types.isAWSConfig(config)) {
return cloneCredential(types.awsConfigSchema, config);
} else if (types.isJFrogConfig(config)) {
return cloneCredential(types.jfrogConfigSchema, config);
} else if (types.isToken(config)) {
for (const oidcSchema of types.oidcSchemas) {
if (json.validateSchema(oidcSchema.schema, config)) {
return cloneCredential(oidcSchema.schema, config);
}
}
// Otherwise, try the basic configuration types.
if (types.isToken(config)) {
// There are three scenarios for non-OIDC authentication based on the registry type:
//
// 1. `username`+`token`