aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Make username parameter always be injected.

Open mitchdenny opened this issue 1 year ago • 3 comments
trafficstars

Fixes #4100 and #4099

This PR does a few things:

  1. Changes the PgAdmin config writer hook to use the password from UserNameParameter on the Postgres server resource.
  2. Changes the UserNameParameter on the postgres server resource to be non-nullable and adjust in the constructor as well.

The reason for this change is that if you want to use the Postgres database resource from a container that is not built around .NET, the connection string format that the resource exposes won't necessarily be in the format that you want. For that reason you want to be able to get at the username and password parameters and know that they are always there. The password parameter is fine, but the fact that the username parameter is optional is problematic and makes consuming code more complex.

This represents a breaking change ... see unshipped API diff.

Microsoft Reviewers: Open in CodeFlow

mitchdenny avatar May 07 '24 08:05 mitchdenny

We should be able to finish this now.

davidfowl avatar Sep 22 '24 05:09 davidfowl

@mitchdenny I think this is worth doing but not sure it's critical for 9. There's another PR from a contributor here https://github.com/dotnet/aspire/pull/5805

davidfowl avatar Sep 30 '24 16:09 davidfowl

Yeah can punt this one.

mitchdenny avatar Oct 02 '24 01:10 mitchdenny