yavsc/src/Yavsc.Org
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Paul Schneider d8c13c81d7
Server: wire ProfileService so access tokens carry the name claim
The custom ProfileService (Yavsc.Services.ProfileService) was never
registered with IdentityServer, so IS8 fell back to its default
profile service — which only emits claims listed in each API
resource's UserClaims (RequestedClaimTypes). "name" was never among
them, so every access token lacked "name" and GetUserName() resolved
to null on all bearer resource hosts (Blogs/Api): the MyFiles upload
500 and the unreachable User.Identity.Name. The class was dead code;
all prior tweaks to it (FullName→UserName) and to ServiceExtensions
(MapInboundClaims=false) were necessary but insufficient until it was
actually wired in.

- HostingExtensions: AddProfileService<ProfileService>() after
  AddAspNetIdentity<ApplicationUser>().
- ProfileService: emit name=user.UserName, email, roles for any user
  grant whose client has "profile" in AllowedScopes, independent of
  the caller (the old ParsedScopes gate only fired for the id-token
  caller, never the access-token caller).
- ServiceExtensions: JwtBearer NameClaimType=JwtClaimTypes.Name,
  MapInboundClaims=false (keep short claim names as-emitted).
- FileSystemHelpers: EnsureDestinationDirectory uses GetUserName()
  (the "name" claim) instead of User.Identity.Name for the per-user
  storage root.

Tests:
- TestTokenIssuer: stamp a "name" claim = subject so test tokens mirror
  production shape (fixes FileSystemApiTests upload 500).
- Remoting: PasswordToken_carries_name_claim_equal_to_login mints a
  real JWT via the IS token endpoint (password grant, openid profile)
  and asserts the access token carries name=login and GetUserName()
  resolves to it.
- WebServerFixture: AccessTokenType=0 (Jwt in IS8; 1=Reference, the
  inverse of Duende); allow openid+profile on the test client; re-seed
  the openid/profile identity resources in ReseedAuthTestData (a
  ResetAndMigrateDatabase wipes the shared in-memory store and previously
  left them gone → invalid_scope).
- BillingServiceTests: [Collection("Yavsc Server")] to serialize with
  the host build that mutates the static BillingService/Config
  registries (pre-existing parallel race that the new test's timing
  surfaced).

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-25 20:42:54 +01:00
..
Avatars-Dev reorg 2026-02-28 21:17:54 +00:00
Bills-Dev reorg 2026-02-28 21:17:54 +00:00
Controllers Fixes the swagger ui access 2026-09-25 10:20:18 +01:00
data reorg 2026-02-28 21:17:54 +00:00
Data-Dev reorg 2026-02-28 21:17:54 +00:00
Extensions Server: wire ProfileService so access tokens carry the name claim 2026-09-25 20:42:54 +01:00
Helpers Estimate validation polish + PDF/TeX generation in Yavsc.Api 2026-09-22 03:22:01 +01:00
keys reorg 2026-02-28 21:17:54 +00:00
Migrations Gestion des fichiers utilisateur et pièces jointes (demande/devis) 2026-09-24 16:35:36 +01:00
Resources Localisation 2026-07-12 15:18:07 +01:00
Services -Config.Temp 2026-09-18 11:13:44 +01:00
Temp-Dev reorg 2026-02-28 21:17:54 +00:00
ViewComponents Estimate validation polish + PDF/TeX generation in Yavsc.Api 2026-09-22 03:22:01 +01:00
ViewModels Estimate validation polish + PDF/TeX generation in Yavsc.Api 2026-09-22 03:22:01 +01:00
Views presentation 2026-09-25 17:23:27 +01:00
wwwroot presentation 2026-09-25 17:23:27 +01:00
.eslintrc.json reorg 2026-02-28 21:17:54 +00:00
appsettings-org.json refacto site settings 2026-09-17 23:54:36 +01:00
appsettings-org.Testing.json Revert "repoduces the bug" 2026-07-11 22:17:58 +01:00
AssemblyInfo.cs test(yavsc.org): cover the kid derivation in ComputeKid 2026-07-09 20:28:58 +01:00
Contants.cs An activity interface 2026-08-30 23:55:09 +01:00
CustomModelBinder.cs using clauses cleanup 2026-08-22 03:34:48 +01:00
libman.json reorg 2026-02-28 21:17:54 +00:00
License.md reorg 2026-02-28 21:17:54 +00:00
Makefile reorg 2026-02-28 21:17:54 +00:00
noteLocalization.md reorg 2026-02-28 21:17:54 +00:00
Program.cs using clauses cleanup 2026-08-22 03:34:48 +01:00
Startup.cs -Config.Temp 2026-09-18 11:13:44 +01:00
tempkey.jwk reorg 2026-02-28 21:17:54 +00:00
Yavsc.Org.csproj CHANGELOG: add 1.0.8-rc17 section 2026-09-25 18:42:01 +01:00