Files
Oxicloud/src/application/services/mod.rs
T
Bradley Nelson 8e3e31da4d feat(mounts): P2 — read-write REST for external mounts
Adds full CRUD on mount contents, mirroring the P1 read pattern (handlers/
services classify; authorization stays in the service via the mount-root
folder grant; the provider does the I/O).

- mkdir / rename / delete / move-within branch inside FolderService and
  FileManagementService (router injected into both)
- streaming upload via a new ExternalUploadService: the upload handler detects a
  mount destination BEFORE the CAS ingest and streams the multipart body
  straight to the provider (no BLAKE3/dedup). `write_stream` now takes a
  lifetime-bound boxed stream so the borrowing multipart field can be passed
  without buffering.
- deletes on mounts are permanent (no trash): the trash-first folder handler
  routes `ext:` ids straight to the provider delete; file delete goes through the
  branched delete_and_cleanup
- cross-backend move/copy (mount ↔ native, or between mounts) is forbidden
  (UnsupportedOperation); the mount root itself cannot be renamed/moved/deleted
- every mutation emits a `target:"audit" event="external_mount.write"` line
- shared mount_dto builders synthesize FolderDto/FileDto from a provider MountStat

Tests: 529 unit + integration tests for mkdir/rename/delete, file rename/delete,
streaming upload, cross-boundary forbid, and stranger-denied — all against real
Postgres + a real provider (testcontainers).
2026-06-25 00:30:10 -06:00

55 lines
1.5 KiB
Rust

pub mod admin_settings_service;
pub mod app_password_service;
pub mod auth_application_service;
pub mod batch_operations;
pub mod blob_lifecycle_service;
pub mod calendar_service;
pub mod contact_service;
pub mod delta_upload_service;
pub mod device_auth_service;
pub mod drive_management_service;
pub mod external_identity_service;
pub mod external_mount_router;
pub mod external_upload_service;
pub mod favorites_service;
pub mod file_lifecycle_service;
pub mod file_management_service;
pub mod file_retrieval_service;
pub mod file_upload_service;
pub mod file_use_case_factory;
pub mod folder_service;
pub mod i18n_application_service;
pub mod magic_link_invite_service;
pub mod mount_dto;
pub mod mount_registry;
pub mod music_service;
pub mod nextcloud_file_id_service;
pub mod nextcloud_login_flow_service;
pub mod people_service;
pub mod places_service;
pub mod recent_service;
pub mod recipient_notification_service;
pub mod search_service;
pub mod share_browse_service;
pub mod share_service;
pub mod storage_settings_service;
pub mod storage_usage_service;
pub mod subject_group_service;
pub mod trash_service;
pub mod user_lifecycle_service;
pub mod wopi_lock_service;
pub mod wopi_token_service;
#[cfg(test)]
mod batch_operations_test;
#[cfg(test)]
mod idor_protection_test;
#[cfg(test)]
mod trash_service_test;
// Re-exportar para facilitar acceso
pub use file_management_service::FileManagementService;
pub use file_retrieval_service::FileRetrievalService;
pub use file_upload_service::FileUploadService;
pub use file_use_case_factory::AppFileUseCaseFactory;