From 47c4d505c77c5b6a1e141b0d787c4f86c1a1bfcb Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@private.storage>
Date: Fri, 28 Apr 2023 19:32:02 +0000
Subject: [PATCH] Replace privatestorageio-zkapauthz-v1 with -v2 everywhere

---
 nixos/modules/private-storage.nix  |  4 ++--
 nixos/tests/get-passes.py          |  2 +-
 nixos/tests/run-client.py          | 12 ++++++------
 nixos/tests/test_privatestorage.py |  2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/nixos/modules/private-storage.nix b/nixos/modules/private-storage.nix
index 3a716cf0..1b556148 100644
--- a/nixos/modules/private-storage.nix
+++ b/nixos/modules/private-storage.nix
@@ -132,9 +132,9 @@ in
           # Put the storage where we have a lot of space configured.
           storage_dir = "/storage";
           # Turn on our plugin.
-          plugins = "privatestorageio-zkapauthz-v1";
+          plugins = "privatestorageio-zkapauthz-v2";
         };
-        "storageserver.plugins.privatestorageio-zkapauthz-v1" =
+        "storageserver.plugins.privatestorageio-zkapauthz-v2" =
         { "ristretto-issuer-root-url" = cfg.issuerRootURL;
           "ristretto-signing-key-path" = cfg.ristrettoSigningKeyPath;
         } // (
diff --git a/nixos/tests/get-passes.py b/nixos/tests/get-passes.py
index 206e8900..6f926334 100755
--- a/nixos/tests/get-passes.py
+++ b/nixos/tests/get-passes.py
@@ -29,7 +29,7 @@ def main():
     if issuerAPIRoot is not None and not issuerAPIRoot.endswith("/"):
         issuerAPIRoot += "/"
 
-    zkapauthz = clientAPIRoot + "storage-plugins/privatestorageio-zkapauthz-v1"
+    zkapauthz = clientAPIRoot + "storage-plugins/privatestorageio-zkapauthz-v2"
 
     with open(clientAPITokenPath) as p:
         clientAPIToken = p.read().strip()
diff --git a/nixos/tests/run-client.py b/nixos/tests/run-client.py
index 8d3d8272..86909bde 100755
--- a/nixos/tests/run-client.py
+++ b/nixos/tests/run-client.py
@@ -29,12 +29,12 @@ def main():
     with open("/tmp/client/tahoe.cfg") as cfg:
         config.read_file(cfg)
 
-    config.set(u"client", u"storage.plugins", u"privatestorageio-zkapauthz-v1")
-    config.add_section(u"storageclient.plugins.privatestorageio-zkapauthz-v1")
-    config.set(u"storageclient.plugins.privatestorageio-zkapauthz-v1", u"redeemer", u"ristretto")
-    config.set(u"storageclient.plugins.privatestorageio-zkapauthz-v1", u"ristretto-issuer-root-url", issuerURL)
-    config.set(u"storageclient.plugins.privatestorageio-zkapauthz-v1", u"allowed-public-keys", publicKey)
-    config.set(u"storageclient.plugins.privatestorageio-zkapauthz-v1", u"default-token-count", tokenCount)
+    config.set(u"client", u"storage.plugins", u"privatestorageio-zkapauthz-v2")
+    config.add_section(u"storageclient.plugins.privatestorageio-zkapauthz-v2")
+    config.set(u"storageclient.plugins.privatestorageio-zkapauthz-v2", u"redeemer", u"ristretto")
+    config.set(u"storageclient.plugins.privatestorageio-zkapauthz-v2", u"ristretto-issuer-root-url", issuerURL)
+    config.set(u"storageclient.plugins.privatestorageio-zkapauthz-v2", u"allowed-public-keys", publicKey)
+    config.set(u"storageclient.plugins.privatestorageio-zkapauthz-v2", u"default-token-count", tokenCount)
 
     with open("/tmp/client/tahoe.cfg", "wt") as cfg:
         config.write(cfg)
diff --git a/nixos/tests/test_privatestorage.py b/nixos/tests/test_privatestorage.py
index 0429ac92..724b99c3 100644
--- a/nixos/tests/test_privatestorage.py
+++ b/nixos/tests/test_privatestorage.py
@@ -274,7 +274,7 @@ def test(
 
     # It should be possible to restart the storage service without the
     # storage node fURL changing.
-    furlfile = '/var/db/tahoe-lafs/storage/private/storage-plugin.privatestorageio-zkapauthz-v1.furl'
+    furlfile = '/var/db/tahoe-lafs/storage/private/storage-plugin.privatestorageio-zkapauthz-v2.furl'
     before = storage.execute('cat ' + furlfile)
     runOnNode(storage, [["systemctl", "restart", "tahoe.storage"]])
     after = storage.execute('cat ' + furlfile)
-- 
GitLab