feat: Google Drive restore endpoints (Faz 3)

GET /api/google-drive/backup-files: kullanıcının senkronize
edilmiş dosyalarının listesi (PRD §28 "N dosya bulundu"). GET
/download: bir dosyayı Drive'dan proxy'leyip ham baytları döner —
istenen drive_file_id'nin gerçekten bu kullanıcıya ait olduğu
önce doğrulanıyor (PRD §39, başka kullanıcının backup'ı sızmasın).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
mstfyldz
2026-08-10 04:24:56 +03:00
co-authored by Claude Sonnet 5
parent 313d5b72ef
commit ce6fa9deae
3 changed files with 77 additions and 1 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
import { Router } from 'express';
import multer from 'multer';
import { requireAuth } from '../middleware/auth';
import { connect, oauthCallback, getStatus, disconnect, refresh, uploadFile, getBackupStatus } from '../controllers/googleDrive.controller';
import { connect, oauthCallback, getStatus, disconnect, refresh, uploadFile, getBackupStatus, listBackupFiles, downloadFile } from '../controllers/googleDrive.controller';
const router = Router();
const upload = multer({ storage: multer.memoryStorage() });
@@ -15,5 +15,7 @@ router.post('/disconnect', requireAuth, disconnect);
router.post('/refresh', requireAuth, refresh);
router.post('/upload', upload.single('file'), requireAuth, uploadFile);
router.get('/backup-status', requireAuth, getBackupStatus);
router.get('/backup-files', requireAuth, listBackupFiles);
router.get('/download', requireAuth, downloadFile);
export default router;