Skip to content

Conversation

@sebastienros
Copy link
Member

@sebastienros sebastienros commented Oct 20, 2025

Description

Updates the manifest format to provide the information about each ReferenceExpression format.

Fixes #3117

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 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 -- 12216

Or

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

@sebastienros sebastienros marked this pull request as ready for review October 20, 2025 20:23
Copilot AI review requested due to automatic review settings October 20, 2025 20:23
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 updates the manifest generation to include information about formatting applied to ReferenceExpression values, specifically introducing a new annotated.string resource type that captures URI encoding transformations. The change ensures that password parameters used in connection strings are properly represented in the manifest with their encoding format.

Key Changes:

  • Enhanced manifest publishing to track and generate formatted parameter resources
  • Updated connection strings to reference URI-encoded parameter variants
  • Introduced annotated.string resource type with filter field in manifests

Reviewed Changes

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

Show a summary per file
File Description
src/Aspire.Hosting/Publishing/ManifestPublishingContext.cs Core implementation of formatted parameter tracking and manifest generation
tests/Aspire.Hosting.Tests/ManifestGenerationTests.cs Updated test expectations to include URI-encoded password references
tests/Aspire.Hosting.RabbitMQ.Tests/AddRabbitMQTests.cs Updated RabbitMQ manifest test expectations for URI-encoded credentials
tests/Aspire.Hosting.Nats.Tests/AddNatsTests.cs Updated NATS manifest test expectations for URI-encoded credentials
tests/Aspire.Hosting.MongoDB.Tests/AddMongoDBTests.cs Updated MongoDB manifest test expectations for URI-encoded credentials
playground/*/aspire-manifest.json Multiple playground manifests updated to use URI-encoded password references

@sebastienros
Copy link
Member Author

Do we want to add a switch to revert to the previous behavior in order not to break existing tooling?

foreach (var (format, resourceName) in formats)
{
Writer.WriteStartObject(resourceName);
Writer.WriteString("type", "annotated.string");
Copy link
Member Author

Choose a reason for hiding this comment

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

A better name may look like parameter.filter.v0 to match what has been used so far.

Comment on lines +343 to +359
{
"type": "object",
"description": "Represents a formatted projection of a parameter value, produced by applying the specified filter to the parameter.",
"required": [ "type", "value", "filter" ],
"properties": {
"type": {
"const": "annotated.string"
},
"value": {
"$ref": "#/definitions/value"
},
"filter": {
"$ref": "#/definitions/annotatedStringFilter"
}
},
"additionalProperties": false
},
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the new section compared to aspire-8.0.json

Copy link
Contributor

@vhvb1989 vhvb1989 left a comment

Choose a reason for hiding this comment

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

🤖💝

@davidfowl davidfowl merged commit c046e6f into main Oct 22, 2025
302 checks passed
@davidfowl davidfowl deleted the sebros/manifestformats branch October 22, 2025 02:38
@dotnet-policy-service dotnet-policy-service bot added this to the 13.0 milestone Oct 22, 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.

Usernames and passwords in connection strings aren't escaped

4 participants