-
Notifications
You must be signed in to change notification settings - Fork 7
Fix blueprint idempotency and JWT token exposure in console output #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
- Blueprint discovery: Always use displayName from a365.config.json as source of truth * Removed cached objectId lookup to fix bug where displayName changes were ignored * Simplified dual-path discovery to single displayName-first approach * Lines affected: BlueprintSubcommand.cs:547-578 - JWT security: Filter Microsoft Graph tokens from console output * Debug logging when tokens are filtered (visible with --verbose) * Lines affected: CommandExecutor.cs:237-289 - Tests: Added regression tests for both fixes
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.
Pull request overview
This pull request addresses two important issues: blueprint idempotency when displayName changes and JWT token exposure in console output.
Key Changes:
- Simplified blueprint discovery to always use displayName from a365.config.json as the source of truth, removing the previous objectId-first fallback approach
- Added JWT token filtering in CommandExecutor to prevent sensitive Microsoft Graph tokens from being printed to console
- Comprehensive regression tests for both fixes
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| CommandExecutor.cs | Added IsJwtToken() method with heuristic detection and filtering logic in ExecuteWithStreamingAsync to prevent JWT tokens from being printed to console while still capturing them in StandardOutput |
| CommandExecutorTests.cs | Added comprehensive regression tests for JWT token detection covering valid tokens, invalid formats, edge cases, null/empty handling, and integration with ExecuteWithStreamingAsync |
| BlueprintSubcommand.cs | Changed CreateAgentBlueprintAsync to use displayName-first discovery exclusively, removing the previous objectId-first lookup to fix idempotency bug when users change displayName in config |
| BlueprintLookupServiceTests.cs | Added regression test for displayName mismatch scenario to verify that searching by new displayName correctly returns NotFound |
| BlueprintSubcommandTests.cs | Added note explaining removal of complex regression tests, relying on existing integration tests and service-level tests instead |
src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Services/CommandExecutorTests.cs
Show resolved
Hide resolved
src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Services/CommandExecutorTests.cs
Outdated
Show resolved
Hide resolved
mengyimicro
reviewed
Jan 9, 2026
src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Commands/BlueprintSubcommandTests.cs
Outdated
Show resolved
Hide resolved
mengyimicro
previously approved these changes
Jan 9, 2026
Updated comments in CommandExecutor.cs to clarify that only standalone JWT tokens are filtered, not tokens embedded in log messages, and explained the rationale. Removed obsolete regression test comments from BlueprintSubcommandTests.cs. Simplified IsJwtToken invalid format tests in CommandExecutorTests.cs for clarity.
mengyimicro
approved these changes
Jan 9, 2026
joratz
approved these changes
Jan 9, 2026
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.
Blueprint discovery: Always use displayName from a365.config.json as source of truth
JWT security: Filter Microsoft Graph tokens from console output
Tests: Added regression tests for both fixes