dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.81k stars 452 forks source link

`TransportOptionsValidator` doesn't validate properly if AllowUnsecuredTransport=true #6515

Open JamesNK opened 3 days ago

JamesNK commented 3 days ago

Is there an existing issue for this?

Describe the bug

If AllowUsecuredTransport=true then TransportOptionsValidator stops validating the address. For example, there is no validation that no value is specified if AllowUsecuredTransport=true.

https://github.com/dotnet/aspire/blob/08dd9928cdf483947fd01d35ea77e8cd5d1294a2/src/Aspire.Hosting/Dashboard/TransportOptionsValidator.cs#L14-L16

Expected Behavior

AllowUsecuredTransport=true only impacts validating whether the transport is secure or not.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

No response

JamesNK commented 3 days ago

TransportOptionsValidator is doing more than validating TransportOptions. It also validates a bunch of transport related environment variables.