]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
rename "get_verifier()" to "get_verify_cap()"
authorZooko O'Whielacronx <zooko@zooko.com>
Mon, 8 Dec 2008 19:44:11 +0000 (12:44 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Mon, 8 Dec 2008 19:44:11 +0000 (12:44 -0700)
14 files changed:
src/allmydata/dirnode.py
src/allmydata/immutable/download.py
src/allmydata/immutable/filenode.py
src/allmydata/interfaces.py
src/allmydata/mutable/filenode.py
src/allmydata/test/common.py
src/allmydata/test/test_cli.py
src/allmydata/test/test_dirnode.py
src/allmydata/test/test_filenode.py
src/allmydata/test/test_system.py
src/allmydata/test/test_uri.py
src/allmydata/test/test_web.py
src/allmydata/uri.py
src/allmydata/web/info.py

index 7417a07e406d9b3370955eecefd9157adfaea547..38a311369812f96d514976b4f6ed94ab23295f06 100644 (file)
@@ -222,8 +222,8 @@ class NewDirectoryNode:
     def get_readonly_uri(self):
         return self._uri.get_readonly().to_string()
 
-    def get_verifier(self):
-        return self._uri.get_verifier()
+    def get_verify_cap(self):
+        return self._uri.get_verify_cap()
 
     def get_storage_index(self):
         return self._uri._filenode_uri.storage_index
@@ -479,7 +479,7 @@ class NewDirectoryNode:
         monitor = Monitor()
         walker.set_monitor(monitor)
 
-        found = set([self.get_verifier()])
+        found = set([self.get_verify_cap()])
         limiter = ConcurrencyLimiter(10)
         d = self._deep_traverse_dirnode(self, [],
                                         walker, monitor, found, limiter)
@@ -504,7 +504,7 @@ class NewDirectoryNode:
         monitor.raise_if_cancelled()
         dl = [limiter.add(walker.enter_directory, parent, children)]
         for name, (child, metadata) in children.iteritems():
-            verifier = child.get_verifier()
+            verifier = child.get_verify_cap()
             # allow LIT files (for which verifier==None) to be processed
             if (verifier is not None) and (verifier in found):
                 continue
@@ -651,7 +651,7 @@ class ManifestWalker(DeepStats):
         si = node.get_storage_index()
         if si:
             self.storage_index_strings.add(base32.b2a(si))
-        v = node.get_verifier()
+        v = node.get_verify_cap()
         if v:
             self.verifycaps.add(v.to_string())
         return DeepStats.add_node(self, node, path)
index a5a05f0008ff7d0a660b587e667aa5b5a8f026fe..c8d7d215537822d70d31966634dc4b5840c29b97 100644 (file)
@@ -830,7 +830,7 @@ class FileDownloader:
 
         vups = []
         for sharenum, bucket in self._share_buckets:
-            vups.append(ValidatedExtendedURIProxy(bucket, self._uri.get_verifier(), self._fetch_failures))
+            vups.append(ValidatedExtendedURIProxy(bucket, self._uri.get_verify_cap(), self._fetch_failures))
         vto = ValidatedThingObtainer(vups, debugname="vups", log_id=self._log_number)
         d = vto.start()
 
index 5fbeb7913435c2df83386a8c6b3eeda8327064c1..fdf94748c6182936786d600bfe993d06ac2ccbc9 100644 (file)
@@ -181,8 +181,8 @@ class FileNode(_ImmutableFileNodeBase):
     def get_size(self):
         return self.u.get_size()
 
-    def get_verifier(self):
-        return self.u.get_verifier()
+    def get_verify_cap(self):
+        return self.u.get_verify_cap()
 
     def get_storage_index(self):
         return self.u.storage_index
@@ -265,7 +265,7 @@ class LiteralFileNode(_ImmutableFileNodeBase):
     def get_size(self):
         return len(self.u.data)
 
-    def get_verifier(self):
+    def get_verify_cap(self):
         return None
 
     def get_storage_index(self):
index d0ccffa56c77796441434603503d12a1913a3878..5067123c2d1850460de9d816ac14eb09006b8f13 100644 (file)
@@ -365,7 +365,7 @@ class IURI(Interface):
         """Return another IURI instance, which represents a read-only form of
         this one. If is_readonly() is True, this returns self."""
 
-    def get_verifier():
+    def get_verify_cap():
         """Return an instance that provides IVerifierURI, which can be used
         to check on the availability of the file or directory, without
         providing enough capabilities to actually read or modify the
@@ -426,7 +426,7 @@ class IFilesystemNode(Interface):
         get_readonly_uri() will return the same thing as get_uri().
         """
 
-    def get_verifier():
+    def get_verify_cap():
         """Return an IVerifierURI instance that represents the
         'verifiy/refresh capability' for this node. The holder of this
         capability will be able to renew the lease for this node, protecting
index 882831b77c2f5e3f67e2d3af108b4a55f4a9aaf9..8caa14547ddb269dd60d6280d53206523444ed27 100644 (file)
@@ -218,8 +218,8 @@ class MutableFileNode:
             return cmp(self.__class__, them.__class__)
         return cmp(self._uri, them._uri)
 
-    def get_verifier(self):
-        return IMutableFileURI(self._uri).get_verifier()
+    def get_verify_cap(self):
+        return IMutableFileURI(self._uri).get_verify_cap()
 
     def _do_serialized(self, cb, *args, **kwargs):
         # note: to avoid deadlock, this callable is *not* allowed to invoke
index f9272a9d5d85dd9d9d20f12993ccc279bd0b7e48..1d09f897e53fd84fbc74472bafa0e4382f95f27a 100644 (file)
@@ -44,8 +44,8 @@ class FakeCHKFileNode:
         return self.my_uri
     def get_readonly_uri(self):
         return self.my_uri
-    def get_verifier(self):
-        return IURI(self.my_uri).get_verifier()
+    def get_verify_cap(self):
+        return IURI(self.my_uri).get_verify_cap()
     def get_storage_index(self):
         return self.storage_index
 
index fdd6f05d1273c22d8954b2d97d3c44f24bfcace2..9b0308d96d52406de44a0b479099a9eeadda60b4 100644 (file)
@@ -100,7 +100,7 @@ class CLI(unittest.TestCase):
                                 u.to_string())
         self.failUnless("client renewal secret: znxmki5zdibb5qlt46xbdvk2t55j7hibejq3i5ijyurkr6m6jkhq" in output, output)
 
-        output = self._dump_cap(u.get_verifier().to_string())
+        output = self._dump_cap(u.get_verify_cap().to_string())
         self.failIf("key: " in output, output)
         self.failUnless("UEB hash: nf3nimquen7aeqm36ekgxomalstenpkvsdmf6fplj7swdatbv5oa" in output, output)
         self.failUnless("size: 1234" in output, output)
@@ -169,7 +169,7 @@ class CLI(unittest.TestCase):
         self.failUnless("storage index: nt4fwemuw7flestsezvo2eveke" in output, output)
         self.failUnless("fingerprint: 737p57x6737p57x6737p57x6737p57x6737p57x6737p57x6737a" in output, output)
 
-        u = u.get_verifier()
+        u = u.get_verify_cap()
         output = self._dump_cap(u.to_string())
         self.failUnless("SSK Verifier URI:" in output, output)
         self.failUnless("storage index: nt4fwemuw7flestsezvo2eveke" in output, output)
@@ -213,7 +213,7 @@ class CLI(unittest.TestCase):
         self.failUnless("storage index: nt4fwemuw7flestsezvo2eveke" in output, output)
         self.failUnless("fingerprint: 737p57x6737p57x6737p57x6737p57x6737p57x6737p57x6737a" in output, output)
 
-        u = u.get_verifier()
+        u = u.get_verify_cap()
         output = self._dump_cap(u.to_string())
         self.failUnless("Directory Verifier URI:" in output, output)
         self.failUnless("storage index: nt4fwemuw7flestsezvo2eveke" in output, output)
index 142b5da561edb119eb3418a09fc0679ac4ad8393..d29e5da9e8fe61e340753a22448e5091186d7d9b 100644 (file)
@@ -36,7 +36,7 @@ class Marker:
         return self.nodeuri
     def get_readonly_uri(self):
         return self.nodeuri
-    def get_verifier(self):
+    def get_verify_cap(self):
         return self.verifieruri
     def get_storage_index(self):
         return self.storage_index
@@ -295,7 +295,7 @@ class Dirnode(unittest.TestCase,
             self.failUnless(u.startswith("URI:DIR2:"), u)
             u_ro = n.get_readonly_uri()
             self.failUnless(u_ro.startswith("URI:DIR2-RO:"), u_ro)
-            u_v = n.get_verifier().to_string()
+            u_v = n.get_verify_cap().to_string()
             self.failUnless(u_v.startswith("URI:DIR2-Verifier:"), u_v)
             self.expected_manifest.append( ((), u) )
             self.expected_verifycaps.add(u_v)
@@ -311,7 +311,7 @@ class Dirnode(unittest.TestCase,
             fake_file_uri = make_mutable_file_uri()
             other_file_uri = make_mutable_file_uri()
             m = Marker(fake_file_uri)
-            ffu_v = m.get_verifier().to_string()
+            ffu_v = m.get_verify_cap().to_string()
             self.expected_manifest.append( ((u"child",) , m.get_uri()) )
             self.expected_verifycaps.add(ffu_v)
             self.expected_storage_indexes.add(base32.b2a(m.get_storage_index()))
@@ -332,7 +332,7 @@ class Dirnode(unittest.TestCase,
             def _created(subdir):
                 self.failUnless(isinstance(subdir, FakeDirectoryNode))
                 self.subdir = subdir
-                new_v = subdir.get_verifier().to_string()
+                new_v = subdir.get_verify_cap().to_string()
                 assert isinstance(new_v, str)
                 self.expected_manifest.append( ((u"subdir",), subdir.get_uri()) )
                 self.expected_verifycaps.add(new_v)
index 46db7fcd21c29dd215c27e3bf89ae03184978172..0fdc05139821ee7f512c17cee1b1ae3aa65a3805 100644 (file)
@@ -40,7 +40,7 @@ class Node(unittest.TestCase):
         self.failUnlessEqual(fn1.get_storage_index(), u.storage_index)
         d = {}
         d[fn1] = 1 # exercise __hash__
-        v = fn1.get_verifier()
+        v = fn1.get_verify_cap()
         self.failUnless(isinstance(v, uri.CHKFileVerifierURI))
 
 
@@ -62,7 +62,7 @@ class Node(unittest.TestCase):
         d = {}
         d[fn1] = 1 # exercise __hash__
 
-        v = fn1.get_verifier()
+        v = fn1.get_verify_cap()
         self.failUnlessEqual(v, None)
 
         d = fn1.download(download.Data())
@@ -125,7 +125,7 @@ class Node(unittest.TestCase):
         self.failUnlessEqual(nro.is_mutable(), True)
         self.failUnlessEqual(nro.is_readonly(), True)
 
-        v = n.get_verifier()
+        v = n.get_verify_cap()
         self.failUnless(isinstance(v, uri.SSKVerifierURI))
 
 class LiteralChecker(unittest.TestCase):
index 9740f3275064b2959ee9fd0052767c8a3ec48430..7d78f14a47cd0d2c2c525896778c49b46649f4b0 100644 (file)
@@ -2470,9 +2470,9 @@ class DeepCheckWebGood(DeepCheckBase, unittest.TestCase):
                                  base32.b2a(self.root.get_storage_index()))
             verifycaps = data["verifycaps"]
             self.failUnlessEqual(len(verifycaps), 3)
-            self.failUnless(self.root.get_verifier().to_string() in verifycaps)
-            self.failUnless(self.mutable.get_verifier().to_string() in verifycaps)
-            self.failUnless(self.large.get_verifier().to_string() in verifycaps)
+            self.failUnless(self.root.get_verify_cap().to_string() in verifycaps)
+            self.failUnless(self.mutable.get_verify_cap().to_string() in verifycaps)
+            self.failUnless(self.large.get_verify_cap().to_string() in verifycaps)
         d.addCallback(_check2r)
 
         d.addCallback(lambda res:
index 858009f0424882ba2cd3b42987021e7e7a5391a6..e81d466d3e01f2083e5de6955bf90c4cb61b9e40 100644 (file)
@@ -27,7 +27,7 @@ class Literal(unittest.TestCase):
 
         u3 = u.get_readonly()
         self.failUnlessIdentical(u, u3)
-        self.failUnlessEqual(u.get_verifier(), None)
+        self.failUnlessEqual(u.get_verify_cap(), None)
 
         he = u.to_human_encoding()
         u_h = uri.LiteralFileURI.init_from_human_encoding(he)
@@ -114,7 +114,7 @@ class CHKFile(unittest.TestCase):
         self.failUnless(u2.is_readonly())
         self.failIf(u2.is_mutable())
 
-        v = u.get_verifier()
+        v = u.get_verify_cap()
         self.failUnless(isinstance(v.to_string(), str))
         v2 = uri.from_string(v.to_string())
         self.failUnlessEqual(v, v2)
@@ -249,13 +249,13 @@ class Mutable(unittest.TestCase):
         self.failUnless("ReadonlySSKFileURI" in str(u4a))
         self.failUnlessIdentical(u4a.get_readonly(), u4a)
 
-        u5 = u4.get_verifier()
+        u5 = u4.get_verify_cap()
         self.failUnless(IVerifierURI.providedBy(u5))
         self.failUnlessEqual(u5.storage_index, u.storage_index)
         u6 = IVerifierURI(u5.to_string())
         self.failUnless(IVerifierURI.providedBy(u6))
         self.failUnlessEqual(u6.storage_index, u.storage_index)
-        u7 = u.get_verifier()
+        u7 = u.get_verify_cap()
         self.failUnless(IVerifierURI.providedBy(u7))
         self.failUnlessEqual(u7.storage_index, u.storage_index)
 
@@ -315,17 +315,17 @@ class NewDirnode(unittest.TestCase):
         self.failIf(IFileURI.providedBy(u4))
         self.failUnless(IDirnodeURI.providedBy(u4))
 
-        u4_verifier = u4.get_verifier()
+        u4_verifier = u4.get_verify_cap()
         u4_verifier_filenode = u4_verifier.get_filenode_uri()
         self.failUnless(isinstance(u4_verifier_filenode, uri.SSKVerifierURI))
 
-        verifiers = [u1.get_verifier(), u2.get_verifier(),
-                     u3.get_verifier(), u4.get_verifier(),
-                     IVerifierURI(u1.get_verifier().to_string()),
-                     uri.NewDirectoryURIVerifier(n.get_verifier()),
-                     uri.NewDirectoryURIVerifier(n.get_verifier().to_string()),
+        verifiers = [u1.get_verify_cap(), u2.get_verify_cap(),
+                     u3.get_verify_cap(), u4.get_verify_cap(),
+                     IVerifierURI(u1.get_verify_cap().to_string()),
+                     uri.NewDirectoryURIVerifier(n.get_verify_cap()),
+                     uri.NewDirectoryURIVerifier(n.get_verify_cap().to_string()),
                      ]
         for v in verifiers:
             self.failUnless(IVerifierURI.providedBy(v))
             self.failUnlessEqual(v._filenode_uri,
-                                 u1.get_verifier()._filenode_uri)
+                                 u1.get_verify_cap()._filenode_uri)
index 64e6a59e7b2432e26e95d2c1db2c892edd7a16b4..4a91e36156322b5e919642e2f904ddb72bc814e1 100644 (file)
@@ -657,7 +657,7 @@ class Web(WebMixin, testutil.StallMixin, unittest.TestCase):
 
     def test_GET_unhandled_URI_named(self):
         contents, n, newuri = self.makefile(12)
-        verifier_cap = n.get_verifier().to_string()
+        verifier_cap = n.get_verify_cap().to_string()
         base = "/file/%s" % urllib.quote(verifier_cap)
         # client.create_node_from_uri() can't handle verify-caps
         d = self.shouldFail2(error.Error, "GET_unhandled_URI_named",
@@ -668,7 +668,7 @@ class Web(WebMixin, testutil.StallMixin, unittest.TestCase):
 
     def test_GET_unhandled_URI(self):
         contents, n, newuri = self.makefile(12)
-        verifier_cap = n.get_verifier().to_string()
+        verifier_cap = n.get_verify_cap().to_string()
         base = "/uri/%s" % urllib.quote(verifier_cap)
         # client.create_node_from_uri() can't handle verify-caps
         d = self.shouldFail2(error.Error, "test_GET_unhandled_URI",
index 0a67f44848d4d4bf768c8192486096083fdfe4df..8994cce7c873aec6894022d8751d97e8991469dd 100644 (file)
@@ -99,7 +99,7 @@ class CHKFileURI(_BaseURI):
     def get_size(self):
         return self.size
 
-    def get_verifier(self):
+    def get_verify_cap(self):
         return CHKFileVerifierURI(storage_index=self.storage_index,
                                   uri_extension_hash=self.uri_extension_hash,
                                   needed_shares=self.needed_shares,
@@ -185,7 +185,7 @@ class LiteralFileURI(_BaseURI):
     def get_storage_index(self):
         return None
 
-    def get_verifier(self):
+    def get_verify_cap(self):
         # LIT files need no verification, all the data is present in the URI
         return None
 
@@ -238,7 +238,7 @@ class WriteableSSKFileURI(_BaseURI):
         return True
     def get_readonly(self):
         return ReadonlySSKFileURI(self.readkey, self.fingerprint)
-    def get_verifier(self):
+    def get_verify_cap(self):
         return SSKVerifierURI(self.storage_index, self.fingerprint)
 
 class ReadonlySSKFileURI(_BaseURI):
@@ -284,7 +284,7 @@ class ReadonlySSKFileURI(_BaseURI):
         return True
     def get_readonly(self):
         return self
-    def get_verifier(self):
+    def get_verify_cap(self):
         return SSKVerifierURI(self.storage_index, self.fingerprint)
 
 class SSKVerifierURI(_BaseURI):
@@ -361,8 +361,8 @@ class _NewDirectoryBaseURI(_BaseURI):
     def is_mutable(self):
         return True
 
-    def get_verifier(self):
-        return NewDirectoryURIVerifier(self._filenode_uri.get_verifier())
+    def get_verify_cap(self):
+        return NewDirectoryURIVerifier(self._filenode_uri.get_verify_cap())
 
     def get_storage_index(self):
         return self._filenode_uri.get_storage_index()
index b15bc2be292a165832c219855e4d5a73dfab3dff..0d1b27038e1672dcd985a68c83053386dceeb4cc 100644 (file)
@@ -85,7 +85,7 @@ class MoreInfo(rend.Page):
         node = self.original
         if not IDirectoryNode.providedBy(node):
             return ""
-        return ctx.tag[node.get_verifier().to_string()]
+        return ctx.tag[node.get_verify_cap().to_string()]
 
 
     def render_file_writecap(self, ctx, data):
@@ -106,9 +106,9 @@ class MoreInfo(rend.Page):
         node = self.original
         if IDirectoryNode.providedBy(node):
             node = node._node
-        verifier = node.get_verifier()
+        verifier = node.get_verify_cap()
         if verifier:
-            return ctx.tag[node.get_verifier().to_string()]
+            return ctx.tag[node.get_verify_cap().to_string()]
         return ""
 
     def get_root(self, ctx):