Repository navigation
Add credential refresh for track2 SDKs - #5124
Open
Rajdeep Chauhan (rajdeepc2792) wants to merge 4 commits into
Open
Rajdeep Chauhan (rajdeepc2792) wants to merge 4 commits into
Rajdeep Chauhan (rajdeepc2792) wants to merge 4 commits into
Conversation
Rajdeep Chauhan (rajdeepc2792)
requested review from
Caden Marchese (cadenmarchese),
cloudygreybeard,
Amber Brown (hawkowl),
Hilliary Lipsig (hlipsig),
Kevin O'Brien (kevinobriendotca),
Kipp Morris (kimorris27),
Marius Schulz (mrWinston),
Jose Gavine Cueto (pepedocs),
Rogerio Bastos (rogbas),
Ankur Singh (sankur-codes),
Miguel Abad Perez (tiguelu),
Tanmay Satam (tsatam),
Andrew Denton (ventifus),
Haoran Wang (wanghaoran1988) and
Jeff Yuan (yjst2012)
as code owners
October 5, 2026 21:08
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Track 2 client pipelines retain their cached access tokens after the wrapped credential is rebuilt, preventing the intended authorization refresh.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds coordinated credential rebuilding for Track 1 and Track 2 Azure SDK clients during authorization retries.
Changes:
- Introduces refreshable token credentials and multi-credential rebuilding.
- Wires cluster authorization retries to refresh all FP credentials.
- Adds credential rebuild tests and updates step expectations.
| File | Description |
|---|---|
pkg/util/steps/refreshing.go |
Generalizes retries to rebuild credentials. |
pkg/util/refreshable/refreshable.go |
Adds refreshable Track 2 credentials. |
pkg/util/refreshable/refreshable_test.go |
Tests rebuild behavior. |
pkg/cluster/install.go |
Uses coordinated credential refreshing. |
pkg/cluster/cluster.go |
Constructs and wires refreshable credentials. |
pkg/cluster/adminupdate_test.go |
Updates expected step type. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot started reviewing on behalf of
Rajdeep Chauhan (rajdeepc2792)
October 5, 2026 22:20
View session
Rajdeep Chauhan (rajdeepc2792)
force-pushed
the
rajdeepc2792/ARO-30032
branch
from
October 6, 2026 19:16
2b3eca3 to
c23c81a
Compare
Copilot started reviewing on behalf of
Rajdeep Chauhan (rajdeepc2792)
October 6, 2026 19:17
View session
Rajdeep Chauhan (rajdeepc2792)
force-pushed
the
rajdeepc2792/ARO-30032
branch
from
October 7, 2026 00:18
c23c81a to
65270ce
Compare
Copilot started reviewing on behalf of
Rajdeep Chauhan (rajdeepc2792)
October 7, 2026 00:19
View session
Tanmay Satam (tsatam)
approved these changes
Oct 7, 2026
Tanmay Satam (tsatam)
left a comment
Member
There was a problem hiding this comment.
LGTM. One optional suggestion to split the refreshable file to isolate track1 and track2 refreshable implementations from each other.
Rajdeep Chauhan (rajdeepc2792)
force-pushed
the
rajdeepc2792/ARO-30032
branch
from
October 7, 2026 15:31
65270ce to
bb68b81
Compare
Copilot started reviewing on behalf of
Rajdeep Chauhan (rajdeepc2792)
October 7, 2026 15:32
View session
Copilot started reviewing on behalf of
Rajdeep Chauhan (rajdeepc2792)
October 7, 2026 16:13
View session
Adam Price (komidore64)
approved these changes
Oct 8, 2026
Kipp Morris (kimorris27)
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Refresh Token for track2 sdk BearerTokenPolicy flow per client:
flowchart LR A["BearerTokenPolicy cache<br/>per client pipeline"] -->|"defeated by<br/>ExpiresOn = zero"| B["our GetToken called<br/>on every request"] B --> C["azidentity / MSAL cache<br/>per credential"] C -->|".....same JWT until..."| D["Rebuild() throws<br/>credential away"] D -->|"→ new JWT"| CTesting Approach
Which issue this PR addresses:
Fixes https://issues.redhat.com/browse/ARO-30032
What this PR does / why we need it:
refreshable.NewFPTokenCredentialwraps the credential soRebuild()discards it and its token cache, andfpCredRefresherrebuilds the track1 authorizer plus both track2 FP credentials together.AuthorizationRetryingActionnow takes arefreshable.Rebuilderand drives that refresher, so each auth retry presents a genuinely new token and ARM re-evaluates current role assignments.ensureResourceGroupis promoted fromsteps.ActiontoAuthorizationRetryingAction.Test plan for issue:
pkg/util/refreshablecovering credential rebuild (new token per rebuild), rebuild failure leaving the previous credential usable, andNewMultiRebuilderordering/short-circuit on error.pkg/util/stepsandpkg/clustersuites pass;pkg/cluster/adminupdate_test.goupdated for theensureResourceGroupstep type change.Is there any documentation that needs to be updated for this PR?
No — internal credential-handling fix with no API, config, or operator-facing surface change.
How do you know this will function as expected in production?
The retry path is unchanged apart from the credential rebuild, and the existing
AuthorizationRetryingActionlogging already records each auth retry; a rebuild failure is logged and surfaced as the step error rather than being swallowed.A failed
Rebuild()leaves the prior credential in place, so the worst case is the current behavior rather than a broken client.