Commit Graph

2404 Commits

Author SHA1 Message Date
Brian Warner
d2426ea3bd move convergence secret into SecretHolder, next to lease secret 2009-11-17 17:54:44 -08:00
Brian Warner
5fe713fc52 nodemaker: implement immutable directories (internal interface), for #607
* nodemaker.create_from_cap() now handles DIR2-CHK and DIR2-LIT
* client.create_immutable_dirnode() is used to create them
* no webapi yet
2009-11-11 16:22:33 -08:00
Brian Warner
cc422f8dc0 stop using IURI()/etc as an adapter 2009-11-11 14:45:42 -08:00
Brian Warner
131e05b155 clean up uri-vs-cap terminology, emphasize cap instances instead of URI strings
* "cap" means a python instance which encapsulates a filecap/dircap (uri.py)
 * "uri" means a string with a "URI:" prefix
 * FileNode instances are created with (and retain) a cap instance, and
   generate uri strings on demand
 * .get_cap/get_readcap/get_verifycap/get_repaircap return cap instances
 * .get_uri/get_readonly_uri return uri strings

* add filenode.download_to_filename() for control.py, should find a better way
* use MutableFileNode.init_from_cap, not .init_from_uri
* directory URI instances: use get_filenode_cap, not get_filenode_uri
* update/cleanup bench_dirnode.py to match, add Makefile target to run it
2009-11-11 14:26:19 -08:00
Brian Warner
f47672d12a add parser for immutable directory caps: DIR2-CHK, DIR2-LIT, DIR2-CHK-Verifier 2009-11-04 10:13:51 -08:00
Zooko O'Whielacronx
9733201c0b wui: s/TahoeLAFS/Tahoe-LAFS/ 2009-10-28 18:50:50 -08:00
Zooko O'Whielacronx
1be4d45779 tests: bump up the timeout on test_repairer to see if 120 seconds was too short for François's ARM box to do the test even when it was doing it right. 2009-10-27 13:48:00 -08:00
Brian Warner
2695af91a7 dirnode.pack_children(): add deep_immutable= argument
This will be used by DIR2:CHK to enforce the deep-immutability requirement.
2009-10-26 09:28:09 -07:00
Brian Warner
768c76aa5f webapi: use t=mkdir-with-children instead of a children= arg to t=mkdir .
This is safer: in the earlier API, an old webapi server would silently ignore
the initial children, and clients trying to set them would have to fetch the
newly-created directory to discover the incompatibility. In the new API,
clients using t=mkdir-with-children against an old webapi server will get a
clear error.
2009-10-25 18:13:21 -07:00
Brian Warner
1273b5c233 nodemaker.create_new_mutable_directory: pack_children() in initial_contents=
instead of creating an empty file and then adding the children later.

This should speed up mkdir(initial_children) considerably, removing two
roundtrips and an entire read-modify-write cycle, probably bringing it down
to a single roundtrip. A quick test (against the volunteergrid) suggests a
30% speedup.

test_dirnode: add new tests to enforce the restrictions that interfaces.py
claims for create_new_mutable_directory(): no UnknownNodes, metadata dicts
2009-10-19 17:51:18 -07:00
Brian Warner
59ee02e82f test_dirnode.py: add tests of initial_children= args to client.create_dirnode
and nodemaker.create_new_mutable_directory
2009-10-17 12:41:59 -07:00
Brian Warner
b4ec86c95a update many dirnode interfaces to accept dict-of-nodes instead of dict-of-caps
interfaces.py: define INodeMaker, document argument values, change
               create_new_mutable_directory() to take dict-of-nodes. Change
               dirnode.set_nodes() and dirnode.create_subdirectory() too.
nodemaker.py: use INodeMaker, update create_new_mutable_directory()
client.py: have create_dirnode() delegate initial_children= to nodemaker
dirnode.py (Adder): take dict-of-nodes instead of list-of-nodes, which
                    updates set_nodes() and create_subdirectory()
web/common.py (convert_initial_children_json): create dict-of-nodes
web/directory.py: same
web/unlinked.py: same
test_dirnode.py: update tests to match
2009-10-17 12:28:29 -07:00
Brian Warner
8a7c980e37 dirnode.py: move pack_children() out to a function, for eventual use by others 2009-10-17 11:07:07 -07:00
Brian Warner
ea373de042 move dirnode.CachingDict to dictutil.AuxValueDict, generalize method names,
improve tests. Let dirnode _pack_children accept either dict or AuxValueDict.
2009-10-17 11:00:05 -07:00
Brian Warner
e63f59f50c test/common.py: update FakeMutableFileNode to new contents= callable scheme 2009-10-12 22:21:54 -07:00
Brian Warner
480e1d318d The initial_children= argument to nodemaker.create_new_mutable_directory is
now enabled.
2009-10-12 20:19:22 -07:00
Brian Warner
c2520e4ec7 client.create_mutable_file(contents=) now accepts a callable, which is
invoked with the new MutableFileNode and is supposed to return the initial
contents. This can be used by e.g. a new dirnode which needs the filenode's
writekey to encrypt its initial children.

create_mutable_file() still accepts a bytestring too, or None for an empty
file.
2009-10-12 20:12:32 -07:00
Brian Warner
b30041c5ec webapi: t=mkdir now accepts initial children, using the same JSON that t=json
emits.

client.create_dirnode(initial_children=) now works.
2009-10-12 19:34:44 -07:00
Brian Warner
cf65cc2ae3 replace dirnode.create_empty_directory() with create_subdirectory(), which
takes an initial_children= argument
2009-10-12 19:15:20 -07:00
Brian Warner
d079eb45f6 dirnode.set_children: change return value: fire with self instead of None 2009-10-12 18:50:26 -07:00
Brian Warner
f871c3bb3d dirnode.set_nodes: change return value: fire with self instead of None 2009-10-12 18:45:46 -07:00
Brian Warner
304aadd4f7 dirnode.set_children: take a dict, not a list 2009-10-12 17:24:40 -07:00
Brian Warner
e2ffc3dc03 dirnode.set_uri/set_children: change signature to take writecap+readcap
instead of a single cap. The webapi t=set_children call benefits too.
2009-10-12 16:51:26 -07:00
Brian Warner
3ee740628a replace Client.create_empty_dirnode() with create_dirnode(), in anticipation
of adding initial_children= argument.

Includes stubbed-out initial_children= support.
2009-10-12 15:45:06 -07:00
Brian Warner
576c47d61e test_web.py: use a less-fake client, making test harness smaller 2009-10-12 15:28:08 -07:00
Brian Warner
f4aa418086 Verifier: check the full cryptext-hash tree on each share. Removed .todos
from the last few test_repairer tests that were waiting on this.
2009-10-05 15:18:49 -07:00
Brian Warner
504c767d03 Verifier: check the full block-hash-tree on each share
Removed the .todo from two test_repairer tests that check this. The only
remaining .todos are on the three crypttext-hash-tree tests.
2009-10-05 14:48:44 -07:00
Brian Warner
e8f56af5a7 Verifier: check the full share-hash chain on each share
Removed the .todo from two test_repairer tests that check this.
2009-10-05 14:34:43 -07:00
Brian Warner
bbd00de495 test_repairer: rename Verifier test cases to be more precise and less verbose 2009-10-05 13:11:15 -07:00
Brian Warner
be95129833 immutable/checker.py: rearrange code a little bit, make it easier to follow 2009-10-05 13:02:52 -07:00
Brian Warner
9dba4ec641 test/common.py: wrap docstrings to 80cols so I can read them more easily 2009-10-05 13:01:43 -07:00
Brian Warner
19d336513c immutable/download.py: wrap to 80cols, no functional changes 2009-10-05 12:25:42 -07:00
Zooko O'Whielacronx
00a44c057a docs: a few licensing clarifications requested by Ubuntu 2009-09-26 20:32:26 -07:00
Zooko O'Whielacronx
aaaa633f18 setup: remove a convenience copy of figleaf, to ease inclusion into Ubuntu Karmic Koala
We need to carefully document the licence of figleaf in order to get Tahoe-LAFS into Ubuntu Karmic Koala.  However, figleaf isn't really a part of Tahoe-LAFS per se -- this is just a "convenience copy" of a development tool.  The quickest way to make Tahoe-LAFS acceptable for Karmic then, is to remove figleaf from the Tahoe-LAFS tarball itself.  People who want to run figleaf on Tahoe-LAFS (as everyone should want) can install figleaf themselves.  I haven't tested this -- there may be incompatibilities between upstream figleaf and the copy that we had here...
2009-09-23 22:32:15 -07:00
Zooko O'Whielacronx
9f0da4012e docs: Shawn Willden grants permission for his contributions under GPL2+|TGPPL1+ 2009-09-21 09:46:51 -07:00
Zooko O'Whielacronx
603e08c4a9 doc: licensing cleanups
Use nice utf-8 © instead of "(c)". Remove licensing statements on utility modules that have been assigned to allmydata.com by their original authors. (Nattraverso was not assigned to allmydata.com -- it was LGPL'ed -- but I checked and src/allmydata/util/iputil.py was completely rewritten and doesn't contain any line of code from nattraverso.)  Add notes to misc/debian/copyright about licensing on files that aren't just allmydata.com-licensed.
2009-09-20 10:16:31 -07:00
Brian Warner
14cb5ca436 test/check_speed.py: fix shbang line 2009-08-17 17:59:48 -07:00
Brian Warner
5283d4c19e de-Service-ify Helper, pass in storage_broker and secret_holder directly.
This makes it more obvious that the Helper currently generates leases with
the Helper's own secrets, rather than getting values from the client, which
is arguably a bug that will likely be resolved with the Accounting project.
2009-08-15 13:17:37 -07:00
Brian Warner
4a4a4f9520 immutable.Downloader: pass StorageBroker to constructor, stop being a Service
child of the client, access with client.downloader instead of
client.getServiceNamed("downloader"). The single "Downloader" instance is
scheduled for demolition anyways, to be replaced by individual
filenode.download calls.
2009-08-15 12:25:43 -07:00
Zooko O'Whielacronx
22c962bbc2 tests: double the timeout on test_runner.RunNode.test_introducer since feisty hit a timeout
I'm not sure if this is an actual timing issue (feisty is running on an overloaded VM if I recall correctly), or it there is a deeper bug.
2009-08-15 09:05:12 -07:00
Brian Warner
d214f7eebe stop making History be a Service, it wasn't necessary 2009-08-15 04:44:15 -07:00
Brian Warner
0d5dc51617 Overhaul IFilesystemNode handling, to simplify tests and use POLA internally.
* stop using IURI as an adapter
* pass cap strings around instead of URI instances
* move filenode/dirnode creation duties from Client to new NodeMaker class
* move other Client duties to KeyGenerator, SecretHolder, History classes
* stop passing Client reference to dirnode/filenode constructors
  - pass less-powerful references instead, like StorageBroker or Uploader
* always create DirectoryNodes by wrapping a filenode (mutable for now)
* remove some specialized mock classes from unit tests

Detailed list of changes (done one at a time, then merged together)

always pass a string to create_node_from_uri(), not an IURI instance
always pass a string to IFilesystemNode constructors, not an IURI instance
stop using IURI() as an adapter, switch on cap prefix in create_node_from_uri()
client.py: move SecretHolder code out to a separate class
test_web.py: hush pyflakes
client.py: move NodeMaker functionality out into a separate object
LiteralFileNode: stop storing a Client reference
immutable Checker: remove Client reference, it only needs a SecretHolder
immutable Upload: remove Client reference, leave SecretHolder and StorageBroker
immutable Repairer: replace Client reference with StorageBroker and SecretHolder
immutable FileNode: remove Client reference
mutable.Publish: stop passing Client
mutable.ServermapUpdater: get StorageBroker in constructor, not by peeking into Client reference
MutableChecker: reference StorageBroker and History directly, not through Client
mutable.FileNode: removed unused indirection to checker classes
mutable.FileNode: remove Client reference
client.py: move RSA key generation into a separate class, so it can be passed to the nodemaker
move create_mutable_file() into NodeMaker
test_dirnode.py: stop using FakeClient mockups, use NoNetworkGrid instead. This simplifies the code, but takes longer to run (17s instead of 6s). This should come down later when other cleanups make it possible to use simpler (non-RSA) fake mutable files for dirnode tests.
test_mutable.py: clean up basedir names
client.py: move create_empty_dirnode() into NodeMaker
dirnode.py: get rid of DirectoryNode.create
remove DirectoryNode.init_from_uri, refactor NodeMaker for customization, simplify test_web's mock Client to match
stop passing Client to DirectoryNode, make DirectoryNode.create_with_mutablefile the normal DirectoryNode constructor, start removing client from NodeMaker
remove Client from NodeMaker
move helper status into History, pass History to web.Status instead of Client
test_mutable.py: fix minor typo
2009-08-15 04:28:46 -07:00
Zooko O'Whielacronx
2a63fc9159 docs: update relnotes.txt, relnotes-short.txt, and others documentation bits for v1.5.0 release! 2009-08-01 19:57:10 -07:00
Brian Warner
ad45511156 ftpd: update docs, point to Twisted ticket for the proposed patch 2009-07-31 11:32:26 -07:00
Brian Warner
0d0e0ba2fb test_runner.py: tolerate symlinks in the source tree directory's ancestor path 2009-07-30 10:17:24 -07:00
Brian Warner
bf1e61c8f3 Touch up #705 changes:
webapi.txt: clarify replace=only-files argument, mention replace= on POST t=uri
 test_cli.py: insert whitespace between logical operations
 web.common.parse_replace_arg: make it case-insensitive, to match the docs
2009-07-20 11:38:03 -04:00
Zooko O'Whielacronx
b76ca4549a iputil: added "openbsd3" => "bsd" and "openbsd4" => "bsd" per tdelaet's report; should fix ticket #768 2009-07-20 06:13:14 -07:00
kevan
0d8b1e29fa Add tests for tahoe mv behavior 2009-07-19 20:46:09 -07:00
kevan
4331326b21 Add tests for tahoe mv help text 2009-07-19 20:45:53 -07:00
kevan
52aceb1a8e Implement more clearly defined moving semantics in tahoe_mv.py 2009-07-19 20:45:23 -07:00