From 9249082857d407dde4e22e672b615631a294279e Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Wed, 18 Nov 2026 17:34:25 +0000 Subject: szecret get-local/put-local: find the store's key in a bucket too, not only in the old store --- secrets/test/buckets.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'secrets/test') diff --git a/secrets/test/buckets.sh b/secrets/test/buckets.sh index b021c3c..2703952 100755 --- a/secrets/test/buckets.sh +++ b/secrets/test/buckets.sh @@ -245,6 +245,18 @@ test_check_missing_plugin() { pass "check: flags a key type this machine can't encrypt to" } +test_local_store_key_in_bucket() { + local d="${TEST_DIR}/repo-store" + mkdir -p "${d}" + SZECRET_BUCKETS="" szecret create-local inrepo "${d}" >/dev/null 2>&1 || fail "create-local" + echo "local1" | szecret put-local "${d}/v.age" 2>/dev/null || fail "put-local before the move" + szecret mv local-key-inrepo mine 2>/dev/null || fail "mv local-key-inrepo" + assert_equals "local1" "$(szecret get-local "${d}/v.age")" "get-local with its key in a bucket" + echo "local2" | szecret put-local "${d}/v.age" 2>/dev/null || fail "put-local after the move" + assert_equals "local2" "$(szecret get-local "${d}/v.age")" "put-local with its key in a bucket" + pass "get-local/put-local: an old-style repository store whose key moved to a bucket" +} + test_ready() { szecret ready || fail "ready with an identity" SZECRET_STORE="" SZECRET_PRIVATE_KEY="${TEST_DIR}/none" szecret ready || fail "ready with only buckets and an identity" @@ -269,6 +281,7 @@ test_no_admins test_admin_change_needs_rekey test_list test_check_ok +test_local_store_key_in_bucket test_check_stanza_types test_check_missing_plugin test_ready -- cgit v1.2.3