Skip to content

Fix dev-certs EventSource Boolean payload - #68138

Open
HengYpinn wants to merge 1 commit into
dotnet:mainfrom
HengYpinn:fix-29541-certificate-eventsource-payload
Open

Fix dev-certs EventSource Boolean payload#68138
HengYpinn wants to merge 1 commit into
dotnet:mainfrom
HengYpinn:fix-29541-certificate-eventsource-payload

Conversation

@HengYpinn

Copy link
Copy Markdown
  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Fix the dev-certs EventSource Boolean payload

Description

CertificateManagerEventSource.ExportCertificateStart declares includePrivateKey as a Boolean, but passed "with" or "without" to WriteEvent. EventSource consumers therefore received a string payload that did not match the event contract.

This change writes the Boolean value directly, updates the event message to format that value, and adds regression coverage for both true and false payloads.

Testing

.\.dotnet\dotnet.exe test .\src\Shared\test\Shared.Tests\Microsoft.AspNetCore.Shared.Tests.csproj --no-build --no-restore --verbosity minimal

Passed: 1,329; Failed: 0; Skipped: 0.

Fixes #29541

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jul 31, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @HengYpinn. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@HengYpinn
HengYpinn marked this pull request as ready for review July 31, 2026 15:32
Copilot AI review requested due to automatic review settings July 31, 2026 15:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an EventSource contract mismatch in CertificateManagerEventSource.ExportCertificateStart where a bool parameter was emitted as a string payload, ensuring consumers receive the expected Boolean value.

Changes:

  • Update ExportCertificateStart to write the includePrivateKey Boolean directly to WriteEvent.
  • Adjust the event message format to reflect the Boolean payload.
  • Add regression tests validating the payload type/value for both true and false.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Shared/CertificateGeneration/CertificateManager.cs Corrects EventSource payload type for ExportCertificateStart and updates the message format accordingly.
src/Shared/test/Shared.Tests/CertificateManagerEventSourceTests.cs Adds regression coverage to validate the event payload includes a Boolean for includePrivateKey and isolates tests via a non-parallelized collection.

@HengYpinn

Copy link
Copy Markdown
Author

@dotnet-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CertificateManagerEventSource Has Incorrectly Authored Events

2 participants