Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
abc-rpg opened this issue Jun 10, 2024 · 2 comments · May be fixed by #58605
Open
1 task done

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

abc-rpg opened this issue Jun 10, 2024 · 2 comments · May be fixed by #58605
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI feature-userjwts The `dotnet user-jwts` CLI tool

Comments

@abc-rpg
Copy link

abc-rpg commented Jun 10, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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.

  • Option 1: An argument to specify appsettings file
dotnet user-jwts create --configurationFile appsettings.Local.json
  • Option 2: An argument to specify environment, then infer the file name (appsettings.{env}.json)
dotnet user-jwts create --environment Local
  • Option 3: Skip writing to the appsettings file, and output the configuration to the console instead, for manual copying.
dotnet user-jwts create --disable-auto-config

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 #46239, but in a different context.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jun 10, 2024
@martincostello martincostello added area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI and removed area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions labels Jun 10, 2024
@amcasey
Copy link
Member

amcasey commented Jun 27, 2024

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
Copy link
Author

abc-rpg commented Jun 28, 2024

@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.

@captainsafia captainsafia added the feature-userjwts The `dotnet user-jwts` CLI tool label Aug 14, 2024
ChrisAnn added a commit to ChrisAnn/aspnetcore that referenced this issue Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI feature-userjwts The `dotnet user-jwts` CLI tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants