Commit graph

35 commits

Author SHA1 Message Date
senke
36548a32cf [BE-API-006] be-api: Implement chat stats endpoint
- Added GetStats method to ChatService with database access
- Returns active_users (distinct users who sent messages in last 24h)
- Returns total_messages (non-deleted messages count)
- Returns rooms_active (rooms with messages in last 24h)
- Added GetStats handler and GET /chat/stats route
- Updated ChatService to use NewChatServiceWithDB for database access

Phase: PHASE-2
Priority: P1
Progress: 15/267 (5.6%)
2025-12-23 01:51:49 +01:00
senke
eebeec8994 [BE-API-004] be-api: Implement playlist share link endpoint
- Added POST /playlists/:id/share route in router.go
- Initialized PlaylistShareService and set it in PlaylistService
- Handler CreateShareLink already existed and was fully implemented
- Standardized API response to return shareLink directly
- Route requires ownership or admin permission via middleware

Phase: PHASE-2
Priority: P1
Progress: 14/267 (5.2%)
2025-12-23 01:51:00 +01:00
senke
ab37bc3596 [BE-API-003] be-api: Implement playlist search endpoint
- Added GET /playlists/search route in router.go
- Handler SearchPlaylists and service method already existed
- Supports query params: q, user_id, is_public, page, limit
- Service handles pagination, access control, and search filtering
- Route added to protected playlist group

Phase: PHASE-2
Priority: P1
Progress: 13/267 (4.9%)
2025-12-23 01:49:21 +01:00
senke
9c87e6cd41 [INT-003] integration: Fix auth/login response format mismatch
- Added username field to UserResponse in Login handler
- Backend now returns { user: { id, email, username }, token: { access_token, refresh_token, expires_in } }
- Format matches frontend AuthResponse type
- Frontend client API already handles unwrapping correctly
- DTOs already use correct JSON tags (snake_case)

Phase: PHASE-1
Priority: P0
Progress: 8/267 (3.0%)
2025-12-23 01:44:54 +01:00
senke
3ba37068f4 [INT-001] integration: Fix API response format inconsistencies
- Fixed nested response structures in profile_handler.go (3 occurrences)
- Fixed nested response structures in playlist_handler.go (4 occurrences)
- Changed gin.H{"profile": profile} to profile directly
- Changed gin.H{"playlist": playlist} to playlist directly
- Changed gin.H{"collaborator": collaborator} to collaborator directly
- All responses now use consistent { success: true, data: {...} } format
- Frontend interceptor already handles unwrapping correctly

Phase: PHASE-1
Priority: P0
Progress: 6/267 (2.2%)
2025-12-23 01:42:53 +01:00
senke
ed8949ee76 [BE-API-002] api: Implement playlist collaborators endpoints
- Added routes in router.go: POST, GET, PUT, DELETE /playlists/:id/collaborators
- Applied RequireOwnershipOrAdmin middleware to POST, PUT, DELETE routes
- GET route accessible to collaborators (service layer checks permissions)
- Fixed UpdateCollaboratorPermission handler to use RespondWithAppError
- All handlers already existed in playlist_handler.go
- All endpoints properly authenticated and ownership checks enforced

Phase: PHASE-1
Priority: P0
Progress: 5/267 (1.9%)
2025-12-23 01:41:43 +01:00
senke
8d65f85541 [BE-API-001] api: Implement 2FA endpoints (setup, verify, disable)
- Created TwoFactorHandler with SetupTwoFactor, VerifyTwoFactor, DisableTwoFactor, GetTwoFactorStatus
- Added routes: POST /auth/2fa/setup, POST /auth/2fa/verify, POST /auth/2fa/disable, GET /auth/2fa/status
- Updated LoginResponse DTO to include requires_2fa flag
- Updated Login handler to check 2FA status and return requires_2fa flag when enabled
- Reused existing TwoFactorService (already had QR generation and TOTP verification)
- Added VerifyTOTPCode helper method to TwoFactorService
- All endpoints properly authenticated with RequireAuth middleware

Phase: PHASE-1
Priority: P0
Progress: 4/267 (1.5%)
2025-12-23 01:40:28 +01:00
senke
f58d7b20c6 [BE-SEC-003] security: Fix ownership verification for playlist updates/deletes
- Added RequireOwnershipOrAdmin middleware to PUT/DELETE /playlists/:id routes
- Created playlistOwnerResolver that loads playlist from DB and returns owner user_id
- Service already handles ownership checks and collaborator permissions
- All existing integration tests pass (TestUpdatePlaylist_AsOwner, TestUpdatePlaylist_NotOwner, TestDeletePlaylist_AsOwner, TestDeletePlaylist_NotOwner)

Phase: PHASE-1
Priority: P0
Progress: 3/267 (1.1%)
2025-12-23 01:37:56 +01:00
senke
888a481bde [BE-SEC-002] security: Fix ownership verification for track updates/deletes
- Verified RequireOwnershipOrAdmin middleware is correctly applied to PUT/DELETE /tracks/:id
- Verified trackOwnerResolver correctly loads track from DB and returns user_id
- Added comprehensive integration tests for ownership verification
- Test: user cannot update another user's track (403 Forbidden)
- Test: user cannot delete another user's track (403 Forbidden)
- Test: admin can update any track (200 OK)
- Test: admin can delete any track (200 OK)
- Test: user can update own track (200 OK)
- Test: user can delete own track (200 OK)
- All tests pass

Phase: PHASE-1
Priority: P0
Progress: 2/267 (0.7%)
2025-12-23 01:37:10 +01:00
senke
1831708f6a [BE-SEC-001] security: Fix ownership verification for user profile updates
- Verified RequireOwnershipOrAdmin middleware is correctly applied to PUT /users/:id
- Added integration tests for ownership verification
- Test: user cannot update another user's profile (403 Forbidden)
- Test: admin can update any profile (200 OK)
- Test: user can update own profile (200 OK)
- All tests pass

Phase: PHASE-1
Priority: P0
Progress: 1/267 (0.4%)
2025-12-23 01:36:04 +01:00
senke
b43caee67c fix(MVP-014): Add CORS credentials configuration validation 2025-12-22 23:17:24 +01:00
senke
f0033de6e8 fix(MVP-009): Fix GetMe endpoint to return full user object from database 2025-12-22 23:03:46 +01:00
senke
6310c5d6ed fix(MVP-006): Standardize environment variable names (VITE_API_BASE_URL → VITE_API_URL) 2025-12-22 22:56:37 +01:00
senke
e4212ee594 stabilizing apps/web: THIRD BATCH - FIXED Playwright 2025-12-21 18:55:51 -05:00
senke
e518b70067 stabilizing apps/web: SECOND BATCH - FIXING Playwright 2025-12-17 12:20:42 -05:00
senke
e46f123388 stabilizing veza-backend-api: LAST REMEDIATION 2025-12-16 14:07:36 -05:00
senke
d341c8f847 stabilizing veza-backend-api: P1 & P2 2025-12-16 13:34:08 -05:00
senke
ebc2d24564 stabilizing veza-backend-api: P0 2025-12-16 11:59:56 -05:00
senke
94555e7ae4 stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
senke
feb7283cd4 refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
okinrev
af70084298 report generation and future tasks selection 2025-12-08 19:57:54 +01:00
okinrev
1a7a0d3e6f fix(redis,rabbitmq): clean dev/lab behavior 2025-12-07 14:28:55 +01:00
okinrev
94a4e72849 fix(health): make readiness check reflect real dependency state 2025-12-07 14:27:07 +01:00
okinrev
7225bbfbdf fix(db): align automatic migrations with SQL files 2025-12-07 14:26:48 +01:00
okinrev
7fdfb711da refactor(marketplace): enforce unified api response envelope 2025-12-06 17:39:04 +01:00
okinrev
5509885a4d refactor(track): enforce unified api response envelope 2025-12-06 17:37:00 +01:00
okinrev
88a8bfdce0 feat(api): remediate missing openapi spec and annotate handlers 2025-12-06 17:34:18 +01:00
okinrev
65af2570a8 STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
okinrev
97d1a95d62 feat(backend-worker): persist job queue in postgres 2025-12-06 13:32:32 +01:00
okinrev
b726be3c42 chore(backend-tests): remove obsolete metrics and profile/system_metrics tests 2025-12-06 13:25:10 +01:00
okinrev
bbd3f4ce00 fix(backend-tests): enable room_handler_test and resolve metric collisions 2025-12-06 12:53:15 +01:00
okinrev
f72bac7787 fix(backend-worker): replace blocking sleep with non-blocking scheduler 2025-12-06 11:49:54 +01:00
okinrev
a3f2f2c59b P0: stabilisation backend/chat/stream + nouvelle base migrations v1
Backend Go:
- Remplacement complet des anciennes migrations par la base V1 alignée sur ORIGIN.
- Durcissement global du parsing JSON (BindAndValidateJSON + RespondWithAppError).
- Sécurisation de config.go, CORS, statuts de santé et monitoring.
- Implémentation des transactions P0 (RBAC, duplication de playlists, social toggles).
- Ajout d’un job worker structuré (emails, analytics, thumbnails) + tests associés.
- Nouvelle doc backend : AUDIT_CONFIG, BACKEND_CONFIG, AUTH_PASSWORD_RESET, JOB_WORKER_*.

Chat server (Rust):
- Refonte du pipeline JWT + sécurité, audit et rate limiting avancé.
- Implémentation complète du cycle de message (read receipts, delivered, edit/delete, typing).
- Nettoyage des panics, gestion d’erreurs robuste, logs structurés.
- Migrations chat alignées sur le schéma UUID et nouvelles features.

Stream server (Rust):
- Refonte du moteur de streaming (encoding pipeline + HLS) et des modules core.
- Transactions P0 pour les jobs et segments, garanties d’atomicité.
- Documentation détaillée de la pipeline (AUDIT_STREAM_*, DESIGN_STREAM_PIPELINE, TRANSACTIONS_P0_IMPLEMENTATION).

Documentation & audits:
- TRIAGE.md et AUDIT_STABILITY.md à jour avec l’état réel des 3 services.
- Cartographie complète des migrations et des transactions (DB_MIGRATIONS_*, DB_TRANSACTION_PLAN, AUDIT_DB_TRANSACTIONS, TRANSACTION_TESTS_PHASE3).
- Scripts de reset et de cleanup pour la lab DB et la V1.

Ce commit fige l’ensemble du travail de stabilisation P0 (UUID, backend, chat et stream) avant les phases suivantes (Coherence Guardian, WS hardening, etc.).
2025-12-06 11:14:38 +01:00
okinrev
da4a6efbbc P0 UUID Phase A: migrations + backend Go UUID refactor 2025-12-04 02:15:48 +01:00
okinrev
fa20872585 adding initial backend API (Go) 2025-12-03 20:29:37 +01:00