Commit Graph

472 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 1a44de3ea4 style: format test_api_auth_enabled.py with Black and isort
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 15:53:11 +00:00
copilot-swe-agent[bot] 9795a3966a docs: add comprehensive test setup documentation and auth integration tests
- Add detailed test setup section to CONTRIBUTING.md explaining environment configuration
- Add testing section to README.md with quick start guide
- Create test_api_auth_enabled.py with 11 new integration tests for auth configuration
- Document that tests automatically configure required environment variables (no manual setup)
- Explain AUTH_ENABLED and SESSION_SECRET configuration for tests
- Include examples of testing with authentication enabled
- Reference integration test documentation for Docker-based tests

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 15:50:13 +00:00
copilot-swe-agent[bot] 6f462c7430 Initial plan 2026-02-10 15:42:30 +00:00
Christian Krakau-Louis 171e4fbfc3 Merge pull request #226 from christianlouis/copilot/fix-ssh-host-keys-again
Fix SFTP host key verification: secure by default
2026-02-10 16:41:46 +01:00
copilot-swe-agent[bot] 9a89f70cf4 fix: change SFTP host key verification default to secure (False)
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 15:39:23 +00:00
copilot-swe-agent[bot] 04c44e6bad Initial plan 2026-02-10 15:34:11 +00:00
Christian Krakau-Louis 89455041cb Merge pull request #225 from christianlouis/copilot/add-webdav-upload-support
Add comprehensive testing infrastructure for WebDAV and upload destinations
2026-02-10 16:31:46 +01:00
copilot-swe-agent[bot] 1dab1fb6fd docs: add comprehensive WebDAV testing summary
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 15:26:35 +00:00
copilot-swe-agent[bot] fb50c8b375 test: add full-stack integration testing with real infrastructure (PostgreSQL, Redis, Gotenberg, WebDAV, SFTP, MinIO)
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 15:24:35 +00:00
copilot-swe-agent[bot] f2d70e90cf test: add comprehensive WebDAV tests with real server and Redis integration
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 15:18:17 +00:00
copilot-swe-agent[bot] 787d48c70e test: create comprehensive WebDAV integration tests with real server
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 15:13:10 +00:00
copilot-swe-agent[bot] 0b4264a37c Initial plan 2026-02-10 15:07:03 +00:00
Christian Krakau-Louis b4a17adf56 Merge pull request #224 from christianlouis/copilot/add-absender-custom-field
Add custom fields support for Paperless-ngx uploads
2026-02-10 16:06:06 +01:00
copilot-swe-agent[bot] 742b4e2e8c refactor: improve code quality and documentation clarity
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 15:04:48 +00:00
copilot-swe-agent[bot] 6aeb466491 fix: address code review feedback for custom fields
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 15:02:05 +00:00
copilot-swe-agent[bot] 327244c43a feat(paperless): add flexible multi-field custom fields mapping
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 15:00:28 +00:00
copilot-swe-agent[bot] eeb32ac77f docs: add documentation for Paperless custom field configuration
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 14:57:14 +00:00
copilot-swe-agent[bot] eab75b89db feat(paperless): add support for setting absender custom field
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 14:54:42 +00:00
copilot-swe-agent[bot] c16635d7c4 Initial plan 2026-02-10 14:49:43 +00:00
Christian Krakau-Louis 8c0fc30d4c Merge pull request #223 from christianlouis/copilot/add-security-headers
Default security headers to disabled for reverse proxy deployments
2026-02-10 15:39:45 +01:00
copilot-swe-agent[bot] 956f0c0c2a refactor: change security headers default to disabled
Security headers are now disabled by default since most deployments use a reverse proxy (Traefik, Nginx) that already adds these headers. Enable with SECURITY_HEADERS_ENABLED=true for direct deployments.

Changes:
- Set security_headers_enabled default to False in app/config.py
- Update all documentation to reflect new default
- Comment out examples in .env.demo (now showing disabled state)
- Update SECURITY_AUDIT.md to reflect reverse proxy as default deployment
- Tests still pass (3 passed, 8 skipped as expected with headers disabled)

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 14:22:47 +00:00
copilot-swe-agent[bot] 20a0e43a11 docs: address code review comments
- Fix test count in SECURITY_AUDIT.md (11 tests, not 24)
- Add deprecation note for ALLOW-FROM in X-Frame-Options
- Update documentation to recommend CSP frame-ancestors instead

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 14:10:23 +00:00
copilot-swe-agent[bot] 68ee832e70 style: format code with Black
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 14:08:24 +00:00
copilot-swe-agent[bot] e144fdd50a feat(security): add configurable security headers middleware
- Add SecurityHeadersMiddleware with HSTS, CSP, X-Frame-Options, X-Content-Type-Options
- Add configuration options in app/config.py
- Integrate middleware into app/main.py
- Add comprehensive tests in tests/test_security_headers.py
- Update .env.demo with security header examples
- Update docs/DeploymentGuide.md with security headers section and Traefik/Nginx examples
- Update docs/ConfigurationGuide.md with detailed configuration reference
- Update SECURITY_AUDIT.md to mark security headers implementation complete

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 14:05:19 +00:00
copilot-swe-agent[bot] ec44cb082e Initial plan 2026-02-10 13:59:46 +00:00
Christian Krakau-Louis c58f8e4b3a Merge pull request #222 from christianlouis/copilot/add-file-upload-size-limits
docs: clarify PDF splitting uses page boundaries, not byte offsets
2026-02-10 14:59:02 +01:00
copilot-swe-agent[bot] f4b4ab0328 docs: clarify PDF splitting is page-based, not byte-based
- Add prominent documentation that splitting uses page boundaries
- Update docstring with IMPORTANT note about page-level splitting
- Add test to validate split PDFs are valid and readable
- Update ConfigurationGuide.md to emphasize page-based approach
- Update SECURITY_AUDIT.md with implementation details
- Ensures users understand no risk of corrupted PDFs

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 13:51:24 +00:00
copilot-swe-agent[bot] dec7afe712 refactor: extract condition to variable for readability
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 11:01:56 +00:00
copilot-swe-agent[bot] 03222c5ef1 refactor: improve file splitting performance and code quality
- Use BytesIO for size checking instead of temporary disk writes (major performance improvement)
- Add constant and comment for PDF overhead multiplier in tests
- Address code review feedback

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 10:59:39 +00:00
copilot-swe-agent[bot] ee43687eaa test: fix formatting and linting issues in file upload tests
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 10:56:54 +00:00
copilot-swe-agent[bot] 9ad32e40e6 feat(security): add configurable file upload size limits with optional splitting
- Add MAX_UPLOAD_SIZE config (default 1GB) to prevent resource exhaustion
- Add MAX_SINGLE_FILE_SIZE config for optional PDF file splitting
- Implement automatic PDF splitting when files exceed single file limit
- Update upload endpoint to use configured limits instead of hardcoded 500MB
- Add comprehensive tests for upload limits and file splitting
- Document configuration in ConfigurationGuide.md and SECURITY_AUDIT.md
- Reference SECURITY_AUDIT.md in error messages for user guidance

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 10:51:30 +00:00
copilot-swe-agent[bot] bbffb32da4 Initial plan 2026-02-10 10:46:32 +00:00
Christian Krakau-Louis 19a0e71ab1 Merge pull request #221 from christianlouis/copilot/review-file-path-operations
Security: Remediate path traversal vulnerabilities in file operations
2026-02-10 11:45:41 +01:00
copilot-swe-agent[bot] 1937ea84cb docs: add detailed path traversal security audit report
- Create comprehensive audit documentation
- Document all vulnerabilities, fixes, and testing
- Include security recommendations for future development

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 10:30:26 +00:00
copilot-swe-agent[bot] a3d0af2efc fix(security): address code review feedback on validation logic
- Improve comment documentation for defense-in-depth validation
- Fix test assertion to properly validate basename sanitization
- Note regex pattern duplication for future refactoring

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 10:28:39 +00:00
copilot-swe-agent[bot] 489aa67a13 fix(security): remediate path traversal vulnerabilities in file operations
- Fix critical vulnerability: sanitize GPT metadata filename before use
- Fix insecure string-based path validation with pathlib methods
- Add validation for GPT-extracted filenames
- Add comprehensive security test suite (24 tests)
- Document all findings in SECURITY_AUDIT.md

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-10 10:26:42 +00:00
copilot-swe-agent[bot] 94c05d2b29 Initial plan 2026-02-10 10:21:09 +00:00
Christian Krakau-Louis b3be69802d Merge pull request #176 from christianlouis/copilot/add-auth-encryption-tests
test: add comprehensive auth and encryption test coverage
2026-02-09 22:32:39 +01:00
copilot-swe-agent[bot] 42cac76c0e style: format test files with black and isort, remove unused imports
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-09 21:19:41 +00:00
copilot-swe-agent[bot] acb8951dd9 test: expand auth and encryption test coverage with 299 new test lines
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-09 21:16:55 +00:00
copilot-swe-agent[bot] 91755ee5e6 Initial plan 2026-02-09 21:11:34 +00:00
Christian Krakau-Louis 2650c39c46 Merge pull request #166 from christianlouis/copilot/convert-unittest-to-pytest
test: convert unittest-style tests to pytest
2026-02-09 22:11:04 +01:00
Christian Krakau-Louis bc7919ffba Merge pull request #167 from christianlouis/copilot/fix-uncontrolled-data-alert
Harden filename sanitization against path traversal attacks
2026-02-09 22:10:16 +01:00
Christian Krakau-Louis 8ac16420b2 Update SECURITY_AUDIT.md with the latest audit results. 2026-02-09 22:08:35 +01:00
copilot-swe-agent[bot] 3d2b21b3c8 style: fix linting issues (whitespace and formatting)
- Remove trailing whitespace from blank lines
- Apply black formatting to test file
- All tests still pass

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-09 21:05:44 +00:00
copilot-swe-agent[bot] 43b512fee8 refactor(security): improve sanitization logic and tests based on code review
- Change consecutive dots regex to simple replace for better precision
- Update tests to verify exact sanitized output
- Fix docstring syntax warning with raw string
- Add detailed comments explaining sanitization behavior
- All 43 tests pass (21 file upload + 22 filename utils)

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-09 21:04:03 +00:00
copilot-swe-agent[bot] 2bcd774d6d fix(security): enhance path traversal protection in file uploads
- Import and use sanitize_filename utility in ui_upload endpoint
- Enhance sanitize_filename to handle Windows-style paths (backslashes)
- Add protection against path traversal patterns (..)
- Replace all path separators with underscores
- Add comprehensive security tests for Windows-style paths and mixed separators
- All existing tests pass with improved security

This addresses the "Uncontrolled data used in path expression" code scanning alert
by ensuring all user-provided filenames are properly sanitized before being used
in any file operations or stored in the database.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-09 21:00:51 +00:00
copilot-swe-agent[bot] de0f784879 test: remove unused import from test_notifications.py
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-09 20:56:35 +00:00
copilot-swe-agent[bot] 758e353eed test: convert unittest-style tests to pytest in test_utils.py and test_notifications.py
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-09 20:55:53 +00:00
copilot-swe-agent[bot] ef484f85a4 Initial plan 2026-02-09 20:53:50 +00:00