Skip to content

feat: Add MinIO file listing and document reading endpoints (BRIC-9)#11

Merged
Kaiohz merged 1 commit intomainfrom
BRIC-9/add-minio-file-listing-reading
Apr 10, 2026
Merged

feat: Add MinIO file listing and document reading endpoints (BRIC-9)#11
Kaiohz merged 1 commit intomainfrom
BRIC-9/add-minio-file-listing-reading

Conversation

@Kaiohz
Copy link
Copy Markdown
Collaborator

@Kaiohz Kaiohz commented Apr 10, 2026

Summary

  • Add GET /api/v1/files/list endpoint and list_files MCP tool to browse MinIO files without indexing
  • Add POST /api/v1/files/read endpoint and read_file MCP tool to extract text content from MinIO files using Kreuzberg (91 file formats)
  • Follow hexagonal architecture: DocumentReaderPortKreuzbergAdapter, StoragePort.list_files_metadata()MinioAdapter
  • Add path traversal validation, proper error handling (404/422), and temp file cleanup
  • 153 unit tests pass, 12 QA integration tests pass, SonarQube clean, ruff/lint clean

Acceptance Criteria Met

AC Status
AC1: List Files MCP Tool ✅ Returns object_name, size, last_modified
AC2: Read File MCP Tool ✅ Downloads from MinIO, extracts via Kreuzberg
AC3: List Files REST Endpoint ✅ GET /api/v1/files/list
AC4: Read File REST Endpoint ✅ POST /api/v1/files/read
AC5: Error Handling ✅ 404 for missing files, 422 for unsupported formats/path traversal
AC6: Hexagonal Architecture ✅ DocumentReaderPort + KreuzbergAdapter, ports-and-adapters
AC7: Performance ✅ Temp files cleaned up, async extraction

Definition of Done

  • Code implemented following hexagonal architecture
  • Unit tests written (TDD approach)
  • Full test suite passes (153 passed)
  • Linter passes (ruff check + format)
  • Code review approved
  • SonarQube: 0 new issues (only pre-existing ones remain)
  • Trivy: 0 new vulnerabilities
  • Manual testing completed (12/12 QA tests pass)
  • README updated with new endpoints/tools documentation
  • PR created
  • DO NOT MERGE (per ticket DoD)

…zberg integration (BRIC-9)

- Add DocumentReaderPort abstract interface and KreuzbergAdapter implementation
- Add list_files endpoint (GET /api/v1/files/list) and MCP tool
- Add read_file endpoint (POST /api/v1/files/read) and MCP tool
- Support 91 file formats via Kreuzberg document extraction
- Add path traversal validation for security
- Add FileInfo dataclass to StoragePort for rich file metadata
- Add S3Error handling to list_objects and list_files_metadata
- Comprehensive unit and integration tests
- Update README with new endpoints and architecture diagram
@Kaiohz Kaiohz merged commit cc2232a into main Apr 10, 2026
1 check passed
@Kaiohz
Copy link
Copy Markdown
Collaborator Author

Kaiohz commented Apr 13, 2026

🟢 Code Review — BRIC-9: MinIO file listing & Kreuzberg reading

✅ Points positifs

  • Architecture exemplaire : DocumentReaderPortKreuzbergAdapter, StoragePort.list_files_metadata()MinioAdapter
  • 153 tests unitaires + 12 QA integration tests
  • Path traversal validation sur file_path (bloque .. et chemins absolus)
  • Temp file cleanup avec contexte async
  • Error handling complet : 404 (not found), 422 (unsupported/traversal)
  • DoD rigoureux : review, SonarQube, Trivy, manual QA

⚠️ Points d'attention

  1. Pas de timeout configurable sur l'extraction Kreuzberg — un gros fichier pourrait bloquer indéfiniment

Score de confiance : 9/10 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant