Commit Graph

12 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 3be93be35a fix: resolve failing tests in main
- fix(api/dropbox): _require_admin bypasses auth when AUTH_ENABLED=False,
  fixing all 5 TestSaveDropboxSettings failures
- fix(api/onedrive): same AUTH_ENABLED bypass in _require_admin; fix one-arg
  update_env_file call using env_utils version for token rotation
- fix(auth): update login TemplateResponse to Starlette 1.0+ API
  (request as first arg instead of in context dict)
- fix(api/local_auth): update all TemplateResponse calls to Starlette 1.0+ API
- fix(views/share): update TemplateResponse call to Starlette 1.0+ API
- fix(api/billing): update TemplateResponse call to Starlette 1.0+ API
- fix(tests/test_imap_tasks): mock is_private_ip for tests using
  imap.example.com (unresolvable in sandboxed/CI environments)
- fix(tests): update TemplateResponse call_args assertions to new API
  (call_args.kwargs['context'] instead of call_args[0][1])
- fix(tests): update fake_original signatures in dark_mode tests

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/52d7b7b7-3a71-4a96-b2b1-b675b8a6d3b4
2026-03-23 18:51:28 +00:00
google-labs-jules[bot] d22175310a 🛡️ Sentinel: [HIGH] Fix Server-Side Request Forgery in IMAP connections
🚨 Severity: HIGH
💡 Vulnerability: User-provided IMAP `host` in `_test_imap_connection` and `pull_inbox` was not validated against private IPs, creating an SSRF risk.
🎯 Impact: Attackers could abuse the endpoints to port-scan or interact with internal/private network services.
🔧 Fix: Integrated `is_private_ip` from `app.utils.network` to block connections resolving to private, loopback, link-local, or reserved IPs.
 Verification: Ran `test_imap_tasks.py` and `test_api_imap_accounts.py` successfully. Checked `ruff` output and diffs. Removed all scratch files from the commit.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 14:45:22 +00:00
copilot-swe-agent[bot] 93629ff440 fix: update test assertions and lint fixes for Starlette 1.0 TemplateResponse API
Update test mocks to check kwargs["context"] instead of positional
args[1] for tests that verify auth.py and base.py wrapper behavior.
Fix B026 lint error by avoiding star-arg after keyword argument.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/7b5f7e0d-89ad-43be-b68d-a9c0c5407a7e
2026-03-23 13:14:25 +00:00
Christian Krakau-Louis 50846360b3 Merge pull request #712 from christianlouis/test-settings-sync-coverage-16903900720046903542
🧪 [testing improvement] add missing error logging tests for notify_settings_updated
2026-03-16 10:50:40 +01:00
github-actions[bot] 6f5f4d9d49 style: apply ruff auto-fix
- Auto-formatted code with ruff format
- Applied ruff linting fixes with --fix

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-16 09:36:54 +00:00
google-labs-jules[bot] 9a85615811 🧪 Add tests for settings_sync.py register_settings_reload_signal
This commit improves test coverage for the `register_settings_reload_signal` function in `app/utils/settings_sync.py`.

🎯 **What:** The testing gap addressed was that the `_reload_if_stale` inner Celery `task_prerun` signal handler was entirely untested, specifically around exception handling (e.g. Redis timeouts or OCR manager errors) and the code branch where Redis returns no version key.

📊 **Coverage:** The following scenarios are now tested:
- Redis returning `None` for the version.
- Redis throwing an exception (handled gracefully).
- `ensure_ocr_languages_async` throwing an exception (caught and logged without failing the task).

 **Result:** Test coverage for `register_settings_reload_signal` is now 100%. Total coverage for `app/utils/settings_sync.py` has been substantially improved.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-16 09:36:33 +00:00
github-actions[bot] cc2a07b090 style: apply ruff auto-fix
- Auto-formatted code with ruff format
- Applied ruff linting fixes with --fix

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-16 09:22:16 +00:00
google-labs-jules[bot] 2c68b3c197 🧪 [testing improvement] add missing error logging tests for notify_settings_updated
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-16 09:19:56 +00:00
copilot-swe-agent[bot] 58c9b5d7f0 fix(email): create missing email template and decouple email destination settings
- Create app/templates/email/default.html (fixes 'default.html not found' error)
- Add DEST_EMAIL_* settings to app/config.py (decoupled from shared EMAIL_* settings)
- Update upload_to_email task to use dest_email_* settings exclusively
- Update _should_upload_to_email() to check dest_email_* settings
- Update config validator, providers, and settings_service for dest_email_*
- Update .env.demo and docs/ConfigurationGuide.md
- Update all tests to use dest_email_* settings where appropriate"

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-08 10:10:18 +00:00
github-actions[bot] 650a9925c4 style: apply ruff auto-fix
- Auto-formatted code with ruff format
- Applied ruff linting fixes with --fix

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-07 17:34:54 +00:00
copilot-swe-agent[bot] dc1ee0e2e5 feat(ui): redesign navigation for multi-user SaaS UX with pre/post-login visibility
- Inject is_logged_in, multi_user_enabled, auth_enabled into all templates
  via app/views/base.py _inject_global_context() helper
- Multi-user + logged-out: show only Pricing, About, Log In, Get Started
- Logged-in or single-user: full app nav (Dashboard, Upload, Files,
  Search, Pipelines, Admin dropdown, Status)
- Upload link is visually accented (blue) as the primary action
- Account dropdown (avatar, name, email, subscription, sign-out) for
  logged-in users in desktop and mobile
- Admin dropdown Similarity icon changed to purple to differentiate
  from Queue Monitor
- data-multi-user attribute on <body> so JS reads the mode at runtime
- 5 new unit tests for is_logged_in/multi_user_enabled injection

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-07 15:37:34 +00:00
copilot-swe-agent[bot] a1b9ac1db6 feat(tests): increase code coverage from 89.28% to 92.15%
- Add comprehensive tests for app/views/filemanager.py (14% → 97%)
- Add tests for app/views/settings.py credentials_page and audit_log_page (53% → 100%)
- Add tests for base.py kwargs context CSRF injection (66% → 100%)
- Add tests for general.py DB error, favicon 404, license fallback (89% → 100%)
- Add tests for status.py Docker exception branches (89% → 96%)
- Add tests for config_validator/providers.py alternative AI providers (45% → 90%+)
- Add tests for settings_sync.py reload failure and signal handler (80% → 100%)

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 23:59:50 +00:00