64 行
2.8 KiB
Markdown
64 行
2.8 KiB
Markdown
# ADR-0004: Profile lifecycle and secret boundary
|
|
|
|
- Status: accepted
|
|
- Date: 2026-07-18
|
|
- Decision owner: project owner
|
|
|
|
## Background
|
|
|
|
The architecture document assigns Profile CRUD to stage 1, while the implementation task document groups ConnectionProfile CRUD with the stage 2 dual-connection slots. The conflict affects the SQLite schema, Tauri IPC surface, frontend state, and stage acceptance boundary.
|
|
|
|
The project owner selected option A from PD-0008:
|
|
|
|
- P01 owns basic ConnectionProfile metadata CRUD.
|
|
- P02 owns active slot assignment and all runtime connection behavior.
|
|
|
|
## Options considered
|
|
|
|
### Option A: basic metadata CRUD in P01
|
|
|
|
Create, list, update, and delete non-sensitive Profile metadata in P01. Keep companion/operations slot assignment, active connections, auto-connect validation, switching protection, and duplicate server-instance detection in P02.
|
|
|
|
### Option B: defer all Profile CRUD to P02
|
|
|
|
Keep P01 limited to application bootstrap, persistent SQLite, logging, tray, single-instance, and tests.
|
|
|
|
## Decision
|
|
|
|
Use option A.
|
|
|
|
P01 persists the canonical non-sensitive ConnectionProfile fields and exposes bounded Tauri commands for:
|
|
|
|
- listing Profiles;
|
|
- creating a Profile;
|
|
- updating user-editable metadata;
|
|
- deleting a Profile.
|
|
|
|
The P01 IPC input does not accept Token, password, API Key, Cookie, Authorization header, NAS credential, or arbitrary extra fields. Rust creates Profile IDs and timestamps. React may receive only non-sensitive metadata and an opaque credential reference.
|
|
|
|
The following remain explicitly out of P01:
|
|
|
|
- credential value enrollment or retrieval;
|
|
- companion/operations slot assignment;
|
|
- connection activation and cancellation;
|
|
- auto-connect behavior;
|
|
- switching protection;
|
|
- server_instance_id conflict detection;
|
|
- REST/SSE runtime state.
|
|
|
|
## Reasons
|
|
|
|
- AGENTS.md gives the architecture document higher priority.
|
|
- A saved Profile is a durable application-foundation concept and can be implemented without activating a connection.
|
|
- Separating metadata from runtime connection state preserves the Rust-owned security boundary.
|
|
- The narrow IPC input makes accidental secret transfer to React or SQLite rejectable at deserialization time.
|
|
|
|
## Trade-offs
|
|
|
|
- P01 can select an authentication type but cannot enroll the corresponding credential value.
|
|
- The UI is intentionally a foundation form, not a full connection settings experience.
|
|
- Credential deletion and transactional cleanup must be added with the formal credential lifecycle before credential references can be created by production flows.
|
|
|
|
## Follow-up
|
|
|
|
P02 must consume this metadata model without widening the P01 commands to accept secret values. It must add slots, connection state, auto-connect rules, profile-switch guards, duplicate server-instance warnings, and credential lifecycle integration as separate reviewed increments.
|