GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(oauth2): auto-sync oidc-jwt-1 provider JWKs on SA key rotation by macastelaz · Pull Request #14914 · googleapis/google-cloud-java

Conversation

@macastelaz

@macastelaz macastelaz commented Nov 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

Automatically syncs the oidc-jwt-1 Workload Identity Pool Provider's static jwksJson in ITWorkloadIdentityFederationTest whenever the integration test service account ([email protected]) rotates keys bi-monthly (java_it_service_account_rotation).

Background

  • The 4 mTLS + actor_token Workload Identity Federation tests added in feat(oauth2): support certificate-bound OAuth2 tokens and mTLS rotation for Workload Identity Federation #14781 sign mock OIDC JWTs with [email protected]'s private key (GOOGLE_APPLICATION_CREDENTIALS), verified against the oidc-jwt-1 OIDC provider in gcloud-devel.
  • When it-service-account rotates keys every two months, the new private_key_id (kid) is not in oidc-jwt-1's static jwksJson, causing STS token exchange to fail with 400 Bad Request: Invalid JWT signature.
  • Because ITWorkloadIdentityFederationTest runs authenticated as [email protected]—which already holds roles/iam.workloadIdentityPoolAdmin on gcloud-devel—ensureOidcJwtProviderJwksSynced() checks once per test run whether oidc-jwt-1's jwksJson includes privateKeyId. On the first run after a key rotation, it fetches the service account's live public JWK set (https://www.googleapis.com/service_accounts/v1/jwk/<client_email>) and patches oidc-jwt-1.

See https://docs.google.com/document/d/1cjtmXb4tGZgyvTgL2hfn96KaNnAukdt6FJ8j4CV2H_k/view for more details

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
@macastelaz
test(oauth2): sign mTLS WIF OIDC test JWTs with static test key to pr…
bdacbaf
…event key-rotation breakage
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Nov 3, 2026
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the workload identity federation integration tests to use a static test private key instead of the service account's private key. It modifies the setup script to append this static key to the JWK set retrieved from Google. The review feedback suggests improving the inline Python script in the setup script by adding a timeout and using a context manager for the network request to prevent potential hangs in CI/CD pipelines.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-auth-library-java/scripts/workloadidentityfederation-setup.sh Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macastelaz
test(oauth2): auto-sync oidc-jwt-1 provider JWKs on SA key rotation
ad0db21
@macastelaz macastelaz changed the title test(oauth2): sign mTLS WIF OIDC test JWTs with static test key to prevent key-rotation breakage test(oauth2): auto-sync oidc-jwt-1 provider JWKs on SA key rotation Nov 3, 2026
@macastelaz
macastelaz marked this pull request as ready for review November 16, 2026 18:36
@macastelaz
macastelaz requested review from a team as code owners November 16, 2026 18:36
@macastelaz
Merge branch 'main' into fix-wif-mtls-test-key-rotation
60453a0
@macastelaz
macastelaz requested a review from jinseopkim0 November 16, 2026 18:36
jinseopkim0
jinseopkim0 approved these changes Nov 16, 2026
View reviewed changes
@macastelaz
macastelaz enabled auto-merge (squash) November 16, 2026 18:48
@macastelaz
macastelaz disabled auto-merge November 16, 2026 18:51
lqiu96
lqiu96 reviewed Nov 16, 2026
View reviewed changes
Comment thread ...rary-java/oauth2_http/javatests/com/google/auth/oauth2/ITWorkloadIdentityFederationTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macastelaz
test(oauth2): move OIDC JWK sync to @BeforeAll in ITWorkloadIdentityF…
6cf4f34
…ederationTest
@macastelaz macastelaz added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 17, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 17, 2026
@macastelaz
macastelaz requested a review from lqiu96 November 17, 2026 16:23
lqiu96
lqiu96 reviewed Nov 17, 2026
View reviewed changes
Comment thread ...rary-java/oauth2_http/javatests/com/google/auth/oauth2/ITWorkloadIdentityFederationTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

lqiu96
lqiu96 approved these changes Nov 17, 2026
View reviewed changes
macastelaz added 2 commits November 17, 2026 20:47
@macastelaz
test(auth): pass clientEmail and privateKeyId explicitly to ensureOid…
b8786e3
…cJwtProviderJwksSynced
@macastelaz
Merge branch 'main' into fix-wif-mtls-test-key-rotation
ace7086
@macastelaz
macastelaz enabled auto-merge (squash) November 17, 2026 22:25
@macastelaz
macastelaz merged commit 27d83f4 into googleapis:main Nov 18, 2026
304 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lqiu96 lqiu96 lqiu96 approved these changes
@jinseopkim0 jinseopkim0 jinseopkim0 approved these changes
+1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@macastelaz @lqiu96 @jinseopkim0 @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.