Skip to content

DL-9: Manage Binary Assets #44

@spuentesp

Description

@spuentesp

Category: data-layer | Epic: 0 | Priority: low

Summary

Implement operations for binary asset storage in MinIO. Supports upload,
download, delete, and list operations for files like PDFs, images, and
other binary content. Metadata references link to MongoDB documents.

Acceptance Criteria

  • minio_upload uploads binary content with content-type and metadata
  • minio_upload generates unique object key if not provided
  • minio_upload returns bucket/key reference for storage
  • minio_get_object retrieves binary content by bucket/key
  • minio_get_object returns content with metadata
  • minio_delete_object removes object from bucket
  • minio_list_objects lists objects with optional prefix filter
  • minio_list_objects supports pagination
  • All operations handle bucket creation if not exists
  • Objects store metadata (source_id, universe_id, uploader)
  • Unit tests achieve >= 80% coverage

Blocks

This use case blocks:

  • DL-8
  • I-1

Implementation

Layer: 1

Files to create:

  • packages/data-layer/src/monitor_data/schemas/assets.py
  • packages/data-layer/tests/test_tools/test_minio_tools.py
    Files to modify:
  • packages/data-layer/src/monitor_data/tools/minio_tools.py
  • packages/data-layer/src/monitor_data/db/minio.py

MINIO Operations:

  • minio_upload (authority: *)
  • minio_get_object (authority: *)
  • minio_delete_object (authority: *)
  • minio_list_objects (authority: *)
  • minio_get_presigned_url (authority: *)

Notes:

  • MinIO provides S3-compatible object storage
  • Consider versioning for document updates
  • Presigned URLs for secure external access
  • Metadata should link to source_id/universe_id

Testing Requirements

Minimum coverage: 80%

Unit tests:

  • test_upload_success: valid content → object stored
  • test_upload_auto_key: no key → generates UUID key
  • test_get_object: valid key → returns content
  • test_get_object_not_found: bad key → error
  • test_delete_object: valid key → object removed
  • ... and 3 more

Integration tests:

  • test_upload_download: upload → get → verify content matches
  • test_lifecycle: upload → list → delete → verify removed

References

Documentation:


Generated from /home/sebas/monitor2/docs/use-cases/data-layer/DL-9.yml

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions