Skip to content

test(platform-wallet-storage): open the identity key restore persisters in a secure tempdir - #5980

Merged
lklimek merged 2 commits into
v5.2-devfrom
fix/storage-identity-key-restore-secure-tempdir
Nov 20, 2026
Merged

lklimek merged 2 commits into
v5.2-devfrom
fix/storage-identity-key-restore-secure-tempdir

Conversation

@Claudius-Maginificent

@Claudius-Maginificent Claudius-Maginificent commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

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 a 0o775 directory. SqlitePersister::open refuses a group-writable parent without the sticky bit (InsecureParentDir). That is correct, so the four sqlite_identity_key_restore tests failed there. CI runs with umask 022 and does not see it.

What was done?

sqlite_identity_key_restore opens its persisters in common::secure_tempdir() (0o700), the helper the other storage suites already use.

How Has This Been Tested?

On a umask 0002 host:

  • 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:

  • I have performed a self-review of my own code
  • My Rust, FFI, WASM, Swift or Kotlin changes follow the coding conventions
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request
  • If I added or changed a system contract's document schemas, I checked the contract 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 · 3f195bb

  • Bots — thepastaclaw ✓
  • Self-review — not asked of a bot author
  • Build green
  • Approvals
    • wallet-storage (packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_key_restore.rs) — approved by lklimek

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

…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>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added this to the v5.2.0 milestone Nov 18, 2026
@thepastaclaw

thepastaclaw commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit 3f195bb) · triage: low

@lklimek
lklimek marked this pull request as ready for review November 19, 2026 20:56
@lklimek

lklimek commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

/skip-bots

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 19, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: low by gpt-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); agent phase1-reviewer, glm-5.3-flash — rust-quality (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 90% left, weekly 58% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.2-sol — architecture-layering (completed, effort medium); agent phase2-reviewer, gpt-6.2-sol — rust-quality (completed, effort medium); agent phase2-reviewer, gpt-6.2-sol — security-auditor (completed, effort medium); agent phase2-reviewer

@github-actions

Copy link
Copy Markdown
Contributor

Policy satisfied — this can merge.
Full checklist in the description.

@github-actions github-actions Bot removed the waiting-bots Waiting for the review bots to report on this head label Nov 19, 2026
@lklimek
lklimek merged commit aac7488 into v5.2-dev Nov 20, 2026
44 checks passed
@lklimek
lklimek deleted the fix/storage-identity-key-restore-secure-tempdir branch November 20, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants