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
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)
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
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)
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()
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
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):
"""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
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
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
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
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)
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)
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)
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
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)
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()))
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)
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))
d = {}
d[fn1] = 1 # exercise __hash__
- v = fn1.get_verifier()
+ v = fn1.get_verify_cap()
self.failUnlessEqual(v, None)
d = fn1.download(download.Data())
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):
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:
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)
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)
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)
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)
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",
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",
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,
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
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):
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):
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()
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):
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):