Commit graph

2474 commits

Author SHA1 Message Date
senke
bd938d6750 [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
fbe7349679 [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
07c0959b8d [BE-DB-002] backend-database: Add foreign key constraints where missing
- Created migration 930_add_missing_foreign_keys.sql
- Added FK constraints for legacy fields: tracks.user_id, rooms.owner_id, messages.user_id, messages.parent_id
- Added FK constraint for audit_logs.user_id
- All constraints use ON DELETE SET NULL for legacy fields and audit_logs
- Verified primary foreign keys already have proper constraints in existing migrations
- Models already have proper GORM foreignKey tags

Phase: PHASE-1
Priority: P0
Progress: 12/267 (4.5%)
2025-12-23 01:48:33 +01:00
senke
e2c55b758c [BE-DB-001] backend-database: Add database indexes for performance-critical queries
- Created migration 920_add_performance_indexes.sql
- Added indexes on tracks.status, tracks.user_id, tracks.stream_status
- Added composite index on tracks(user_id, status)
- Added indexes on playlists.is_public, user_sessions.is_active
- Added composite index on user_sessions(user_id, is_active)
- Verified existing indexes on users.email, users.username, tracks.creator_id, playlists.user_id, sessions.user_id

Phase: PHASE-1
Priority: P0
Progress: 11/267 (4.1%)
2025-12-23 01:47:33 +01:00
senke
a14a5f0a29 [FE-API-002] frontend-api: Enable playlist collaborator service calls
- Removed requireFeature guards from collaborator functions
- Updated addCollaborator to use unwrapped response format
- Implemented getCollaborators to call GET endpoint
- Enabled PLAYLIST_COLLABORATION feature flag
- All collaborator CRUD operations now functional

Phase: PHASE-1
Priority: P0
Progress: 10/267 (3.7%)
2025-12-23 01:46:43 +01:00
senke
2f2fd47f7a [FE-API-001] frontend-api: Enable 2FA service calls when backend is ready
- Replaced axios with apiClient for automatic authentication
- Updated URLs to use /auth/2fa/* endpoints (was /2fa/*)
- Fixed verify() to accept (secret, code) matching backend
- Fixed disable() to accept password instead of code
- Enabled TWO_FACTOR_AUTH feature flag
- Service now properly calls backend endpoints

Phase: PHASE-1
Priority: P0
Progress: 9/267 (3.4%)
2025-12-23 01:45:47 +01:00
senke
651c8199b2 [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
854a248d70 [INT-002] integration: Fix type mismatches between frontend and backend
- Fixed queue_job_id: number -> string in hlsService.ts
- Fixed track_id: number -> string in trackService.ts
- Fixed id: number -> string in usePlaylistNotifications.ts
- Fixed Role.id, Permission.id, UserRole.id, UserRole.role_id, AssignRoleRequest.role_id: number -> string in role.ts
- Fixed playlist_id: number -> string in PlaylistAnalytics.tsx
- All IDs now consistently use string (UUID) type matching backend DTOs
- Backend already uses uuid.UUID for all entity IDs

Phase: PHASE-1
Priority: P0
Progress: 7/267 (2.6%)
2025-12-23 01:43:48 +01:00
senke
6887a97a3f [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
f6ab2c6eeb [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
5e25825726 [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
246e3d9630 [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
b76925c493 [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
b9821db707 [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
37120e8dd1 fix(MVP-015): Standardize remember_me field name to snake_case 2025-12-22 23:27:51 +01:00
senke
64336258e5 fix(MVP-014): Add CORS credentials configuration validation 2025-12-22 23:17:24 +01:00
senke
2c8d0ea5eb fix(MVP-013): Add error correlation with request IDs in logs 2025-12-22 23:13:49 +01:00
senke
872f11d264 fix(MVP-012): Add retry logic with exponential backoff for 502/503 errors 2025-12-22 23:10:52 +01:00
senke
44509e9b2e fix(MVP-011): Simplify token refresh response handling to single format 2025-12-22 23:06:52 +01:00
senke
8e914d6932 fix(MVP-010): Fix error code type in Zod schemas (string → number) 2025-12-22 23:05:08 +01:00
senke
ccd4542f11 fix(MVP-009): Fix GetMe endpoint to return full user object from database 2025-12-22 23:03:46 +01:00
senke
fc4d48b4cc fix(MVP-008): Add feature flags to disable non-MVP features with missing endpoints 2025-12-22 23:01:36 +01:00
senke
d43e937559 fix(MVP-007): Fix profile endpoint paths to match backend routes 2025-12-22 22:58:18 +01:00
senke
114f363c65 fix(MVP-006): Standardize environment variable names (VITE_API_BASE_URL → VITE_API_URL) 2025-12-22 22:56:37 +01:00
senke
9e942bc48b batch 1 2025-12-22 22:00:50 +01:00
senke
e301460bd8 fix(INT-000002): Multiple Auth Storage Mechanisms
- Unified token storage to use TokenStorage service
- Removed deprecated token-manager.ts
- Removed fallback storage logic in API client
- Updated tests and feature components to use TokenStorage

Resolves: INT-000002
Severity: P0
2025-12-22 09:53:47 -05:00
senke
40b1a814c7 fix(INT-000001): CORS Configuration Will Break Production
- Updated docker-compose.production.yml to set APP_ENV=production
- Added CORS_ALLOWED_ORIGINS configuration to backend-api service
- Created integration tracking documents

Resolves: INT-000001
Severity: P0
2025-12-22 09:39:48 -05:00
senke
41e9a09f25 stabilizing apps/web: THIRD BATCH - FIXED Playwright 2025-12-21 18:55:51 -05:00
senke
2b8ee6a1c4 stabilizing apps/web: SECOND BATCH - FIXING Playwright 2025-12-17 12:20:42 -05:00
senke
798db1c376 fix(frontend): STATUS OVERVIEW 2025-12-17 09:20:58 -05:00
senke
84913e1108 fix(frontend): stabilize architecture (router, lazy loading, build, auth) 2025-12-17 09:15:45 -05:00
senke
3d72d5ac3c stabilizing apps/web: FIRST BATCH 2025-12-17 08:07:35 -05:00
senke
4b5003bdbe stabilizing apps/web: SITUATION AWARENESS 2025-12-16 14:40:16 -05:00
senke
d0e362a462 stabilizing veza-backend-api: LAST REMEDIATION 2025-12-16 14:07:36 -05:00
senke
fefe684260 stabilizing veza-backend-api: P3 - FINAL 2025-12-16 13:37:36 -05:00
senke
094e85c7e3 stabilizing veza-backend-api: P1 & P2 2025-12-16 13:34:08 -05:00
senke
ca81dac997 stabilizing veza-backend-api: P0 2025-12-16 11:59:56 -05:00
senke
d61d851f65 stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
senke
2dfde29f7d refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
okinrev
87c6461900 report generation and future tasks selection 2025-12-08 19:57:54 +01:00
okinrev
4da014e924 fix(redis,rabbitmq): clean dev/lab behavior 2025-12-07 14:28:55 +01:00
okinrev
0dc64c7638 chore(dev): add lab migration and run scripts 2025-12-07 14:27:51 +01:00
okinrev
0a5c111336 fix(health): make readiness check reflect real dependency state 2025-12-07 14:27:07 +01:00
okinrev
7dc21c3ad3 fix(db): align automatic migrations with SQL files 2025-12-07 14:26:48 +01:00
okinrev
cd1d403176 Merge pull request #2 from okinrev/remediation/full_audit_fix
Remediation/full audit fix
2025-12-06 17:53:06 +01:00
okinrev
2158da1968 refactor(marketplace): enforce unified api response envelope 2025-12-06 17:39:04 +01:00
okinrev
6e85f5aed3 refactor(track): enforce unified api response envelope 2025-12-06 17:37:00 +01:00
okinrev
7d227bd902 feat(api): remediate missing openapi spec and annotate handlers 2025-12-06 17:34:18 +01:00
okinrev
1e4f7b1756 STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
okinrev
cfe6ed0119 STABILISATION: phase 1 & phase 2 2025-12-06 14:45:07 +01:00