yavsc/src
Paul Schneider e376aed887
fix(blogacl): restrict Circle + BlogAcl reads and writes to caller's own data
Closes the data-leak holes that survived the move of these controllers
from Yavsc.Api to Yavsc.Blogs. Circles are personal — a circle and its
membership should never be visible, modifiable, or deletable by anyone
other than its owner.

BlogAclApiController:
- GetBlogACL() was returning the full table; now filters by
  Allowed.OwnerId == caller's uid, with an Include(a => a.Allowed)
  so EF Core can push the filter into SQL instead of materialising
  the whole table.
- Other endpoints (GetById, Put, Post, Delete) already enforced
  ownership; left as is.

CircleApiController:
- GetCircle() (no id) now filters by OwnerId.
- GetCircle(id) now requires c.Id == id && c.OwnerId == uid;
  returns 404 (not 403) on miss to avoid leaking the existence of
  someone else's circle.
- PutCircle verifies the existing record is owned by the caller,
  then forces circle.OwnerId = uid on the body (the client's value
  is ignored). Returns ChallengeResult when the caller doesn't own
  the record.
- PostCircle forces circle.OwnerId = uid (was trusting the body).
- DeleteCircle now filters by OwnerId; 404 on miss.

All checks use the same source of truth (User.FindFirstValue(
ClaimTypes.NameIdentifier)) that the existing BlogAclApiController
authz code already relies on.
2026-08-17 23:36:20 +01:00
..
cli WIP audiences 2026-07-12 02:42:13 +01:00
PostIt Enable blogs on connected status 2026-08-03 01:48:15 +01:00
PostIt.Tests refacto blogPost 2026-08-03 01:36:12 +01:00
Yavsc.Abstract re-refacto BlogPost serialization 2026-08-05 21:11:22 +01:00
Yavsc.Api refactor(blogacl): move BlogAcl + Circle controllers from Yavsc.Api to Yavsc.Blogs 2026-08-17 23:34:48 +01:00
Yavsc.Blogs fix(blogacl): restrict Circle + BlogAcl reads and writes to caller's own data 2026-08-17 23:36:20 +01:00
Yavsc.Blogs.Tests Fix blog comment endpoint path and add regression test 2026-08-10 21:48:03 +01:00
Yavsc.Org Add comments API support and tests 2026-08-10 22:27:52 +01:00
Yavsc.Org.Tests Add comments API support and tests 2026-08-10 22:27:52 +01:00
Yavsc.Server fix(billing): tolerate ReflectionTypeLoadException during init 2026-08-16 16:35:05 +01:00
Yavsc.Tests.Shared tests: configure static fixture ports and update org test config 2026-07-12 05:48:47 +01:00