Support request-scoped PAC child environments - #505
Open
Eric Lott (pa911-eric) wants to merge 8 commits into
Open
Eric Lott (pa911-eric) wants to merge 8 commits into
Eric Lott (pa911-eric) wants to merge 8 commits into
Conversation
Author
|
Pausing upstream submission while we complete local fork validation. The implementation remains available on the fork branch. |
Author
|
@microsoft-github-policy-service agree |
Eric Lott (pa911-eric)
marked this pull request as ready for review
July 15, 2026 23:48
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.
Summary
PAC authentication profiles and token-refresh state are machine/user-scoped. Concurrent PAC operations under different customer identities can therefore select or clear one another's profiles on a shared host.
This change gives hosts a request-scoped PAC child environment and removes client-secret state from Node's process-global environment. Hosts can use the supplied runtime helper to give each request a disposable PAC profile/cache root.
Changes
pacEnvironmentoverrides toRunnerParameters.createPacRuntimeEnvironmentfor disposable profile/cache roots.withPacRuntimeEnvironmentandwithPacRuntimeParametersfor guaranteed cleanup and safeRunnerParametersintegration.PAC_CLI_SPN_SECRETscoped to PAC child processes and clear it afterpac auth clear.This PR does not claim that PAC officially documents profile-directory overrides. Hosts must validate the PAC version they deploy and retain an appropriate fallback when isolation is not honored.
Validation
npm test: 84 passing.auth listprocesses passed with zero leftovers.auth listprocesses passed with zero leftovers after cleanup retries.The in-house mutex fallback is intentionally kept outside this wrapper PR because it is host policy for PAC versions that fail the isolation smoke test.