Skip to content

Conversation

@scott-enableyou
Copy link
Collaborator

Implement complete multi-tenant API with family-scoped authorization:

Family/Tenant Creation (1.1.1)

  • RegisterFamilyCommand: Creates family + owner atomically with auth token
  • POST /api/auth/register endpoint

User Registration & Profile (1.1.2)

  • UpdateUserProfileCommand: Profile management with tenant validation
  • GetCurrentUserQuery: Retrieve authenticated user info
  • GetUserQuery: Get specific user by ID
  • PUT /api/users/family/{familyId}/{userId}/profile endpoint
  • GET /api/auth/me endpoint

JWT Claims with Family Context (1.1.3)

  • TokenService: Generates JWT with family_id, role, email_verified claims
  • Device token generation for linked displays
  • Refresh token generation (storage TBD)

Family-Scoped Authorization (1.1.4)

  • TenantValidationMiddleware: Route-based family access validation
  • Policies: FamilyMember, FamilyAdmin, FamilyOwner
  • 403 Forbidden for cross-tenant access attempts

Tenant Data Isolation (1.1.5)

  • ITenantContext + TenantContext: Tenant validation service
  • Updated GetFamilyQuery with tenant access checks
  • Updated GetFamilyMembersQuery with tenant access checks
  • All queries use familyId partition key

Additional:

  • AuthController: Registration and auth endpoints
  • EmailAvailabilityQuery: Check email availability
  • AuthResultDto, FamilyCreationResultDto: Auth response DTOs
  • Updated ROADMAP.md with Phase 1.1 completion status

Implement complete multi-tenant API with family-scoped authorization:

**Family/Tenant Creation (1.1.1)**
- RegisterFamilyCommand: Creates family + owner atomically with auth token
- POST /api/auth/register endpoint

**User Registration & Profile (1.1.2)**
- UpdateUserProfileCommand: Profile management with tenant validation
- GetCurrentUserQuery: Retrieve authenticated user info
- GetUserQuery: Get specific user by ID
- PUT /api/users/family/{familyId}/{userId}/profile endpoint
- GET /api/auth/me endpoint

**JWT Claims with Family Context (1.1.3)**
- TokenService: Generates JWT with family_id, role, email_verified claims
- Device token generation for linked displays
- Refresh token generation (storage TBD)

**Family-Scoped Authorization (1.1.4)**
- TenantValidationMiddleware: Route-based family access validation
- Policies: FamilyMember, FamilyAdmin, FamilyOwner
- 403 Forbidden for cross-tenant access attempts

**Tenant Data Isolation (1.1.5)**
- ITenantContext + TenantContext: Tenant validation service
- Updated GetFamilyQuery with tenant access checks
- Updated GetFamilyMembersQuery with tenant access checks
- All queries use familyId partition key

Additional:
- AuthController: Registration and auth endpoints
- EmailAvailabilityQuery: Check email availability
- AuthResultDto, FamilyCreationResultDto: Auth response DTOs
- Updated ROADMAP.md with Phase 1.1 completion status
@trickpatty trickpatty merged commit e984e8a into main Dec 23, 2025
1 of 2 checks passed
@trickpatty trickpatty deleted the claude/implement-multi-tenant-api-ud1jY branch December 23, 2025 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants