Skip to content

Add Graph authentication isolation profile#418

Merged
PrzemyslawKlys merged 1 commit into
mainfrom
codex/graph-auth-isolation
Jun 2, 2026
Merged

Add Graph authentication isolation profile#418
PrzemyslawKlys merged 1 commit into
mainfrom
codex/graph-auth-isolation

Conversation

@PrzemyslawKlys
Copy link
Copy Markdown
Member

Summary

  • add a built-in MicrosoftGraphAuthentication isolation profile for Import-IsolatedModule
  • teach module isolation profiles how to skip source bootstrap lines, load dependency assemblies into the profile ALC, clear manifest NestedModules, and remove copied Authenticode signature blocks after patching
  • preserve the Graph Authentication command surface with explicit cmdlet and alias exports so Graph binaries do not have to be rediscovered by path in the default load context

Why

Microsoft.Graph.Authentication can collide with assemblies already loaded by hosts such as the VS Code PowerShell extension, especially in sessions where other assembly-loading modules such as DLLPickle are present. The profile keeps Graph/Kiota/Auth assemblies in the module-specific ALC instead of loading them into AssemblyLoadContext.Default.

Validation

  • dotnet test .\PowerForge.Tests\PowerForge.Tests.csproj -c Release --filter "ModuleIsolation|IsolatedModule"
  • dotnet build .\PSPublishModule\PSPublishModule.csproj -c Release
  • git diff --check
  • live smoke with local Microsoft.Graph.Authentication 2.37.0: 18 commands exported, Get-MgContext resolves from Microsoft.Graph.Authentication.ALC, default Graph assembly count stays 0
  • live smoke with DLLPickle 2.2.0 imported first and Microsoft.Graph.Authentication 2.36.1 loaded by explicit path: 18 commands exported, Get-MgContext resolves from Microsoft.Graph.Authentication.ALC, default Graph assembly count stays 0

Notes

A full unfiltered PowerForge.Tests project run was started but stayed silent after discovery for over two minutes, so it was stopped. The focused isolation tests, multi-target module build, and live Graph/DLLPickle smoke checks passed.

@PrzemyslawKlys PrzemyslawKlys merged commit e018bc4 into main Jun 2, 2026
6 checks passed
@PrzemyslawKlys PrzemyslawKlys deleted the codex/graph-auth-isolation branch June 2, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant