Wed Jan 27 07:03:09 GMT Standard Time 2010 david-sarah@jacaranda.org
* Miscellaneous documentation, test, and code formatting tweaks.
New patches:
[Miscellaneous documentation, test, and code formatting tweaks.
david-sarah@jacaranda.org**20100127070309
Ignore-this: 84ca7e4bb7c64221ae2c61144ef5edef
] {
hunk ./contrib/fuse/impl_c/blackmatch.py 909
class TStat(fuse.Stat):
# in fuse 0.2, these are set by fuse.Stat.__init__
- # in fuse 0.2-pre3 (hardy) they are not. badness unsues if they're missing
+ # in fuse 0.2-pre3 (hardy) they are not. badness ensues if they're missing
st_mode = None
st_ino = 0
st_dev = 0
hunk ./contrib/fuse/impl_c/blackmatch.py 1022
def get_uri(self):
return self.rw_uri or self.ro_uri
+ # TODO: rename to 'is_writeable', or switch sense to 'is_readonly', for consistency with Tahoe code
def writable(self):
return self.rw_uri and self.rw_uri != self.ro_uri
hunk ./docs/frontends/webapi.txt 73
these tasks. In general, everything that can be done with a PUT or DELETE can
also be done with a POST.
-Tahoe's web API is designed for two different consumers. The first is a
-program that needs to manipulate the virtual file system. Such programs are
+Tahoe's web API is designed for two different kinds of consumer. The first is
+a program that needs to manipulate the virtual file system. Such programs are
expected to use the RESTful interface described above. The second is a human
using a standard web browser to work with the filesystem. This user is given
a series of HTML pages with links to download files, and forms that use POST
hunk ./docs/frontends/webapi.txt 81
actions to upload, rename, and delete files.
When an error occurs, the HTTP response code will be set to an appropriate
-400-series code (like 404 for an unknown childname, or 400 Gone when a file
-is unrecoverable due to insufficient shares), and the HTTP response body will
-usually contain a few lines of explanation as to the cause of the error and
-possible responses. Unusual exceptions may result in a 500 Internal Server
-Error as a catch-all, with a default response body will contain a
-Nevow-generated HTML-ized representation of the Python exception stack trace
+400-series code (like 404 Not Found for an unknown childname, or 400 Bad Request
+when the parameters to a webapi operation are invalid), and the HTTP response
+body will usually contain a few lines of explanation as to the cause of the
+error and possible responses. Unusual exceptions may result in a
+500 Internal Server Error as a catch-all, with a default response body containing
+a Nevow-generated HTML-ized representation of the Python exception stack trace
that caused the problem. CLI programs which want to copy the response body to
stderr should provide an "Accept: text/plain" header to their requests to get
a plain text stack trace instead. If the Accept header contains */*, or
hunk ./docs/frontends/webapi.txt 111
read- and write- caps, which start with "URI:SSK", and give access to mutable
files.
-(later versions of Tahoe will make these strings shorter, and will remove the
+(Later versions of Tahoe will make these strings shorter, and will remove the
unfortunate colons, which must be escaped when these caps are embedded in
hunk ./docs/frontends/webapi.txt 113
-URLs).
+URLs.)
To refer to any Tahoe object through the web API, you simply need to combine
a prefix (which indicates the HTTP server to use) with the cap (which
hunk ./docs/frontends/webapi.txt 124
http://127.0.0.1:3456/uri/ + $CAP
So, to access the directory named above (which happens to be the
-publically-writable sample directory on the Tahoe test grid, described at
+publically-writeable sample directory on the Tahoe test grid, described at
http://allmydata.org/trac/tahoe/wiki/TestGrid), the URL would be:
http://127.0.0.1:3456/uri/URI%3ADIR2%3Adjrdkfawoqihigoett4g6auz6a%3Ajx5mplfpwexnoqff7y5e4zjus4lidm76dcuarpct7cckorh2dpgq/
hunk ./docs/frontends/webapi.txt 198
representable as such.
All Tahoe operations that refer to existing files or directories must include
-a suitable read- or write- cap in the URL: the wapi server won't add one
+a suitable read- or write- cap in the URL: the webapi server won't add one
for you. If you don't know the cap, you can't access the file. This allows
hunk ./docs/frontends/webapi.txt 200
-the security properties of Tahoe caps to be extended across the wapi
+the security properties of Tahoe caps to be extended across the webapi
interface.
== Slow Operations, Progress, and Cancelling ==
hunk ./docs/frontends/webapi.txt 274
since the operation completed) will remain valid for ten minutes.
Many "slow" operations can begin to use unacceptable amounts of memory when
-operation on large directory structures. The memory usage increases when the
+operating on large directory structures. The memory usage increases when the
ophandle is polled, as the results must be copied into a JSON string, sent
over the wire, then parsed by a client. So, as an alternative, many "slow"
operations have streaming equivalents. These equivalents do not use operation
hunk ./docs/frontends/webapi.txt 314
retrieve the same contents that were just uploaded. This will create any
necessary intermediate subdirectories.
- To use the /uri/$FILECAP form, $FILECAP be a write-cap for a mutable file.
+ To use the /uri/$FILECAP form, $FILECAP must be a write-cap for a mutable file.
In the /uri/$DIRCAP/[SUBDIRS../]FILENAME form, if the target file is a
hunk ./docs/frontends/webapi.txt 317
- writable mutable file, that files contents will be overwritten in-place. If
+ writeable mutable file, that file's contents will be overwritten in-place. If
it is a read-cap for a mutable file, an error will occur. If it is an
immutable file, the old file will be discarded, and a new one will be put in
its place.
hunk ./docs/frontends/webapi.txt 336
PUT /uri
This uploads a file, and produces a file-cap for the contents, but does not
- attach the file into the virtual drive. No directories will be modified by
+ attach the file into the filesystem. No directories will be modified by
this operation. The file-cap is returned as the body of the HTTP response.
If "mutable=true" is in the query arguments, the operation will create a
hunk ./docs/frontends/webapi.txt 350
Create a new empty directory and return its write-cap as the HTTP response
body. This does not make the newly created directory visible from the
- virtual drive. The "PUT" operation is provided for backwards compatibility:
+ filesystem. The "PUT" operation is provided for backwards compatibility:
new code should use POST.
POST /uri?t=mkdir-with-children
hunk ./docs/frontends/webapi.txt 391
"linkcrtime": 1202777696.7564139,
"linkmotime": 1202777696.7564139,
} } } ]
- }
+ }
Note that the webapi-using client application must not provide the
"Content-Type: multipart/form-data" header that usually accompanies HTML
hunk ./docs/frontends/webapi.txt 453
As above, but the new directory will be populated with initial children via
the POST request body, as described in /uri?t=mkdir-with-children above.
Note that the name= argument must be passed as a queryarg, because the POST
- request body is used for the initial children JSON.
+ request body is used for the initial children JSON.
POST /uri/$DIRCAP/[SUBDIRS../]?t=mkdir-immutable&name=NAME
hunk ./docs/frontends/webapi.txt 549
Then the rw_uri field will be present in the information about a directory
if and only if you have read-write access to that directory. The verify_uri
- field will be presend if and only if the object has a verify-cap
+ field will be present if and only if the object has a verify-cap
(non-distributed LIT files do not have verify-caps).
==== About the metadata ====
hunk ./docs/frontends/webapi.txt 625
link points.
4. Also, quite apart from Tahoe, you might be confused about the meaning of
- the 'ctime' in unix local filesystems, which people sometimes think means
- file creation time, but which actually means, in unix local filesystems, the
+ the 'ctime' in UNIX local filesystems, which people sometimes think means
+ file creation time, but which actually means, in UNIX local filesystems, the
most recent time that the file contents or the file metadata (such as owner,
permission bits, extended attributes, etc.) has changed. Note that although
hunk ./docs/frontends/webapi.txt 629
- 'ctime' does not mean file creation time in Unix, it does mean link creation
+ 'ctime' does not mean file creation time in UNIX, it does mean link creation
time in Tahoe, unless the "tahoe backup" command has been used on that link,
in which case it means something about the local filesystem file which
corresponds to the Tahoe file which is pointed at by the link. It means
hunk ./docs/frontends/webapi.txt 637
Windows) or file-contents-or-metadata-update-time of the local file (if
"tahoe backup" was run on a different operating system).
-
=== Attaching an existing File or Directory by its read- or write- cap ===
PUT /uri/$DIRCAP/[SUBDIRS../]CHILDNAME?t=uri
hunk ./docs/frontends/webapi.txt 660
if there is already an object at the given location, rather than
overwriting the existing object. To allow the operation to overwrite a
file, but return an error when trying to overwrite a directory, use
- "replace=only-files" (this behavior is closer to the traditional unix "mv"
+ "replace=only-files" (this behavior is closer to the traditional UNIX "mv"
command). Note that "true", "t", and "1" are all synonyms for "True", and
"false", "f", and "0" are synonyms for "False", and the parameter is
case-insensitive.
hunk ./docs/frontends/webapi.txt 664
+
+ Note that this operation does not take its child cap in the form of
+ separate "rw_uri" and "ro_uri" fields. Therefore, it cannot accept a
+ child cap in a format unknown to the webapi server, because the server
+ is not able to attenuate an unknown write cap to a read cap.
=== Adding multiple files or directories to a parent directory at once ===
hunk ./docs/frontends/webapi.txt 728
The object will only become completely unreachable once 1: there are no
reachable directories that reference it, and 2: nobody is holding a read-
or write- cap to the object. (This behavior is very similar to the way
- hardlinks and anonymous files work in traditional unix filesystems).
+ hardlinks and anonymous files work in traditional UNIX filesystems).
This operation will not modify more than a single directory. Intermediate
directories which were implicitly created by PUT or POST methods will *not*
hunk ./docs/frontends/webapi.txt 857
POST /uri?t=upload
This uploads a file, and produces a file-cap for the contents, but does not
- attach the file into the virtual drive. No directories will be modified by
+ attach the file into the filesystem. No directories will be modified by
this operation.
The file must be provided as the "file" field of an HTML encoded form body,
hunk ./docs/frontends/webapi.txt 1597
== Static Files in /public_html ==
-The wapi server will take any request for a URL that starts with /static
+The webapi server will take any request for a URL that starts with /static
and serve it from a configurable directory which defaults to
$BASEDIR/public_html . This is configured by setting the "[node]web.static"
value in $BASEDIR/tahoe.cfg . If this is left at the default value of
hunk ./docs/frontends/webapi.txt 1605
served with the contents of the file $BASEDIR/public_html/subdir/foo.html .
This can be useful to serve a javascript application which provides a
-prettier front-end to the rest of the Tahoe wapi.
+prettier front-end to the rest of the Tahoe webapi.
hunk ./docs/frontends/webapi.txt 1608
-== safety and security issues -- names vs. URIs ==
+== Safety and security issues -- names vs. URIs ==
Summary: use explicit file- and dir- caps whenever possible, to reduce the
potential for surprises when the filesystem structure is changed.
hunk ./docs/frontends/webapi.txt 1683
Tahoe nodes implement internal serialization to make sure that a single Tahoe
node cannot conflict with itself. For example, it is safe to issue two
-directory modification requests to a single tahoe node's wapi server at the
+directory modification requests to a single tahoe node's webapi server at the
same time, because the Tahoe node will internally delay one of them until
after the other has finished being applied. (This feature was introduced in
Tahoe-1.1; back with Tahoe-1.0 the web client was responsible for serializing
hunk ./relnotes.txt 1
-ANNOUNCING Tahoe, the Lofty-Atmospheric Filesystem, v1.5
+ANNOUNCING Tahoe, the Lofty-Atmospheric Filesystem, v1.6
The Tahoe-LAFS team is pleased to announce the immediate
hunk ./relnotes.txt 4
-availability of version 1.5 of Tahoe, the Lofty Atmospheric
+availability of version 1.6 of Tahoe, the Lofty Atmospheric
File System.
Tahoe-LAFS is the first cloud storage technology which offers
hunk ./relnotes.txt 32
COMPATIBILITY
-Version 1.5 is fully compatible with the version 1 series of
-Tahoe-LAFS. Files written by v1.5 clients can be read by
-clients of all versions back to v1.0. v1.5 clients can read
-files produced by clients of all versions since v1.0. v1.5
-servers can serve clients of all versions back to v1.0 and v1.5
+Version 1.6 is fully compatible with the version 1 series of
+Tahoe-LAFS. Files written by v1.6 clients can be read by
+clients of all versions back to v1.0. v1.6 clients can read
+files produced by clients of all versions since v1.0. v1.6
+servers can serve clients of all versions back to v1.0 and v1.6
clients can use servers of all versions back to v1.0.
hunk ./relnotes.txt 39
-This is the sixth release in the version 1 series. The version
-1 series of Tahoe-LAFS will be actively supported and
+In addition, version 1.6 improves forward-compatibility with
+planned future cap formats, allowing updates to a directory
+containing both current and future caps, without loss of
+information.
+
+This is the seventh major release in the version 1 series. The
+version 1 series of Tahoe-LAFS will be actively supported and
maintained for the forseeable future, and future versions of
Tahoe-LAFS will retain the ability to read and write files
compatible with Tahoe-LAFS v1.
hunk ./src/allmydata/dirnode.py 26
from pycryptopp.cipher.aes import AES
from allmydata.util.dictutil import AuxValueDict
+
+# TODO: {Deleter,MetadataSetter,Adder}.modify all start by unpacking the
+# contents and end by repacking them. It might be better to apply them to
+# the unpacked contents.
+
class Deleter:
def __init__(self, node, name, must_exist=True):
self.node = node
hunk ./src/allmydata/interfaces.py 429
"""Return True if the data can be modified by *somebody* (perhaps
someone who has a more powerful URI than this one)."""
+ # TODO: rename to get_read_cap()
def get_readonly():
"""Return another IURI instance, which represents a read-only form of
this one. If is_readonly() is True, this returns self."""
hunk ./src/allmydata/test/test_web.py 702
self.PUT, base, "")
return d
+ # TODO: version of this with a Unicode filename
def test_GET_FILEURL_save(self):
hunk ./src/allmydata/test/test_web.py 704
- d = self.GET(self.public_url + "/foo/bar.txt?filename=bar.txt&save=true")
- # TODO: look at the headers, expect a Content-Disposition: attachment
- # header.
- d.addCallback(self.failUnlessIsBarDotTxt)
+ d = self.GET(self.public_url + "/foo/bar.txt?filename=bar.txt&save=true",
+ return_response=True)
+ def _got((res, statuscode, headers)):
+ content_disposition = headers["content-disposition"][0]
+ self.failUnless(content_disposition == 'attachment; filename="bar.txt"', content_disposition)
+ self.failUnlessIsBarDotTxt(res)
+ d.addCallback(_got)
return d
def test_GET_FILEURL_missing(self):
hunk ./src/allmydata/test/test_web.py 2178
# Fetch the welcome page.
d = self.GET("/")
def _after_get_welcome_page(res):
- MKDIR_BUTTON_RE=re.compile('