You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a value in an Aspire manifest is detected as a URI or connection string format, expressions within that value should be appropriately escaped, e.g. the expressions in the following value should be URL escaped: "amqp://{resources.rabbitusr.value}:{resources.rabbitpw.value}@{resources.rabbitmq.bindings.tcp.host}:{resources.rabbitmq.bindings.tcp.port}"
The text was updated successfully, but these errors were encountered:
Would it be possible to implement a projection function for ReferenceExpression in which we can modify the values? Are there any serialization scenarios in which the Func<T,TResult> would be a problem?
Example:
/// <summary>/// Gets the connection string expression with credentials for the RabbitMQ server./// </summary>publicReferenceExpressionConnectionStringExpression{get{varencodedUserReference=UserReference.Select(value =>HttpUtility.UrlEncode(value));varencodedPasswordReference=PasswordReference.Select(value =>HttpUtility.UrlEncode(value));returnReferenceExpression.Create($"amqp://{encodedUserReference}:{encodedPasswordReference}@{PrimaryEndpoint.Property(EndpointProperty.Host)}:{PrimaryEndpoint.Property(EndpointProperty.Port)}");}}
I think the issue is the expression has to be evaluated by the reader, e.g. azd, so the encoding itself can't be implemented in the app host. Rather it needs a value written out to the manifest like amqp://{urlencode(resources.rabbitusr.value)}:{urlencode(resources.rabbitpw.value)}@{resources.rabbitmq.bindings.tcp.host}:{resources.rabbitmq.bindings.tcp.port}
See dotnet/aspire#3117
When a value in an Aspire manifest is detected as a URI or connection string format, expressions within that value should be appropriately escaped, e.g. the expressions in the following value should be URL escaped:
"amqp://{resources.rabbitusr.value}:{resources.rabbitpw.value}@{resources.rabbitmq.bindings.tcp.host}:{resources.rabbitmq.bindings.tcp.port}"
The text was updated successfully, but these errors were encountered: