Files
lagos-back/src/routes/googleDrive.routes.ts
T
mstfyldzandClaude Sonnet 5 ce6fa9deae 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>
2026-08-10 04:24:56 +03:00

22 lines
964 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Router } from 'express';
import multer from 'multer';
import { requireAuth } from '../middleware/auth';
import { connect, oauthCallback, getStatus, disconnect, refresh, uploadFile, getBackupStatus, listBackupFiles, downloadFile } from '../controllers/googleDrive.controller';
const router = Router();
const upload = multer({ storage: multer.memoryStorage() });
// Google'ın doğrudan (Bearer token olmadan) yönlendirdiği tek public uç nokta.
router.get('/oauth/callback', oauthCallback);
router.get('/connect', requireAuth, connect);
router.get('/status', requireAuth, getStatus);
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;