Draft
fix: throw on missing accessToken instead of returning "******"#9418
Conversation
…ilable Fixes review comment r3597382245: getAuthorizationToken now throws a descriptive error when authData.accessToken is falsy, preventing the literal string '******' from being returned and sent as an Authorization header. Adds getAuthorizationToken.test.ts with the corrected test for the no-accessToken case (expects throw, not '******').
Copilot
AI
changed the title
[WIP] Fix the code based on review comment
fix: throw on missing accessToken instead of returning "******"
Jul 17, 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.
getAuthorizationTokenused a bare template literal****** with no null-guard, silently returning"******"` when no session token was available. This invalid header value was being baked into tests as expected behavior and could propagate to downstream ARM requests via the new periodic token-refresh path.Changes
getAuthorizationToken.tsauthData?.accessTokenis falsy, throw a localized error instead of producing"******"Promise<string>— no callers require updates__test__/getAuthorizationToken.test.ts(new)getAuthorizationToken,getAuthorizationTokenFromNode, andgetCloudHost'******'as the expected return value now correctly asserts a throw with the specific error messageCommit Type
Risk Level
What & Why
Guards against
getAuthorizationTokenreturning"******"when no access token is available. The bug was introduced silently via an unguarded template literal; the companion test was asserting the broken behavior rather than catching it.Impact of Change
getAuthorizationTokennow throws if the session has noaccessToken; callers already intry/catch(e.g. the periodic refresh inopenDesignerForLocalProject) are unaffectedTest Plan
apps/vs-code-designer— 1348 tests pass)Contributors
Screenshots/Videos