Files
chanora/poc/secure-storage-spike/Cargo.toml
T
EdisonJwa 50c95b61ad feat(poc/storage): add secure-storage spike (Linux)
Proof-of-concept proving the secure-storage exit criterion from
docs/architecture/proof-of-concept-plan.md §2:
  "Secret write/read/delete works through platform secure storage."

Implements a typed SecretStorageRepository trait per ADR-006
(SecureStore + per-platform adapters) and a Linux adapter (the only
adapter in PoC scope) that supports both equivalent Linux backends
per SysRS-053/SysRS-162: Secret Service (libsecret) and kernel
keyutils.

The audit test suite covers:
  SS-AUD-001  identity secret absent from local DB (raw file scan)
  SS-AUD-002  server password absent from local DB
  SS-AUD-003  secrets absent from logs (Secret newtype redaction)
  SS-AUD-005  failure returns safe typed error (NotFound)
  SS-AUD-006  delete removes entry
  SS-TC-003   Linux round-trip set/get/delete

Verified on 2026-05-13 against the local keyutils backend (cargo
test runs need 'keyctl session -' to provide a valid session
keyring under non-interactive shells, documented in the spike
README). The CLI driver additionally observed a real locked
gnome-keyring collection and exercised the typed-error → fallback
path live.

Surfaced finding for the decision register: DEC-013 does not pin
a Linux secure-storage backend policy. Both Secret Service and
keyutils are 'equivalent' per the requirements; production code
needs an owner ruling.

Out of scope: Windows DPAPI, macOS/iOS Keychain, Android Keystore,
SS-AUD-004 (covered by diagnostics-redaction spike), SS-AUD-007/008
(process / migration items).

Authority: PoC plan §2, ADR-006, SDD-078, SRS-091..095,
SysRS-158..162.
Not product code; not promoted into chanora_storage.
2026-05-14 12:26:23 +08:00

43 lines
1.5 KiB
TOML

[package]
name = "secure-storage-spike"
version = "0.1.0"
edition = "2021"
publish = false
description = "Chanora PoC: SecureStore trait + Linux Secret Service adapter; prove SS-AUD-001..006 for the audit report."
# Not product code. See docs/architecture/proof-of-concept-plan.md §4 and
# docs/security/secure-storage-audit-report.md.
[dependencies]
thiserror = "2"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
zeroize = { version = "1", features = ["derive"] }
# Linux secure storage: keyring crate.
# * sync-secret-service: libsecret-compatible Secret Service via D-Bus.
# * linux-native: Kernel session keyring (keyutils). No D-Bus required.
# Both are acceptable Linux backends per SysRS-053 / SysRS-162
# ("Secret Service, libsecret, or equivalent"). The adapter picks at
# construction; the test suite exercises the keyutils backend because
# headless CI commonly lacks an unlocked Secret Service collection.
[target.'cfg(target_os = "linux")'.dependencies]
keyring = { version = "3", default-features = false, features = ["sync-secret-service", "crypto-rust", "linux-native"] }
# rusqlite is a stand-in for the production `LocalDatabaseRepository`. Bundled
# build avoids depending on a system libsqlite3.
rusqlite = { version = "0.32", features = ["bundled"] }
[dev-dependencies]
anyhow = "1"
serial_test = "3"
tempfile = "3"
[[bin]]
name = "secure-storage-cli"
path = "src/main.rs"
[lib]
name = "secure_storage_spike"
path = "src/lib.rs"