Skip to content

enhance architecture #72

Description

@oScape

Critical Issues

1. Domain depends on Platform

Files: domain/vault/operations.rs, domain/crypto/operations.rs, domain/authentication/operations.rs

  • Violates pure hexagonal architecture
  • Alternative: Domain should accept individual ports instead of &Platform

2. Ports depend on Domain (reverse dependency)

Files: ports/storage.rs, ports/lock.rs, ports/persistence.rs

  • Ports return VaultError (domain type)
  • Fix: Create generic PortError

Major Issues

3. Error context loss

File: src/adapters/native/fs_storage.rs

  • .map_err(|_| discards original error
  • Fix: map_err(|e| VaultError::io_error(format!("...: {}", e)))

4. OPFS code duplication

File: adapters/wasm/opfs_storage.rs (lines 180-226 and 262-307)

  • Duplicated iterator traversal logic

5. Argon2 not configurable

File: adapters/shared/argon2_kdf.rs:29

  • Always uses default parameters

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions