-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Feature Request: Google Drive Upload Integration for Scan Reports
Summary
Add one-click Google Drive upload functionality to automatically backup scan reports (HTML, XML, PDF) to a dedicated "Techmore Network Scanner" folder in the cloud.
Problem Statement
Currently, scan reports are only stored locally. Users need to manually backup critical security scan data, risking data loss and making collaboration difficult.
Proposed Solution
Implement OAuth 2.0 authentication with Google Drive API for seamless cloud backup:
- Google Drive Button: Blue Google Drive icon appears next to "Generate Report" button
- One-Click Authorization: Click opens modal with OAuth authorization URL
- Secure OAuth Flow: User authorizes the app (registered as "Techmore Network Scanner")
- Automatic Setup: Creates "Techmore Network Scanner" folder on first use
- Smart Upload: Automatically uploads HTML, XML, and PDF reports to the folder
User Experience Flow
Setup (One-time)
- User clicks blue Google Drive icon (🚀)
- Modal appears with "Connect to Google Drive" button
- Button opens Google OAuth page in new tab
- User signs in and authorizes "Techmore Network Scanner" app
- Authorization code is returned to the app
- App exchanges code for secure tokens (stored encrypted)
Usage (Every time)
- After generating a report, click "Upload to Drive" button
- Files automatically upload to "Techmore Network Scanner/YYYY-MM-DD/" folders
- Success notification shows uploaded file links
Technical Implementation
Frontend Changes
<!-- Add Google Drive button next to Generate Report -->
<button id="upload-drive-btn" class="mt-2 inline-flex items-center justify-center gap-2 rounded-full bg-blue-600 text-white hover:bg-blue-700 font-medium py-1 px-3 text-xs transition-colors">
<svg class="w-3 h-3" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
</svg>
Upload to Drive
</button>Backend Implementation
- OAuth 2.0 flow with secure token storage (encrypted, not hashed)
- Google Drive API v3 integration
- Automatic folder creation: "Techmore Network Scanner/Scans/YYYY-MM-DD/"
- Upload HTML, XML, PDF files with metadata
Security Features
- Encrypted Token Storage: Uses Fernet encryption (reversible, not hash)
- User-Controlled OAuth: Users authorize their own Google account
- Registered App: "Techmore Network Scanner" appears as legitimate app in OAuth flow
- Scoped Permissions: Only requests necessary Drive permissions
Folder Structure
Google Drive Root/
└── Techmore Network Scanner/
└── Scans/
├── 2026-01-09/
│ ├── scan_report_2026-01-09_10-30-00.html
│ ├── scan_data_2026-01-09_10-30-00.xml
│ └── scan_report_2026-01-09_10-30-00.pdf
└── 2026-01-10/
├── scan_report_2026-01-10_14-15-30.html
└── ...
Dependencies
google-api-python-clientgoogle-auth-oauthlibcryptography(for token encryption)google-api-python-client[drive](optional, for Drive-specific features)
Acceptance Criteria
- ✅ Google Drive button appears next to Generate Report button
- ✅ One-click OAuth authorization flow
- ✅ "Techmore Network Scanner" folder auto-created
- ✅ HTML, XML, PDF files upload automatically
- ✅ Files organized by date in subfolders
- ✅ Encrypted token storage (no plaintext credentials)
- ✅ Error handling for network/API issues
- ✅ Success notifications with file links
- ✅ Disconnect/revoke authorization option
Benefits
- Zero-Config Backup: One-click setup, automatic uploads
- Data Safety: Cloud backup prevents local data loss
- Collaboration: Share scan results via Google Drive links
- Professional UX: Seamless integration feels native
- Security: Encrypted storage, OAuth best practices
Priority
High - Immediate value for data persistence and user experience.
Related Issues
None at this time.
Metadata
Metadata
Assignees
Labels
No labels