Repository navigation
test(platform-wallet-storage): open the identity key restore persisters in a secure tempdir - #5980
Conversation
…rs in a secure tempdir `sqlite_identity_key_restore` opened its persisters in a plain `tempfile::tempdir()`, which is group-writable (0o775) under a 0002 umask, so `SqlitePersister::open` refused it with `InsecureParentDir` on such hosts. Use `common::secure_tempdir()` like the other suites. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
✅ Final review complete — no blockers (commit 3f195bb) · triage: low |
|
/skip-bots |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The change correctly replaces all four plain temporary directories in sqlite_identity_key_restore with the existing common::secure_tempdir() helper, ensuring the SQLite parent-permission check passes under umask 0002. The helper is wired into the integration test crate, production permission validation remains unchanged, and the Rust wallet CI job passed; no in-scope issues were found.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.2-sol (agent: phase2-reviewer, role: rust-quality); reviewer 6: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.2-sol(effort low) — This is a small, self-contained test-only change that switches four identity-key restore tests to an existing secure temporary-directory helper, with no production behavior or user-facing impact. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 90% left, weekly 58% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort medium); agentphase2-reviewer,gpt-6.2-sol— rust-quality (completed, effort medium); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort medium); agentphase2-reviewer
|
Policy satisfied — this can merge. |
TL;DR
Four wallet storage tests stop failing on machines where new files are group-writable by default.
Detailed discussion
Internal test-only change; no user-observable effect.
Issue being fixed or feature implemented
On a host with umask
0002(the default for users with a private group on Ubuntu),tempfile::tempdir()creates a0o775directory.SqlitePersister::openrefuses a group-writable parent without the sticky bit (InsecureParentDir). That is correct, so the foursqlite_identity_key_restoretests failed there. CI runs with umask022and does not see it.What was done?
sqlite_identity_key_restoreopens its persisters incommon::secure_tempdir()(0o700), the helper the other storage suites already use.How Has This Been Tested?
On a umask
0002host:cargo test -p platform-wallet-storage --all-features --test integration sqlite_identity_key_restore: 4 passed; all 4 failed before the change.cargo clippy -p platform-wallet-storage --all-features --test integration -- --no-deps -D warnings: clean.Breaking Changes
None.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull request🤖 Generated with Claude Code
https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
🤖 Co-authored by Claudius the Magnificent AI Agent
PR Hygiene ·
3f195bbwallet-storage(packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_key_restore.rs) — approved by lklimekWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.