Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 30, 2025

Test data in ExpressionResolverTests.cs contained fake passwords (Password=xxx;) that trigger credential scanning tools, though the tests validate hostname resolution, not authentication.

Changes

  • Removed Password=xxx; from 6 InlineData attributes on HostUrlPropertyGetsResolved test method (lines 156-161)

The test validates that localhost/127.0.0.1/[::1] gets replaced with aspire.dev.internal in connection strings when targeting containers. Password fields are irrelevant to this validation.

Before:

[InlineData(false, "Server=localhost,1433;User ID=sa;Password=xxx;Database=yyy", "Server=localhost,1433;User ID=sa;Password=xxx;Database=yyy")]

After:

[InlineData(false, "Server=localhost,1433;User ID=sa;Database=yyy", "Server=localhost,1433;User ID=sa;Database=yyy")]
Original prompt

In ExpressionResolverTests.cs file some of the InlineData attributes on HostUrlPropertyGetsResolved contain a fake password (Password=xxx;). I think this is unnecessary and causes problems with tools that are scanning the code for credentials. Can you prepare a PR that removes these fake passwords from the test data? Leave everything else as-is.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: karolz-ms <15271049+karolz-ms@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove fake passwords from test data in ExpressionResolverTests Remove fake passwords from ExpressionResolverTests test data Oct 30, 2025
Copilot AI requested a review from karolz-ms October 30, 2025 17:48
Copilot finished work on behalf of karolz-ms October 30, 2025 17:48
@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12525

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12525"

@karolz-ms karolz-ms marked this pull request as ready for review October 30, 2025 20:17
@karolz-ms karolz-ms requested a review from mitchdenny as a code owner October 30, 2025 20:17
Copy link
Contributor

Copilot AI left a 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 PR removes password information from SQL Server connection string test data. The changes eliminate the Password=xxx; parameter from six test cases to avoid exposing sensitive credential patterns in test code.

Key Changes

  • Removed Password=xxx; from SQL Server connection string test data across all scenarios (localhost, 127.0.0.1, and [::1])
  • Maintains test coverage for host URL resolution in both container and non-container contexts

@karolz-ms
Copy link
Member

#12521 will take care of this

@karolz-ms karolz-ms closed this Oct 30, 2025
@dotnet-policy-service dotnet-policy-service bot added this to the 13.0 milestone Oct 30, 2025
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.

2 participants