Commit graph

24 commits

Author SHA1 Message Date
dcf2a93ad0 Split Site:Audience into Site:ExternalUrl + Site:CorsAllowedOrigins
The Site:Audience setting was conflating two distinct concepts: an OAuth
JWT audience (a single resource identifier) and a CORS allow-list (an
array of origins). Collapsing them caused several latent bugs:
- OAuth/JWT validation expected a single string while CORS WithOrigins
  accepts an array.
- Password-reset callback URLs and OAuth client RedirectUri/Origin were
  being built from what was meant to be an audience identifier, not a
  base URL.
- Yavsc.Org's main CORS policy was hardcoded to '*', with no way to
  restrict it without code changes.

Changes:
- SiteSettings.Audience (string) replaced with CorsAllowedOrigins
  (IList<string>).
- OAuth JWT Authority still reads Site:Authority; Audience now reads
  Site:ExternalUrl (Org only; Api/Blogs use ValidateAudience=false).
- MailSender and AccountController build reset-callback URLs from
  Site:ExternalUrl.
- ClientController uses Site:ExternalUrl for OAuth RedirectUri/Origin
  defaults on newly created clients.
- Yavsc.Api and Yavsc.Blogs now read CORS origins from
  Site:CorsAllowedOrigins instead of hardcoded URLs.

Add shared AddYavscCors / AddYavscJwtBearer extension methods in
Yavsc.Server/Helpers/ServiceExtensions.cs to enforce a single
configuration contract across all runtime services (Api, Blogs, Org).
Fails closed when CorsAllowedOrigins is empty; fails fast at startup
when Site:Authority is missing.

Remove obsolete ConfigurationHelpers.GetAudience (no remaining callers).

Local appsettings-*.json files (which carry deployment-specific values
and are gitignored) must be updated to add Site:CorsAllowedOrigins.
2026-06-19 13:15:21 +01:00
8a46341755 a scoring model 2026-05-24 19:35:35 +01:00
6cc0c519d2 tests OK 2026-04-20 00:35:51 +01:00
87d62791b8 fix: test infrastructure with in-memory DB, SMTP mocking, and thread-safe billing configuration
- Add in-memory database support for test isolation in WebServerFixture
- Implement TestMailSender fake SMTP provider for email test support
- Add thread synchronization to billing service registration to prevent race conditions
- Make RegisterBilling<T> idempotent to safely handle reconfiguration
- Configure test environment via in-memory settings (UseTestEmailSender, UseInMemoryDatabase)
- Add regression tests for billing module idempotency and duplicate registration detection
- Fix tests: EMaillingTests.SendEMailSynchrone, BillingServiceTests (2 tests), HaveConfigurationRoot (3 tests)

All core test infrastructure tests now passing.
2026-04-19 14:40:40 +01:00
Paul Schneider
40e8e08690 reorg 2026-02-28 21:17:54 +00:00
Paul Schneider
45514010f2 REORG 2026-02-14 16:54:27 +00:00
Paul Schneider
714b2e0efb Passwor re-init 2025-09-07 17:43:13 +01:00
Paul Schneider
c51f11c7dc Blog post create 2025-07-09 13:16:01 +01:00
Paul Schneider
409528b8d4 MEF 2025-07-09 11:17:16 +01:00
Paul Schneider
380f2314dc Code cleanup 2025-03-04 18:05:21 +00:00
Paul Schneider
8e8f4d3896 refactoring 2025-02-14 22:44:33 +00:00
Paul Schneider
578e33bf86 Nav fixed 2024-11-06 20:56:02 +00:00
Paul Schneider
8132db37d0 Local Passwords validation 2024-11-06 13:00:34 +00:00
Paul Schneider
4b52b6e96e Got a login 2023-04-06 09:20:22 +01:00
Paul Schneider
53bca59c18 migration applied 2023-03-26 20:41:42 +01:00
Paul Schneider
5f12e17907 user list cleanup 2021-06-03 16:24:33 +01:00
492427f4b8 code guidelines 2020-10-09 20:27:44 +01:00
20072f0d03 use the logo when available 2019-08-09 13:44:16 +01:00
ab65ccac4e banner settings 2019-05-08 04:42:14 +01:00
df9ff16c5c dropping GCM support 2019-05-08 01:57:18 +01:00
02160f1eaf [reorg] 2019-05-07 14:01:23 +01:00
c8321fc72f use domain from setting à sending credentials against smtp server 2019-03-07 12:08:17 +00:00
4a314400ab email refacts trying to use creds
+ Admin user deletion from user list
+ Admin send email confirmation message from user list
+ WebSocket minor change
2019-03-07 10:47:04 +00:00
ccc91bbf19 files tree made better. 2019-01-01 16:29:36 +00:00