Commit graph

32 commits

Author SHA1 Message Date
4034c39905 Front matters 2026-06-27 13:30:28 +01:00
2dec799d71 Introduce Yavsc.Interfaces.ISmtpClient and a recording test fake
Narrow ISmtpClient to the four operations MailSender actually uses,
behind a Yavsc.Interfaces.ISmtpClientFactory. Production wires
MailKitSmtpClient (SmtpClientFactory); tests wire a recording fake
(RecordingSmtpClientFactory). The fake is pre-registered in
WebServerFixture so SMTP calls are short-circuited; the EMailling
test now asserts the Connect -> Authenticate -> Send -> Disconnect
sequence. Yavsc.Abstract stays free of MailKit/MimeKit.
2026-06-22 02:09:02 +01:00
4398715004 reinstall fixes and reorg 2026-06-19 21:13:17 +01:00
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
e24208e77b refact 2026-05-30 19:34:22 +01:00
1aafb7cc7d IModerationService 2026-05-30 18:20:17 +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
bfb37bc214 Blog Files model 2026-03-01 02:13:26 +00: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
aa2ad71cc6 localisation 2025-08-31 18:27:53 +01:00
Paul Schneider
997c39703a Authorizations 2025-08-18 11:27:13 +01:00
Paul Schneider
5c046dfa88 build cli 2025-07-16 00:47:50 +01:00
Paul Schneider
b3d565b6d9 Refactoring
The main server owns the migrations, it's the server part,
it's simpler.

It's Yavsc, not one of its lib.
2025-07-15 20:17:39 +01:00
Paul Schneider
20b6efd26c MEF 2025-07-10 08:38:38 +01:00
Paul Schneider
c51f11c7dc Blog post create 2025-07-09 13:16:01 +01:00
Paul Schneider
253a2919f3 misc 2025-07-07 07:49:18 +01:00
Paul Schneider
9b7a6c0125 refact 2025-06-29 18:44:35 +01:00
Paul Schneider
e794c22f4e refactoring 2025-06-29 16:12:16 +01:00
Paul Schneider
5998c474af bump sdk to net-9 2025-06-08 14:41:50 +01:00
Paul Schneider
050b8a7aa4 Track vscode setup 2025-03-02 16:53:56 +00:00
Paul Schneider
2bc0ce7a18 share the workflow config 2025-02-26 18:59:08 +00:00
Paul Schneider
b9ba97f5e8 User settings 2025-02-24 23:29:48 +00:00
Paul Schneider
76af07e271 no usage of DefaultProfileService 2025-02-15 21:15:12 +00:00
Paul Schneider
29303d5aea custom ProfileService 2025-02-15 20:06:07 +00:00
Paul Schneider
0936afb9ad TO FINISH ; Profile service ... 2025-02-15 18:40:22 +00:00
Paul Schneider
25b261f4ee more services from Web API 2025-02-15 12:45:27 +00:00
Paul Schneider
8e8f4d3896 refactoring 2025-02-14 22:44:33 +00:00
Paul Schneider
4b52b6e96e Got a login 2023-04-06 09:20:22 +01:00
ccc91bbf19 files tree made better. 2019-01-01 16:29:36 +00:00