884 lines
35 KiB
Plaintext
884 lines
35 KiB
Plaintext
warning: unused import: `UseCaseFactory`
|
|
--> src/common/di.rs:20:70
|
|
|
|
|
20 | use crate::application::ports::inbound::{FileUseCase, FolderUseCase, UseCaseFactory};
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= note: `#[warn(unused_imports)]` on by default
|
|
|
|
warning: unused import: `FilePathResolutionPort`
|
|
--> src/common/di.rs:23:77
|
|
|
|
|
23 | use crate::application::ports::storage_ports::{FileReadPort, FileWritePort, FilePathResolutionPort};
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused import: `crate::domain::repositories::folder_repository::FolderRepository`
|
|
--> src/common/di.rs:29:5
|
|
|
|
|
29 | use crate::domain::repositories::folder_repository::FolderRepository;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unnecessary trailing semicolon
|
|
--> src/common/di.rs:677:46
|
|
|
|
|
677 | struct DummyI18nApplicationService {};
|
|
| ^ help: remove this semicolon
|
|
|
|
|
= note: `#[warn(redundant_semicolons)]` on by default
|
|
|
|
warning: unused import: `DateTime`
|
|
--> src/domain/services/auth_service.rs:4:19
|
|
|
|
|
4 | use chrono::{Utc, DateTime};
|
|
| ^^^^^^^^
|
|
|
|
warning: unused import: `UserRole`
|
|
--> src/domain/services/auth_service.rs:6:43
|
|
|
|
|
6 | use crate::domain::entities::user::{User, UserRole};
|
|
| ^^^^^^^^
|
|
|
|
warning: unused import: `UserRole`
|
|
--> src/application/dtos/user_dto.rs:3:43
|
|
|
|
|
3 | use crate::domain::entities::user::{User, UserRole};
|
|
| ^^^^^^^^
|
|
|
|
warning: unused imports: `Path` and `middleware`
|
|
--> src/interfaces/api/handlers/auth_handler.rs:5:28
|
|
|
|
|
5 | extract::{State, Json, Path, Extension},
|
|
| ^^^^
|
|
...
|
|
8 | middleware,
|
|
| ^^^^^^^^^^
|
|
|
|
warning: unused imports: `AuthResponseDto` and `UserDto`
|
|
--> src/interfaces/api/handlers/auth_handler.rs:13:28
|
|
|
|
|
13 | LoginDto, RegisterDto, UserDto, ChangePasswordDto, RefreshTokenDto, AuthResponseDto
|
|
| ^^^^^^^ ^^^^^^^^^^^^^^^
|
|
|
|
warning: unused import: `middleware`
|
|
--> src/interfaces/api/routes.rs:6:5
|
|
|
|
|
6 | middleware,
|
|
| ^^^^^^^^^^
|
|
|
|
warning: unused import: `crate::interfaces::middleware::auth::auth_middleware`
|
|
--> src/interfaces/api/routes.rs:13:5
|
|
|
|
|
13 | use crate::interfaces::middleware::auth::auth_middleware;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused import: `std::path::PathBuf`
|
|
--> src/interfaces/web/mod.rs:7:5
|
|
|
|
|
7 | use std::path::PathBuf;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused imports: `FromRequestParts`, `RequestPartsExt`, `body::Body`, and `request::Parts`
|
|
--> src/interfaces/middleware/auth.rs:3:31
|
|
|
|
|
3 | extract::{State, Request, FromRequestParts},
|
|
| ^^^^^^^^^^^^^^^^
|
|
4 | http::{StatusCode, request::Parts, HeaderMap, header},
|
|
| ^^^^^^^^^^^^^^
|
|
...
|
|
7 | body::Body,
|
|
| ^^^^^^^^^^
|
|
8 | RequestPartsExt,
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
warning: unused import: `async_trait::async_trait`
|
|
--> src/interfaces/middleware/auth.rs:10:5
|
|
|
|
|
10 | use async_trait::async_trait;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused import: `futures::future::BoxFuture`
|
|
--> src/interfaces/middleware/auth.rs:11:5
|
|
|
|
|
11 | use futures::future::BoxFuture;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused import: `crate::common::errors::AppError`
|
|
--> src/interfaces/middleware/auth.rs:14:5
|
|
|
|
|
14 | use crate::common::errors::AppError;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused import: `crate::domain::entities::user::UserRole`
|
|
--> src/interfaces/middleware/auth.rs:15:5
|
|
|
|
|
15 | use crate::domain::entities::user::UserRole;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused variable: `state`
|
|
--> src/interfaces/middleware/auth.rs:65:11
|
|
|
|
|
65 | State(state): State<Arc<AppState>>,
|
|
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_state`
|
|
|
|
|
= note: `#[warn(unused_variables)]` on by default
|
|
|
|
warning: unused variable: `token_str`
|
|
--> src/interfaces/middleware/auth.rs:71:17
|
|
|
|
|
71 | if let Some(token_str) = headers
|
|
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_token_str`
|
|
|
|
warning: unused import: `crate::application::ports::outbound::IdMappingPort`
|
|
--> src/infrastructure/repositories/file_fs_repository.rs:19:5
|
|
|
|
|
19 | use crate::application::ports::outbound::IdMappingPort;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused import: `crate::application::ports::outbound::IdMappingPort`
|
|
--> src/infrastructure/repositories/folder_fs_repository.rs:13:5
|
|
|
|
|
13 | use crate::application::ports::outbound::IdMappingPort;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused import: `crate::application::ports::outbound::IdMappingPort`
|
|
--> src/infrastructure/repositories/file_path_resolver.rs:7:5
|
|
|
|
|
7 | use crate::application::ports::outbound::IdMappingPort;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused variable: `folder_repository`
|
|
--> src/application/services/storage_mediator.rs:118:9
|
|
|
|
|
118 | folder_repository: Arc<RwLock<Option<Arc<dyn FolderRepository>>>>,
|
|
| ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_folder_repository`
|
|
|
|
warning: unused variable: `folder_id`
|
|
--> src/infrastructure/repositories/file_fs_read_repository.rs:166:32
|
|
|
|
|
166 | async fn list_files(&self, folder_id: Option<&str>) -> Result<Vec<File>, DomainError> {
|
|
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_folder_id`
|
|
|
|
warning: unused variable: `abs_path`
|
|
--> src/infrastructure/repositories/file_fs_read_repository.rs:183:13
|
|
|
|
|
183 | let abs_path = self.path_resolver.resolve_storage_path(file.storage_path());
|
|
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_abs_path`
|
|
|
|
warning: unused variable: `id`
|
|
--> src/infrastructure/repositories/file_fs_read_repository.rs:190:37
|
|
|
|
|
190 | async fn get_file_stream(&self, id: &str) -> Result<Box<dyn Stream<Item = Result<Bytes, std::io::Error>> + Sen...
|
|
| ^^ help: if this is intentional, prefix it with an underscore: `_id`
|
|
|
|
warning: unused variable: `result`
|
|
--> src/infrastructure/repositories/pg/user_pg_repository.rs:49:13
|
|
|
|
|
49 | let result = sqlx::query(
|
|
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_result`
|
|
|
|
warning: unused variable: `config`
|
|
--> src/interfaces/api/routes.rs:144:9
|
|
|
|
|
144 | let config = AppConfig::from_env();
|
|
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_config`
|
|
|
|
warning: struct `DummyFilePathResolutionPort` is never constructed
|
|
--> src/common/di.rs:497:16
|
|
|
|
|
497 | struct DummyFilePathResolutionPort;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `#[warn(dead_code)]` on by default
|
|
|
|
warning: fields `root_path`, `config`, and `parallel_processor` are never read
|
|
--> src/infrastructure/repositories/file_fs_read_repository.rs:19:5
|
|
|
|
|
18 | pub struct FileFsReadRepository {
|
|
| -------------------- fields in this struct
|
|
19 | root_path: PathBuf,
|
|
| ^^^^^^^^^
|
|
...
|
|
22 | config: AppConfig,
|
|
| ^^^^^^
|
|
23 | parallel_processor: Option<Arc<ParallelFileProcessor>>,
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: fields `root_path`, `storage_mediator`, and `parallel_processor` are never read
|
|
--> src/infrastructure/repositories/file_fs_write_repository.rs:18:5
|
|
|
|
|
17 | pub struct FileFsWriteRepository {
|
|
| --------------------- fields in this struct
|
|
18 | root_path: PathBuf,
|
|
| ^^^^^^^^^
|
|
...
|
|
21 | storage_mediator: Arc<dyn StorageMediator>,
|
|
| ^^^^^^^^^^^^^^^^
|
|
22 | config: AppConfig,
|
|
23 | parallel_processor: Option<Arc<ParallelFileProcessor>>,
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: method `delete_file_non_blocking` is never used
|
|
--> src/infrastructure/repositories/file_fs_write_repository.rs:112:14
|
|
|
|
|
26 | impl FileFsWriteRepository {
|
|
| -------------------------- method in this implementation
|
|
...
|
|
112 | async fn delete_file_non_blocking(&self, _abs_path: PathBuf) -> FileRepositoryResult<()> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: `oxicloud` (lib) generated 32 warnings (run `cargo fix --lib -p oxicloud` to apply 16 suggestions)
|
|
warning: unused import: `ports::inbound::FolderUseCase`
|
|
--> src/application/mod.rs:7:9
|
|
|
|
|
7 | pub use ports::inbound::FolderUseCase;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused imports: `FileManagementUseCase`, `FileRetrievalUseCase`, `FileUploadUseCase`, and `FileUseCaseFactory`
|
|
--> src/application/mod.rs:8:29
|
|
|
|
|
8 | pub use ports::file_ports::{FileUploadUseCase, FileRetrievalUseCase, FileManagementUseCase, FileUseCaseFactory};
|
|
| ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unused imports: `FolderStoragePort` and `IdMappingPort`
|
|
--> src/application/mod.rs:9:27
|
|
|
|
|
9 | pub use ports::outbound::{FolderStoragePort, IdMappingPort};
|
|
| ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
|
|
|
|
warning: unused imports: `DirectoryManagementPort`, `FilePathResolutionPort`, `FileReadPort`, `FileWritePort`, and `StorageVerificationPort`
|
|
--> src/application/mod.rs:10:32
|
|
|
|
|
10 | ...ts::{FileReadPort, FileWritePort, FilePathResolutionPort, StorageVerificationPort, DirectoryManagementPort};
|
|
| ^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: value assigned to `app` is never read
|
|
--> src/main.rs:285:9
|
|
|
|
|
285 | app = app.nest("/api/auth", auth_router);
|
|
| ^^^
|
|
|
|
|
= help: maybe it is overwritten before being read?
|
|
= note: `#[warn(unused_assignments)]` on by default
|
|
|
|
warning: unused variable: `path`
|
|
--> src/main.rs:580:45
|
|
|
|
|
580 | ... let path = entry.path();
|
|
| ^^^^ help: if this is intentional, prefix it with an underscore: `_path`
|
|
|
|
warning: variant `NotImplemented` is never constructed
|
|
--> src/common/errors.rs:21:5
|
|
|
|
|
7 | pub enum ErrorKind {
|
|
| --------- variant in this enum
|
|
...
|
|
21 | NotImplemented,
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= note: `ErrorKind` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
|
= note: `#[warn(dead_code)]` on by default
|
|
|
|
warning: associated function `not_implemented` is never used
|
|
--> src/common/errors.rs:140:12
|
|
|
|
|
55 | impl DomainError {
|
|
| ---------------- associated function in this implementation
|
|
...
|
|
140 | pub fn not_implemented<S: Into<String>>(entity_type: &'static str, message: S) -> Self {
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
warning: associated functions `bad_request`, `forbidden`, and `not_found` are never used
|
|
--> src/common/errors.rs:252:12
|
|
|
|
|
243 | impl AppError {
|
|
| ------------- associated functions in this implementation
|
|
...
|
|
252 | pub fn bad_request(message: impl Into<String>) -> Self {
|
|
| ^^^^^^^^^^^
|
|
...
|
|
260 | pub fn forbidden(message: impl Into<String>) -> Self {
|
|
| ^^^^^^^^^
|
|
...
|
|
264 | pub fn not_found(message: impl Into<String>) -> Self {
|
|
| ^^^^^^^^^
|
|
|
|
warning: fields `file_ttl_ms`, `directory_ttl_ms`, and `max_entries` are never read
|
|
--> src/common/config.rs:9:9
|
|
|
|
|
7 | pub struct CacheConfig {
|
|
| ----------- fields in this struct
|
|
8 | /// TTL para entradas de archivos en caché (ms)
|
|
9 | pub file_ttl_ms: u64,
|
|
| ^^^^^^^^^^^
|
|
10 | /// TTL para entradas de directorios en caché (ms)
|
|
11 | pub directory_ttl_ms: u64,
|
|
| ^^^^^^^^^^^^^^^^
|
|
12 | /// Máximo número de entradas en caché
|
|
13 | pub max_entries: usize,
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= note: `CacheConfig` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
|
|
|
warning: methods `file_read_timeout` and `file_delete_timeout` are never used
|
|
--> src/common/config.rs:63:12
|
|
|
|
|
51 | impl TimeoutConfig {
|
|
| ------------------ methods in this implementation
|
|
...
|
|
63 | pub fn file_read_timeout(&self) -> Duration {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
...
|
|
68 | pub fn file_delete_timeout(&self) -> Duration {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: fields `hash_memory_cost` and `hash_time_cost` are never read
|
|
--> src/common/config.rs:228:9
|
|
|
|
|
224 | pub struct AuthConfig {
|
|
| ---------- fields in this struct
|
|
...
|
|
228 | pub hash_memory_cost: u32,
|
|
| ^^^^^^^^^^^^^^^^
|
|
229 | pub hash_time_cost: u32,
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= note: `AuthConfig` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
|
|
|
warning: field `enable_file_sharing` is never read
|
|
--> src/common/config.rs:249:9
|
|
|
|
|
246 | pub struct FeaturesConfig {
|
|
| -------------- field in this struct
|
|
...
|
|
249 | pub enable_file_sharing: bool,
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `FeaturesConfig` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
|
|
|
warning: field `cache` is never read
|
|
--> src/common/config.rs:274:9
|
|
|
|
|
264 | pub struct AppConfig {
|
|
| --------- field in this struct
|
|
...
|
|
274 | pub cache: CacheConfig,
|
|
| ^^^^^
|
|
|
|
|
= note: `AppConfig` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
|
|
|
warning: methods `with_features`, `db_enabled`, and `auth_enabled` are never used
|
|
--> src/common/config.rs:386:12
|
|
|
|
|
307 | impl AppConfig {
|
|
| -------------- methods in this implementation
|
|
...
|
|
386 | pub fn with_features(mut self, features: FeaturesConfig) -> Self {
|
|
| ^^^^^^^^^^^^^
|
|
...
|
|
391 | pub fn db_enabled(&self) -> bool {
|
|
| ^^^^^^^^^^
|
|
...
|
|
395 | pub fn auth_enabled(&self) -> bool {
|
|
| ^^^^^^^^^^^^
|
|
|
|
warning: fields `core`, `repositories`, and `applications` are never read
|
|
--> src/common/di.rs:269:9
|
|
|
|
|
268 | pub struct AppState {
|
|
| -------- fields in this struct
|
|
269 | pub core: CoreServices,
|
|
| ^^^^
|
|
270 | pub repositories: RepositoryServices,
|
|
| ^^^^^^^^^^^^
|
|
271 | pub applications: ApplicationServices,
|
|
| ^^^^^^^^^^^^
|
|
|
|
warning: struct `DummyFilePathResolutionPort` is never constructed
|
|
--> src/common/di.rs:497:16
|
|
|
|
|
497 | struct DummyFilePathResolutionPort;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: methods `update_storage_used`, `deactivate`, and `activate` are never used
|
|
--> src/domain/entities/user.rs:209:12
|
|
|
|
|
57 | impl User {
|
|
| --------- methods in this implementation
|
|
...
|
|
209 | pub fn update_storage_used(&mut self, storage_used_bytes: i64) {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
222 | pub fn deactivate(&mut self) {
|
|
| ^^^^^^^^^^
|
|
...
|
|
228 | pub fn activate(&mut self) {
|
|
| ^^^^^^^^
|
|
|
|
warning: method `revoke` is never used
|
|
--> src/domain/entities/session.rs:67:12
|
|
|
|
|
17 | impl Session {
|
|
| ------------ method in this implementation
|
|
...
|
|
67 | pub fn revoke(&mut self) {
|
|
| ^^^^^^
|
|
|
|
warning: variants `ValidationError`, `Timeout`, and `OperationNotAllowed` are never constructed
|
|
--> src/domain/repositories/user_repository.rs:17:5
|
|
|
|
|
6 | pub enum UserRepositoryError {
|
|
| ------------------- variants in this enum
|
|
...
|
|
17 | ValidationError(String),
|
|
| ^^^^^^^^^^^^^^^
|
|
...
|
|
20 | Timeout(String),
|
|
| ^^^^^^^
|
|
...
|
|
23 | OperationNotAllowed(String),
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `UserRepositoryError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
|
|
|
warning: methods `update_last_login`, `set_user_active_status`, `change_role`, and `delete_user` are never used
|
|
--> src/domain/repositories/user_repository.rs:75:14
|
|
|
|
|
55 | pub trait UserRepository: Send + Sync + 'static {
|
|
| -------------- methods in this trait
|
|
...
|
|
75 | async fn update_last_login(&self, user_id: &str) -> UserRepositoryResult<()>;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
...
|
|
81 | async fn set_user_active_status(&self, user_id: &str, active: bool) -> UserRepositoryResult<()>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
87 | async fn change_role(&self, user_id: &str, role: UserRole) -> UserRepositoryResult<()>;
|
|
| ^^^^^^^^^^^
|
|
...
|
|
90 | async fn delete_user(&self, user_id: &str) -> UserRepositoryResult<()>;
|
|
| ^^^^^^^^^^^
|
|
|
|
warning: variant `Timeout` is never constructed
|
|
--> src/domain/repositories/session_repository.rs:14:5
|
|
|
|
|
6 | pub enum SessionRepositoryError {
|
|
| ---------------------- variant in this enum
|
|
...
|
|
14 | Timeout(String),
|
|
| ^^^^^^^
|
|
|
|
|
= note: `SessionRepositoryError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
|
|
|
warning: methods `get_session_by_id`, `get_sessions_by_user_id`, and `delete_expired_sessions` are never used
|
|
--> src/domain/repositories/session_repository.rs:42:14
|
|
|
|
|
37 | pub trait SessionRepository: Send + Sync + 'static {
|
|
| ----------------- methods in this trait
|
|
...
|
|
42 | async fn get_session_by_id(&self, id: &str) -> SessionRepositoryResult<Session>;
|
|
| ^^^^^^^^^^^^^^^^^
|
|
...
|
|
48 | async fn get_sessions_by_user_id(&self, user_id: &str) -> SessionRepositoryResult<Vec<Session>>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
57 | async fn delete_expired_sessions(&self) -> SessionRepositoryResult<u64>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: variants `InvalidCredentials`, `TokenExpired`, `InvalidToken`, `AccessDenied`, and `OperationNotAllowed` are never constructed
|
|
--> src/domain/services/auth_service.rs:24:5
|
|
|
|
|
22 | pub enum AuthError {
|
|
| --------- variants in this enum
|
|
23 | #[error("Credenciales inválidas")]
|
|
24 | InvalidCredentials,
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
...
|
|
27 | TokenExpired,
|
|
| ^^^^^^^^^^^^
|
|
...
|
|
30 | InvalidToken(String),
|
|
| ^^^^^^^^^^^^
|
|
...
|
|
33 | AccessDenied(String),
|
|
| ^^^^^^^^^^^^
|
|
...
|
|
36 | OperationNotAllowed(String),
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `AuthError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
|
|
|
warning: method `validate_token` is never used
|
|
--> src/domain/services/auth_service.rs:107:12
|
|
|
|
|
73 | impl AuthService {
|
|
| ---------------- method in this implementation
|
|
...
|
|
107 | pub fn validate_token(&self, token: &str) -> Result<TokenClaims, AuthError> {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
warning: multiple methods are never used
|
|
--> src/application/ports/inbound.rs:14:14
|
|
|
|
|
12 | pub trait FileUseCase: Send + Sync + 'static {
|
|
| ----------- methods in this trait
|
|
13 | /// Sube un nuevo archivo desde bytes
|
|
14 | async fn upload_file(
|
|
| ^^^^^^^^^^^
|
|
...
|
|
23 | async fn get_file(&self, id: &str) -> Result<FileDto, DomainError>;
|
|
| ^^^^^^^^
|
|
...
|
|
26 | async fn list_files(&self, folder_id: Option<&str>) -> Result<Vec<FileDto>, DomainError>;
|
|
| ^^^^^^^^^^
|
|
...
|
|
29 | async fn delete_file(&self, id: &str) -> Result<(), DomainError>;
|
|
| ^^^^^^^^^^^
|
|
...
|
|
32 | async fn get_file_content(&self, id: &str) -> Result<Vec<u8>, DomainError>;
|
|
| ^^^^^^^^^^^^^^^^
|
|
...
|
|
35 | async fn get_file_stream(&self, id: &str) -> Result<Box<dyn Stream<Item = Result<Bytes, std::io::Error>> + Send...
|
|
| ^^^^^^^^^^^^^^^
|
|
...
|
|
38 | async fn move_file(&self, file_id: &str, folder_id: Option<String>) -> Result<FileDto, DomainError>;
|
|
| ^^^^^^^^^
|
|
|
|
warning: method `get_folder_by_path` is never used
|
|
--> src/application/ports/inbound.rs:51:14
|
|
|
|
|
43 | pub trait FolderUseCase: Send + Sync + 'static {
|
|
| ------------- method in this trait
|
|
...
|
|
51 | async fn get_folder_by_path(&self, path: &str) -> Result<FolderDto, DomainError>;
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: trait `UseCaseFactory` is never used
|
|
--> src/application/ports/inbound.rs:74:11
|
|
|
|
|
74 | pub trait UseCaseFactory {
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
warning: methods `resolve_path`, `ensure_directory`, `file_exists`, and `directory_exists` are never used
|
|
--> src/application/ports/outbound.rs:15:8
|
|
|
|
|
13 | pub trait StoragePort: Send + Sync + 'static {
|
|
| ----------- methods in this trait
|
|
14 | /// Resuelve una ruta de dominio a una ruta física
|
|
15 | fn resolve_path(&self, storage_path: &StoragePath) -> PathBuf;
|
|
| ^^^^^^^^^^^^
|
|
...
|
|
18 | async fn ensure_directory(&self, storage_path: &StoragePath) -> Result<(), DomainError>;
|
|
| ^^^^^^^^^^^^^^^^
|
|
...
|
|
21 | async fn file_exists(&self, storage_path: &StoragePath) -> Result<bool, DomainError>;
|
|
| ^^^^^^^^^^^
|
|
...
|
|
24 | async fn directory_exists(&self, storage_path: &StoragePath) -> Result<bool, DomainError>;
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
warning: method `get_file_path` is never used
|
|
--> src/application/ports/outbound.rs:58:14
|
|
|
|
|
29 | pub trait FileStoragePort: Send + Sync + 'static {
|
|
| --------------- method in this trait
|
|
...
|
|
58 | async fn get_file_path(&self, id: &str) -> Result<StoragePath, DomainError>;
|
|
| ^^^^^^^^^^^^^
|
|
|
|
warning: methods `folder_exists` and `get_folder_path` are never used
|
|
--> src/application/ports/outbound.rs:95:14
|
|
|
|
|
63 | pub trait FolderStoragePort: Send + Sync + 'static {
|
|
| ----------------- methods in this trait
|
|
...
|
|
95 | async fn folder_exists(&self, storage_path: &StoragePath) -> Result<bool, DomainError>;
|
|
| ^^^^^^^^^^^^^
|
|
...
|
|
98 | async fn get_folder_path(&self, id: &str) -> Result<StoragePath, DomainError>;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
warning: method `upload_file` is never used
|
|
--> src/application/ports/file_ports.rs:13:14
|
|
|
|
|
11 | pub trait FileUploadUseCase: Send + Sync + 'static {
|
|
| ----------------- method in this trait
|
|
12 | /// Sube un nuevo archivo desde bytes
|
|
13 | async fn upload_file(
|
|
| ^^^^^^^^^^^
|
|
|
|
warning: methods `get_file`, `list_files`, `get_file_content`, and `get_file_stream` are never used
|
|
--> src/application/ports/file_ports.rs:26:14
|
|
|
|
|
24 | pub trait FileRetrievalUseCase: Send + Sync + 'static {
|
|
| -------------------- methods in this trait
|
|
25 | /// Obtiene un archivo por su ID
|
|
26 | async fn get_file(&self, id: &str) -> Result<FileDto, DomainError>;
|
|
| ^^^^^^^^
|
|
...
|
|
29 | async fn list_files(&self, folder_id: Option<&str>) -> Result<Vec<FileDto>, DomainError>;
|
|
| ^^^^^^^^^^
|
|
...
|
|
32 | async fn get_file_content(&self, id: &str) -> Result<Vec<u8>, DomainError>;
|
|
| ^^^^^^^^^^^^^^^^
|
|
...
|
|
35 | async fn get_file_stream(&self, id: &str) -> Result<Box<dyn Stream<Item = Result<Bytes, std::io::Error>> + Send...
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
warning: methods `move_file` and `delete_file` are never used
|
|
--> src/application/ports/file_ports.rs:42:14
|
|
|
|
|
40 | pub trait FileManagementUseCase: Send + Sync + 'static {
|
|
| --------------------- methods in this trait
|
|
41 | /// Mueve un archivo a otra carpeta
|
|
42 | async fn move_file(&self, file_id: &str, folder_id: Option<String>) -> Result<FileDto, DomainError>;
|
|
| ^^^^^^^^^
|
|
...
|
|
45 | async fn delete_file(&self, id: &str) -> Result<(), DomainError>;
|
|
| ^^^^^^^^^^^
|
|
|
|
warning: methods `create_file_upload_use_case`, `create_file_retrieval_use_case`, and `create_file_management_use_case` are never used
|
|
--> src/application/ports/file_ports.rs:50:8
|
|
|
|
|
49 | pub trait FileUseCaseFactory: Send + Sync + 'static {
|
|
| ------------------ methods in this trait
|
|
50 | fn create_file_upload_use_case(&self) -> Arc<dyn FileUploadUseCase>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
51 | fn create_file_retrieval_use_case(&self) -> Arc<dyn FileRetrievalUseCase>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
52 | fn create_file_management_use_case(&self) -> Arc<dyn FileManagementUseCase>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: methods `get_file_path` and `resolve_path` are never used
|
|
--> src/application/ports/storage_ports.rs:49:14
|
|
|
|
|
47 | pub trait FilePathResolutionPort: Send + Sync + 'static {
|
|
| ---------------------- methods in this trait
|
|
48 | /// Obtiene la ruta de almacenamiento de un archivo
|
|
49 | async fn get_file_path(&self, id: &str) -> Result<StoragePath, DomainError>;
|
|
| ^^^^^^^^^^^^^
|
|
...
|
|
52 | fn resolve_path(&self, storage_path: &StoragePath) -> PathBuf;
|
|
| ^^^^^^^^^^^^
|
|
|
|
warning: trait `StorageVerificationPort` is never used
|
|
--> src/application/ports/storage_ports.rs:57:11
|
|
|
|
|
57 | pub trait StorageVerificationPort: Send + Sync + 'static {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: trait `DirectoryManagementPort` is never used
|
|
--> src/application/ports/storage_ports.rs:67:11
|
|
|
|
|
67 | pub trait DirectoryManagementPort: Send + Sync + 'static {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: methods `update_storage_usage`, `list_users`, and `change_password` are never used
|
|
--> src/application/ports/auth_ports.rs:24:14
|
|
|
|
|
7 | pub trait UserStoragePort: Send + Sync + 'static {
|
|
| --------------- methods in this trait
|
|
...
|
|
24 | async fn update_storage_usage(&self, user_id: &str, usage_bytes: i64) -> Result<(), DomainError>;
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
27 | async fn list_users(&self, limit: i64, offset: i64) -> Result<Vec<User>, DomainError>;
|
|
| ^^^^^^^^^^
|
|
...
|
|
30 | async fn change_password(&self, user_id: &str, password_hash: &str) -> Result<(), DomainError>;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
warning: associated function `new_stub` is never used
|
|
--> src/application/services/file_service.rs:83:12
|
|
|
|
|
76 | impl FileService {
|
|
| ---------------- associated function in this implementation
|
|
...
|
|
83 | pub fn new_stub() -> impl FileUseCase {
|
|
| ^^^^^^^^
|
|
|
|
warning: associated function `new_stub` is never used
|
|
--> src/application/services/folder_service.rs:22:12
|
|
|
|
|
15 | impl FolderService {
|
|
| ------------------ associated function in this implementation
|
|
...
|
|
22 | pub fn new_stub() -> impl FolderUseCase {
|
|
| ^^^^^^^^
|
|
|
|
warning: multiple methods are never used
|
|
--> src/application/services/storage_mediator.rs:69:14
|
|
|
|
|
64 | pub trait StorageMediator: Send + Sync + 'static {
|
|
| --------------- methods in this trait
|
|
...
|
|
69 | async fn get_folder_storage_path(&self, folder_id: &str) -> StorageMediatorResult<StoragePath>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
72 | async fn get_folder(&self, folder_id: &str) -> StorageMediatorResult<Folder>;
|
|
| ^^^^^^^^^^
|
|
...
|
|
75 | async fn file_exists_at_path(&self, path: &Path) -> StorageMediatorResult<bool>;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
78 | async fn file_exists_at_storage_path(&self, storage_path: &StoragePath) -> StorageMediatorResult<bool>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
81 | async fn folder_exists_at_path(&self, path: &Path) -> StorageMediatorResult<bool>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
84 | async fn folder_exists_at_storage_path(&self, storage_path: &StoragePath) -> StorageMediatorResult<bool>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
93 | async fn ensure_directory(&self, path: &Path) -> StorageMediatorResult<()>;
|
|
| ^^^^^^^^^^^^^^^^
|
|
...
|
|
96 | async fn ensure_storage_directory(&self, storage_path: &StoragePath) -> StorageMediatorResult<()>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: methods `logout_all` and `list_users` are never used
|
|
--> src/application/services/auth_application_service.rs:263:18
|
|
|
|
|
18 | impl AuthApplicationService {
|
|
| --------------------------- methods in this implementation
|
|
...
|
|
263 | pub async fn logout_all(&self, user_id: &str) -> Result<u64, DomainError> {
|
|
| ^^^^^^^^^^
|
|
...
|
|
317 | pub async fn list_users(&self, limit: i64, offset: i64) -> Result<Vec<UserDto>, DomainError> {
|
|
| ^^^^^^^^^^
|
|
|
|
warning: variant `Unavailable` is never constructed
|
|
--> src/infrastructure/repositories/file_metadata_manager.rs:26:5
|
|
|
|
|
18 | pub enum MetadataError {
|
|
| ------------- variant in this enum
|
|
...
|
|
26 | Unavailable(String),
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= note: `MetadataError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
|
|
|
warning: methods `invalidate` and `invalidate_directory` are never used
|
|
--> src/infrastructure/repositories/file_metadata_manager.rs:158:18
|
|
|
|
|
39 | impl FileMetadataManager {
|
|
| ------------------------ methods in this implementation
|
|
...
|
|
158 | pub async fn invalidate(&self, abs_path: &PathBuf) {
|
|
| ^^^^^^^^^^
|
|
...
|
|
163 | pub async fn invalidate_directory(&self, dir_path: &PathBuf) {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: field `storage_mediator` is never read
|
|
--> src/infrastructure/repositories/file_path_resolver.rs:15:5
|
|
|
|
|
13 | pub struct FilePathResolver {
|
|
| ---------------- field in this struct
|
|
14 | path_service: Arc<PathService>,
|
|
15 | storage_mediator: Arc<dyn StorageMediator>,
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
warning: methods `resolve_legacy_path`, `update_path`, `get_or_create_id`, `remove_id`, and `save_changes` are never used
|
|
--> src/infrastructure/repositories/file_path_resolver.rs:80:12
|
|
|
|
|
19 | impl FilePathResolver {
|
|
| --------------------- methods in this implementation
|
|
...
|
|
80 | pub fn resolve_legacy_path(&self, relative_path: &std::path::Path) -> PathBuf {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
91 | pub async fn update_path(&self, id: &str, storage_path: &StoragePath) -> Result<(), FileRepositoryError> {
|
|
| ^^^^^^^^^^^
|
|
...
|
|
97 | pub async fn get_or_create_id(&self, storage_path: &StoragePath) -> Result<String, FileRepositoryError> {
|
|
| ^^^^^^^^^^^^^^^^
|
|
...
|
|
103 | pub async fn remove_id(&self, id: &str) -> Result<(), FileRepositoryError> {
|
|
| ^^^^^^^^^
|
|
...
|
|
109 | pub async fn save_changes(&self) -> Result<(), FileRepositoryError> {
|
|
| ^^^^^^^^^^^^
|
|
|
|
warning: associated function `new_in_memory` is never used
|
|
--> src/infrastructure/services/id_mapping_service.rs:100:12
|
|
|
|
|
84 | impl IdMappingService {
|
|
| --------------------- associated function in this implementation
|
|
...
|
|
100 | pub fn new_in_memory() -> Self {
|
|
| ^^^^^^^^^^^^^
|
|
|
|
warning: fields `username`, `email`, and `role` are never read
|
|
--> src/interfaces/middleware/auth.rs:21:9
|
|
|
|
|
19 | pub struct CurrentUser {
|
|
| ----------- fields in this struct
|
|
20 | pub id: String,
|
|
21 | pub username: String,
|
|
| ^^^^^^^^
|
|
22 | pub email: String,
|
|
| ^^^^^
|
|
23 | pub role: String,
|
|
| ^^^^
|
|
|
|
|
= note: `CurrentUser` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
|
|
|
|
warning: variants `TokenNotProvided`, `InvalidToken`, `TokenExpired`, `UserNotFound`, and `AccessDenied` are never constructed
|
|
--> src/interfaces/middleware/auth.rs:30:5
|
|
|
|
|
28 | pub enum AuthError {
|
|
| --------- variants in this enum
|
|
29 | #[error("Token no proporcionado")]
|
|
30 | TokenNotProvided,
|
|
| ^^^^^^^^^^^^^^^^
|
|
...
|
|
33 | InvalidToken(String),
|
|
| ^^^^^^^^^^^^
|
|
...
|
|
36 | TokenExpired,
|
|
| ^^^^^^^^^^^^
|
|
...
|
|
39 | UserNotFound,
|
|
| ^^^^^^^^^^^^
|
|
...
|
|
42 | AccessDenied(String),
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
= note: `AuthError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
|
|
|
warning: function `auth_middleware` is never used
|
|
--> src/interfaces/middleware/auth.rs:64:14
|
|
|
|
|
64 | pub async fn auth_middleware(
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
warning: function `require_admin` is never used
|
|
--> src/interfaces/middleware/auth.rs:94:14
|
|
|
|
|
94 | pub async fn require_admin(
|
|
| ^^^^^^^^^^^^^
|
|
|
|
warning: `oxicloud` (bin "oxicloud") generated 83 warnings (31 duplicates) (run `cargo fix --bin "oxicloud"` to apply 4 suggestions)
|
|
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.14s
|
|
Running `target/debug/oxicloud`
|
|
[2m2025-03-23T17:05:10.052229Z[0m [32m INFO[0m [2moxicloud::infrastructure::services::id_mapping_service[0m[2m:[0m Loaded ID map with 0 entries (version: 0)
|
|
[2m2025-03-23T17:05:10.052304Z[0m [32m INFO[0m [2moxicloud[0m[2m:[0m ID mapping optimizer initialized with batch processing and caching
|
|
[2m2025-03-23T17:05:10.052341Z[0m [32m INFO[0m [2moxicloud[0m[2m:[0m Buffer pool initialized with 50 buffers of 256KB each
|
|
[2m2025-03-23T17:05:10.052362Z[0m [32m INFO[0m [2moxicloud::infrastructure::services::file_system_i18n_service[0m[2m:[0m Loading translations for locale en from "./static/locales/en.json"
|
|
[2m2025-03-23T17:05:10.052497Z[0m [32m INFO[0m [2moxicloud::infrastructure::services::file_system_i18n_service[0m[2m:[0m Translations loaded for locale en
|
|
[2m2025-03-23T17:05:10.052506Z[0m [32m INFO[0m [2moxicloud::infrastructure::services::file_system_i18n_service[0m[2m:[0m Loading translations for locale es from "./static/locales/es.json"
|
|
[2m2025-03-23T17:05:10.052595Z[0m [32m INFO[0m [2moxicloud::infrastructure::services::file_system_i18n_service[0m[2m:[0m Translations loaded for locale es
|
|
[2m2025-03-23T17:05:10.052602Z[0m [32m INFO[0m [2moxicloud[0m[2m:[0m Compression service initialized with buffer pool support
|
|
[2m2025-03-23T17:05:10.053417Z[0m [32m INFO[0m [2moxicloud[0m[2m:[0m Preloading common directories to warm up cache...
|
|
[2m2025-03-23T17:05:10.054362Z[0m [32m INFO[0m [2moxicloud[0m[2m:[0m Preloaded 4 directory entries into cache
|
|
[2m2025-03-23T17:05:10.054377Z[0m [32m INFO[0m [2moxicloud[0m[2m:[0m Starting OxiCloud server on http://127.0.0.1:8085
|
|
[2m2025-03-23T17:05:10.054382Z[0m [32m INFO[0m [2moxicloud[0m[2m:[0m Authentication system initialized successfully
|
|
[2m2025-03-23T17:05:10.054387Z[0m [32m INFO[0m [2moxicloud[0m[2m:[0m Server binding to http://127.0.0.1:8085
|
|
[2m2025-03-23T17:05:10.054405Z[0m [34mDEBUG[0m [2moxicloud::interfaces::middleware::cache[0m[2m:[0m HttpCache cleanup: removed 0 expired entries
|
|
|
|
thread 'main' panicked at src/main.rs:308:47:
|
|
Failed to bind to address: Os { code: 98, kind: AddrInUse, message: "Address already in use" }
|
|
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
|
[2m2025-03-23T17:05:10.054424Z[0m [32m INFO[0m [2moxicloud::interfaces::middleware::cache[0m[2m:[0m HTTP Cache cleanup: removed 0, current: 0/0
|