v0.2.6-pre.017

This commit is contained in:
2026-08-22 09:39:13 +02:00
parent 5c0be421da
commit 362123f357
22 changed files with 896 additions and 109 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-wallet-lib/src/lib.rs
// version: 13
// version: 14
#![warn(missing_docs)]
#![deny(unreachable_pub)]
@@ -17,7 +17,9 @@
//! native import/export publication. `0.2.5-pre.009` adds adversarial security/compliance canaries and records the final dependency/interop audit before
//! documentation closure. `0.2.6-pre.015` defines the strict binary `.kspwallet` V2 wire and its bounded canonical codec without yet changing the public
//! persistence default or Wallet Desk dispatch. `0.2.6-pre.016` adds complete V2 create/open/administration, stable version-neutral dispatch, explicit V1/V2
//! APIs and moves the default native creation/import format to V2 without coupling that default to the latest supported version. Public keys are consumed exclusively through the [`ksp_core_lib::Pubkey`] re-export owned by KSP Core, and behavioral
//! APIs and moves the default native creation/import format to V2 without coupling that default to the latest supported version. `0.2.6-pre.017` adds
//! explicit authenticated V1 -> V2 migration with no-clobber copy and state-conflict protected in-place replacement; ordinary open remains non-migrating.
//! Public keys are consumed exclusively through the [`ksp_core_lib::Pubkey`] re-export owned by KSP Core, and behavioral
//! observability uses only
//! `ksp-logging-lib` with the explicit crate target defined in `src/constants.rs`.
@@ -27,6 +29,7 @@ mod crypto;
mod error;
mod format;
mod metadata;
mod migration;
mod owner;
mod password;
mod payload;
@@ -205,6 +208,8 @@ pub use self::error::ERROR_CODE_FORMAT_VERSION_UNSUPPORTED;
pub use self::error::ERROR_CODE_IO_FAILED;
/// Error code used when imported or decoded key material is invalid.
pub use self::error::ERROR_CODE_KEY_MATERIAL_INVALID;
/// Error code used when an explicit Wallet migration request is inconsistent with migration policy.
pub use self::error::ERROR_CODE_MIGRATION_INVALID;
/// Error code used when a protected Wallet note identifier is absent.
pub use self::error::ERROR_CODE_NOTE_NOT_FOUND;
/// Error code used when an OWNER unlock attempt fails without exposing a finer cryptographic oracle.
@@ -245,6 +250,12 @@ pub use self::metadata::WalletCreateMetadataV1;
pub use self::metadata::WalletInfo;
/// One protected Wallet note exposed only after authorization.
pub use self::metadata::WalletNote;
/// Migrates one V1 file into a new no-clobber V2 destination while preserving the source.
pub use self::migration::migrate_wallet_file_v1_to_v2;
/// Atomically replaces one authenticated current V1 file with its V2 migration.
pub use self::migration::migrate_wallet_file_v1_to_v2_in_place;
/// Converts one authenticated V1 document snapshot into a fresh V2 Wallet in memory.
pub use self::migration::migrate_wallet_v1_to_v2;
/// Authorized OWNER capability handle.
pub use self::owner::WalletOwner;
/// Owned OWNER password material with redacted diagnostics and drop-time zeroization.
@@ -404,6 +415,8 @@ pub(crate) use self::persistence::persist_new_wallet_fault_before_publish;
/// Persists new wallet for test.
#[cfg(test)]
pub(crate) use self::persistence::persist_new_wallet_for_test;
/// Bounded native Wallet reader shared with authenticated migration.
pub(crate) use self::persistence::read_wallet_file_async;
/// Replaces wallet fault before publish.
#[cfg(test)]
pub(crate) use self::persistence::replace_wallet_fault_before_publish;