lib.ec.secret_store.TarGpg: Add the write path #147
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20261017-lib-ec-secret-store-targpg-add-the-write-path"
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?
lib.ec.secret_store.TarGpg: Add the write path
The TarGpg store is read-only:
put()andunlink()raise, so the store can be copied from, but not into, and a copy that lands entries and blobs below a host prefix has no tarball target.This matches the way
jw-pkgsecrets has worked for a long time. Since Stores are now FileContext-backed, a write path can be cleanly implemented, and that's what this commit does.A put rebuilds the tarball: the existing members minus the removed, plus the written one; the result is signed with the recipient from
JW_SECRETS_TARGPG_RECIPIENTand written back to the tarball location, which must be a local path. A missing tarball is an empty store, so a put creates it.The put dispatch follows the other stores: a typed entry put replaces the entry with the given serialized content, a key put merges into its entry, creating it if it does not exist yet, and an untyped put below an entry lands a key there, otherwise a blob.
unlink()removes the node's member.