From 970e9f372de3839e0790f9feae2d70af726f18f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Sun, 15 Nov 2026 00:37:49 +0100 Subject: [PATCH] Seed the SDK live tests' vectors with their attachments Sync now lists attachments with a stable URL, so the rotation test's before and after comparison holds with them. Only the legacy attachments without a key of their own stay out: the SDK refuses to rotate a vault holding one. --- tools/sdk-live-tests/seed_vector.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/sdk-live-tests/seed_vector.py b/tools/sdk-live-tests/seed_vector.py index 85db6f07..85ce044f 100644 --- a/tools/sdk-live-tests/seed_vector.py +++ b/tools/sdk-live-tests/seed_vector.py @@ -26,11 +26,12 @@ def main() -> int: print("no master password") return SKIP - # Without attachments: the rotation test compares the vault before and after, and our sync gives each attachment - # a link with a fresh download token every time (upstream's is the same on every sync). A vector's legacy - # attachments, without a key of their own, would also make the SDK refuse to rotate at all. + # Without the legacy attachments that have no key of their own: the SDK refuses to rotate a vault holding one + # (`OldAttachments`), on any server. for cipher in vector.get("vault", {}).get("ciphers", []): - cipher.get("encrypted", {}).pop("attachments", None) + encrypted = cipher.get("encrypted", {}) + if encrypted.get("attachments"): + encrypted["attachments"] = [a for a in encrypted["attachments"] if a.get("key")] or None credentials = base64.b64encode(f"{username}:{password}".encode()).decode() request = urllib.request.Request(