Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WalletKit's byte-based backup APIs use a plaintext SQLite scratch file under
worldid/. Mobile hosts cannot currently select their platform temporary/cache directory, so a process kill can leave plaintext in persistent app storage.Add native UniFFI methods
export_vault_for_backup_in_directory(temp_dir)andimport_vault_from_backup_in_directory(backup_bytes, temp_dir). They use an existing absolute host-selected directory, reserve a unique owner-only file, and clean it up on success or error. Missing/unusable directories fail without falling back to persistent storage. Calls never sweep other files in the chosen directory, so stores can share an app cache directory. After abrupt termination the host/OS owns leftover-file cleanup.For example, Kotlin callers can pass
context.cacheDir.absolutePathtoexportVaultForBackupInDirectory(...); Swift callers can pass their injected filesystem's temporary-directory path toexportVaultForBackupInDirectory(tempDir: ...). Restore uses the matching directory-specific import method.Existing APIs remain available for current consumers; mobile apps must adopt the new methods to change placement. Exported bytes and the vault schema remain unchanged. This controls WalletKit's internal scratch file; each app still owns its separate Bedrock backup staging policy.
Closes #280
Validation: all 29 credential-storage unit tests pass, including byte-compatible roundtrip, file permissions/directory placement, error cleanup, shared-directory isolation, and invalid directory handling. Strict Clippy (
cargo clippy -p walletkit-core --lib --tests -- -D warnings), formatting, andgit diff --checkpass. Full workspace and generated foreign-binding validation is running in CI.