Commit graph

17 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
19cf073677 Regenerate the secret 2026-06-19 01:36:08 +01:00
3508f0a55d tests OK 2026-06-18 21:43:01 +01:00
c1f4d19975 fices the UI 2026-06-15 02:55:22 +01:00
69e81b9fd4 Giving up at UI testing 2026-06-15 00:00:39 +01:00
95dec3636a Use InMemory db driver at testing 2026-05-28 22:18:26 +01:00
6cc0c519d2 tests OK 2026-04-20 00:35:51 +01:00
d21337d4a6 about to test remote access 2026-04-19 16:02:50 +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
5cf4bd48e8 refact & cookies 2026-02-17 19:24:30 +00:00
Paul Schneider
8fc1153e59 testing 2025-07-14 20:35:13 +01:00
Paul Schneider
32c1482bfb MEF & Settings 2025-07-11 13:04:50 +01:00
Paul Schneider
fa954c04a2 html 2021-06-06 23:06:24 +01:00
Paul Schneider
43d28db539 fixes test config 2021-06-06 21:47:02 +01:00
Paul Schneider
8c382938f7 madatory values 2021-06-06 21:34:25 +01:00
Paul Schneider
ef33058ef5 refacts 2021-06-06 20:32:39 +01:00
Paul Schneider
45d76a2917 new mailling for not confirmed emails 2021-05-30 12:30:39 +01:00
Renamed from src/test/appsettings.json (Browse further)