Skip to content

Add dotnet-user-jwts --file support for file-based apps - #66919

Merged
DamianEdwards merged 5 commits into
mainfrom
damianedwards/user-jwts-fba
Jun 3, 2026
Merged

DamianEdwards merged 5 commits into
mainfrom
damianedwards/user-jwts-fba

Conversation

@DamianEdwards

@DamianEdwards DamianEdwards commented May 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add a mutually exclusive --file <file_path> target option for dotnet-user-jwts file-based apps
  • Keep --project project-only and reject .cs paths with guidance to use --file
  • Resolve FBA UserSecretsId via dotnet build <file>.cs -getProperty=UserSecretsId and read <appname>.run.json audiences
  • Add tests for FBA targeting, option exclusivity, and .cs rejection through --project

Validation

  • dotnet build .\src\Tools\dotnet-user-jwts\src\dotnet-user-jwts.csproj --no-restore --nologo
  • Functional smoke test for create --file, print --file, list --project app.cs rejection, and --project/--file exclusivity
  • git diff --check

Closes #66920

@DamianEdwards
DamianEdwards marked this pull request as ready for review May 31, 2026 01:56
Copilot AI review requested due to automatic review settings May 31, 2026 01:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds --file targeting support to dotnet-user-jwts so file-based apps can be used alongside existing project-based workflows.

Changes:

  • Adds --file option plumbing and mutual exclusivity with --project.
  • Resolves file-based app UserSecretsId via dotnet build <file>.cs -getProperty=UserSecretsId.
  • Adds tests and fixture support for file-based app create/print/list scenarios.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Tools/Shared/SecretsHelpers/ProjectIdResolver.cs Adds file-based app secrets ID resolution path.
src/Tools/dotnet-user-jwts/src/Commands/ProjectCommandLineApplication.cs Adds --file option and project/file selection helper.
src/Tools/dotnet-user-jwts/src/Commands/CreateCommand.cs Routes create flow through project/file resolution.
src/Tools/dotnet-user-jwts/src/Commands/ListCommand.cs Adds file-based app support for list.
src/Tools/dotnet-user-jwts/src/Commands/PrintCommand.cs Adds file-based app support for print.
src/Tools/dotnet-user-jwts/src/Commands/RemoveCommand.cs Adds file-based app support for remove.
src/Tools/dotnet-user-jwts/src/Commands/ClearCommand.cs Adds file-based app support for clear.
src/Tools/dotnet-user-jwts/src/Commands/KeyCommand.cs Adds file-based app support for key operations.
src/Tools/dotnet-user-jwts/src/Helpers/DevJwtCliHelpers.cs Resolves file paths and reads audiences from file-based app run settings.
src/Tools/dotnet-user-jwts/src/Resources.resx Adds user-facing strings for --file and exclusivity errors.
src/Tools/dotnet-user-jwts/test/UserJwtsTests.cs Adds tests for file targeting and invalid option combinations.
src/Tools/dotnet-user-jwts/test/UserJwtsTestFixture.cs Adds file-based app test fixture creation.

DamianEdwards and others added 3 commits June 1, 2026 09:20
Add a --file target option for file-based apps while keeping --project scoped to project files. Resolve FBA user secrets metadata via dotnet build and cover the new command validation behavior in tests.

Co-authored-by: Copilot <[email protected]>
Use JSON output when asserting the generated JWT is listed for file-based apps so the test does not depend on console table wrapping.

Co-authored-by: Copilot <[email protected]>
When a file-based app is targeted, read the app's .run.json before any Properties\launchSettings.json in the same directory so generated audiences match the selected .cs file.

Co-authored-by: Copilot <[email protected]>
@DamianEdwards
DamianEdwards force-pushed the damianedwards/user-jwts-fba branch from c64bc13 to 022ebda Compare June 1, 2026 16:28
@lewing

lewing commented Jun 3, 2026

Copy link
Copy Markdown
Member

/ba-g none of the failures are related to the changes in the pr

@DamianEdwards
DamianEdwards merged commit 775c077 into main Jun 3, 2026
17 of 25 checks passed
@DamianEdwards
DamianEdwards deleted the damianedwards/user-jwts-fba branch June 3, 2026 23:53
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview6 milestone Jun 3, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support to dotnet-user-jwts for file-based apps

5 participants