Skip to content

Commit 13a18e6

Browse files
mbgsam-robson
authored andcommitted
Merge pull request #3807 from github/mbg/start-proxy/fix-field-names
Fix OIDC credential property names
2 parents 60991e6 + 7197c2b commit 13a18e6

File tree

6 files changed

+85
-78
lines changed

6 files changed

+85
-78
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
77
- The undocumented TRAP cache cleanup feature that could be enabled using the `CODEQL_ACTION_CLEANUP_TRAP_CACHES` environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the `trap-caching: false` input to the `init` Action. [#3795](https://github.com/github/codeql-action/pull/3795)
88
- The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. [#3789](https://github.com/github/codeql-action/pull/3789)
99
- Python analysis on GHES no longer extracts the standard library, relying instead on models of the standard library. This should result in significantly faster extraction and analysis times, while the effect on alerts should be minimal. [#3794](https://github.com/github/codeql-action/pull/3794)
10+
- Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. [#3807](https://github.com/github/codeql-action/pull/3807)
1011

1112
## 4.35.1 - 27 Mar 2026
1213

lib/start-proxy-action.js

Lines changed: 26 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/start-proxy.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -351,23 +351,23 @@ test("getCredentials throws an error when non-printable characters are used", as
351351
});
352352

353353
const validAzureCredential: startProxyExports.AzureConfig = {
354-
tenant_id: "12345678-1234-1234-1234-123456789012",
355-
client_id: "abcdef01-2345-6789-abcd-ef0123456789",
354+
"tenant-id": "12345678-1234-1234-1234-123456789012",
355+
"client-id": "abcdef01-2345-6789-abcd-ef0123456789",
356356
};
357357

358358
const validAwsCredential: startProxyExports.AWSConfig = {
359-
aws_region: "us-east-1",
360-
account_id: "123456789012",
361-
role_name: "MY_ROLE",
359+
"aws-region": "us-east-1",
360+
"account-id": "123456789012",
361+
"role-name": "MY_ROLE",
362362
domain: "MY_DOMAIN",
363-
domain_owner: "987654321098",
363+
"domain-owner": "987654321098",
364364
audience: "custom-audience",
365365
};
366366

367367
const validJFrogCredential: startProxyExports.JFrogConfig = {
368-
jfrog_oidc_provider_name: "MY_PROVIDER",
368+
"jfrog-oidc-provider-name": "MY_PROVIDER",
369369
audience: "jfrog-audience",
370-
identity_mapping_name: "my-mapping",
370+
"identity-mapping-name": "my-mapping",
371371
};
372372

373373
test("getCredentials throws an error when non-printable characters are used for Azure OIDC", (t) => {

src/start-proxy.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,22 +289,22 @@ export function getAuthConfig(
289289
// which we can use to identify them.
290290
if (isAzureConfig(config)) {
291291
return {
292-
tenant_id: config.tenant_id,
293-
client_id: config.client_id,
292+
"tenant-id": config["tenant-id"],
293+
"client-id": config["client-id"],
294294
} satisfies AzureConfig;
295295
} else if (isAWSConfig(config)) {
296296
return {
297-
aws_region: config.aws_region,
298-
account_id: config.account_id,
299-
role_name: config.role_name,
297+
"aws-region": config["aws-region"],
298+
"account-id": config["account-id"],
299+
"role-name": config["role-name"],
300300
domain: config.domain,
301-
domain_owner: config.domain_owner,
301+
"domain-owner": config["domain-owner"],
302302
audience: config.audience,
303303
} satisfies AWSConfig;
304304
} else if (isJFrogConfig(config)) {
305305
return {
306-
jfrog_oidc_provider_name: config.jfrog_oidc_provider_name,
307-
identity_mapping_name: config.identity_mapping_name,
306+
"jfrog-oidc-provider-name": config["jfrog-oidc-provider-name"],
307+
"identity-mapping-name": config["identity-mapping-name"],
308308
audience: config.audience,
309309
} satisfies JFrogConfig;
310310
} else if (isToken(config)) {

src/start-proxy/types.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ import * as types from "./types";
77
setupTests(test);
88

99
const validAzureCredential: types.AzureConfig = {
10-
tenant_id: "12345678-1234-1234-1234-123456789012",
11-
client_id: "abcdef01-2345-6789-abcd-ef0123456789",
10+
"tenant-id": "12345678-1234-1234-1234-123456789012",
11+
"client-id": "abcdef01-2345-6789-abcd-ef0123456789",
1212
};
1313

1414
const validAwsCredential: types.AWSConfig = {
15-
aws_region: "us-east-1",
16-
account_id: "123456789012",
17-
role_name: "MY_ROLE",
15+
"aws-region": "us-east-1",
16+
"account-id": "123456789012",
17+
"role-name": "MY_ROLE",
1818
domain: "MY_DOMAIN",
19-
domain_owner: "987654321098",
19+
"domain-owner": "987654321098",
2020
audience: "custom-audience",
2121
};
2222

2323
const validJFrogCredential: types.JFrogConfig = {
24-
jfrog_oidc_provider_name: "MY_PROVIDER",
24+
"jfrog-oidc-provider-name": "MY_PROVIDER",
2525
audience: "jfrog-audience",
26-
identity_mapping_name: "my-mapping",
26+
"identity-mapping-name": "my-mapping",
2727
};
2828

2929
test("credentialToStr - pretty-prints valid username+password configurations", (t) => {

src/start-proxy/types.ts

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -59,29 +59,29 @@ export function isToken(
5959
}
6060

6161
/** Configuration for Azure OIDC. */
62-
export type AzureConfig = { tenant_id: string; client_id: string };
62+
export type AzureConfig = { "tenant-id": string; "client-id": string };
6363

6464
/** Decides whether `config` is an Azure OIDC configuration. */
6565
export function isAzureConfig(
6666
config: UnvalidatedObject<AuthConfig>,
6767
): config is AzureConfig {
6868
return (
69-
"tenant_id" in config &&
70-
"client_id" in config &&
71-
isDefined(config.tenant_id) &&
72-
isDefined(config.client_id) &&
73-
json.isString(config.tenant_id) &&
74-
json.isString(config.client_id)
69+
"tenant-id" in config &&
70+
"client-id" in config &&
71+
isDefined(config["tenant-id"]) &&
72+
isDefined(config["client-id"]) &&
73+
json.isString(config["tenant-id"]) &&
74+
json.isString(config["client-id"])
7575
);
7676
}
7777

7878
/** Configuration for AWS OIDC. */
7979
export type AWSConfig = {
80-
aws_region: string;
81-
account_id: string;
82-
role_name: string;
80+
"aws-region": string;
81+
"account-id": string;
82+
"role-name": string;
8383
domain: string;
84-
domain_owner: string;
84+
"domain-owner": string;
8585
audience?: string;
8686
};
8787

@@ -91,11 +91,11 @@ export function isAWSConfig(
9191
): config is AWSConfig {
9292
// All of these properties are required.
9393
const requiredProperties = [
94-
"aws_region",
95-
"account_id",
96-
"role_name",
94+
"aws-region",
95+
"account-id",
96+
"role-name",
9797
"domain",
98-
"domain_owner",
98+
"domain-owner",
9999
];
100100

101101
for (const property of requiredProperties) {
@@ -118,30 +118,30 @@ export function isAWSConfig(
118118

119119
/** Configuration for JFrog OIDC. */
120120
export type JFrogConfig = {
121-
jfrog_oidc_provider_name: string;
121+
"jfrog-oidc-provider-name": string;
122122
audience?: string;
123-
identity_mapping_name?: string;
123+
"identity-mapping-name"?: string;
124124
};
125125

126126
/** Decides whether `config` is a JFrog OIDC configuration. */
127127
export function isJFrogConfig(
128128
config: UnvalidatedObject<AuthConfig>,
129129
): config is JFrogConfig {
130-
// The "audience" and "identity_mapping_name" fields are optional, but should be strings if present.
130+
// The "audience" and "identity-mapping-name" fields are optional, but should be strings if present.
131131
if ("audience" in config && !json.isStringOrUndefined(config.audience)) {
132132
return false;
133133
}
134134
if (
135-
"identity_mapping_name" in config &&
136-
!json.isStringOrUndefined(config.identity_mapping_name)
135+
"identity-mapping-name" in config &&
136+
!json.isStringOrUndefined(config["identity-mapping-name"])
137137
) {
138138
return false;
139139
}
140140

141141
return (
142-
"jfrog_oidc_provider_name" in config &&
143-
isDefined(config.jfrog_oidc_provider_name) &&
144-
json.isString(config.jfrog_oidc_provider_name)
142+
"jfrog-oidc-provider-name" in config &&
143+
isDefined(config["jfrog-oidc-provider-name"]) &&
144+
json.isString(config["jfrog-oidc-provider-name"])
145145
);
146146
}
147147

@@ -189,18 +189,21 @@ export function credentialToStr(credential: Credential): string {
189189
}
190190

191191
if (isAzureConfig(credential)) {
192-
appendIfDefined("Tenant", credential.tenant_id);
193-
appendIfDefined("Client", credential.client_id);
192+
appendIfDefined("Tenant", credential["tenant-id"]);
193+
appendIfDefined("Client", credential["client-id"]);
194194
} else if (isAWSConfig(credential)) {
195-
appendIfDefined("AWS Region", credential.aws_region);
196-
appendIfDefined("AWS Account", credential.account_id);
197-
appendIfDefined("AWS Role", credential.role_name);
195+
appendIfDefined("AWS Region", credential["aws-region"]);
196+
appendIfDefined("AWS Account", credential["account-id"]);
197+
appendIfDefined("AWS Role", credential["role-name"]);
198198
appendIfDefined("AWS Domain", credential.domain);
199-
appendIfDefined("AWS Domain Owner", credential.domain_owner);
199+
appendIfDefined("AWS Domain Owner", credential["domain-owner"]);
200200
appendIfDefined("AWS Audience", credential.audience);
201201
} else if (isJFrogConfig(credential)) {
202-
appendIfDefined("JFrog Provider", credential.jfrog_oidc_provider_name);
203-
appendIfDefined("JFrog Identity Mapping", credential.identity_mapping_name);
202+
appendIfDefined("JFrog Provider", credential["jfrog-oidc-provider-name"]);
203+
appendIfDefined(
204+
"JFrog Identity Mapping",
205+
credential["identity-mapping-name"],
206+
);
204207
appendIfDefined("JFrog Audience", credential.audience);
205208
}
206209

0 commit comments

Comments
 (0)