vault provision: hook passes collection_id but crate resolves by name → CollectionNotFound #88
Labels
No labels
first-proof blocker
hardening
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: clawdie/colibri#88
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The vault-provision chain compiles, deploys, and is fail-soft — but it will fail end-to-end with
CollectionNotFound, because the spawner hook and the crate disagree on collection identifier type.feat/vault-spawner-hook, daemon.rs): passes the collection_id.crates/colibri-vault/src/lib.rs): treats the arg as a name and resolves via name search.Passing an ID into a name-search returns no match →
CollectionNotFound, even afterbwauth and a jail/tenant exist.Fix (recommended)
Per the 1:1:1 design (
tenant_id == jail name == Vaultwarden collection): name the collectiontenant_id, have the hook passtenant.tenant_id(the name), and either drop the redundantcollection_idcolumn or repurpose it to store the collection name. Alternatively, teach the crate to resolve by collection ID.Acceptance
A jailed spawn for a registered tenant resolves its collection and writes the
.env(noCollectionNotFound).See docs/HIVE-ONBOARDING.md and docs/CAPABILITY-ROUTING.md (layered-soul) for the design.
🤖 Generated with Claude Code
Trade-offs for the fix
Option A — resolve by NAME, collection named =
tenant_id(drop/repurposecollection_id)bw list collections --searchis substring →acmematchesacme-test; wrong-collection resolution = cross-tenant leak risk.tenant_id) + operator naming discipline.Option B — resolve by ID, store
collection_idRecommendation: A + exact-match enforcement — B's safety with A's simplicity and the 1:1:1 elegance. Go pure-B only if collection renames become a real operational concern.
🤖 Generated with Claude Code
Sequencing + decisions (operator-confirmed)
collection_idmigration caveat:collection_idisNOT NULL UNIQUEand already persisted on main (schema.rs).CREATE TABLE IF NOT EXISTSwill not alter initialized DBs, so the "collection name = tenant_id, drop collection_id" option is not a free drop. Either (a) keep the column and default it totenant_idat registration (simplest, no migration), or (b) ship a real migration/backfill. Resolving by name + exact-match works regardless of which you pick.🤖 Generated with Claude Code
Resolved by #94 (
fix(vault): use tenant collection names with per-call unlock) — verified: tenant id is now passed as the Vaultwarden collection name (#88), andcolibri-vaultdoes per-call login→unlock→fetch→lock from the daemon's provider env, locking on both success and error paths (#89). Closing.🤖 Generated with Claude Code