dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.3k stars 9.97k forks source link

Make `dotnet-user-jwts` support custom appsettings json file #56169

Open abc-rpg opened 3 months ago

abc-rpg commented 3 months ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

I want to be able to use dotnet-user-jwts in a project that does not use appsettings.Development.json for local development. In some cases for instance, it is appsettings.Local.json.

Although it is easy to copy it into another appsettings file, it's an inconvenience since previous data gets overwritten.

Describe the solution you'd like

The current behavior can be overriden by an optional argument.

I did not think too much about naming, as I would like to see if there is interest in this.

Additional context

There was a very brief mention of the idea of disabling the configuration in the issue here https://github.com/dotnet/aspnetcore/issues/46239, but in a different context.

amcasey commented 3 months ago

Seems reasonable, if not urgent, to me. @captainsafia?

@abc-rpg In the meantime, have you tried using a symlink so the files don't get out of sync?

abc-rpg commented 3 months ago

@amcasey It would not work in my case, since the appsettings.Development.json is used in a development cloud environment (so it has the proper settings).

So currently, after using the dotnet-user-jwts tool, I copy the settings into the appsettings.Local.json and then revert the values in the appsettings.Development.json.