[tahoe-dev] uricap.diff.txt
Brian Warner
warner-tahoe at allmydata.com
Mon May 19 14:49:43 PDT 2008
On Fri, 16 May 2008 12:51:42 -0600
zooko <zooko at zooko.com> wrote:
> Brian:
>
> Here is a diff of a change that I made that might interact with the
> webish.py refactoring that you are doing.
>
> The idea is: start accepting "cap" instead of "uri" in all of the
> various places where it matters (while still generating "uri" for
> backwards compatibility). This patch also generalizes and fixes the
> regex for URL caps per Ben Laurie's suggestion [1].
That sounds reasonable. The webish.py parts do collide with the code I just
pushed, but the other parts should not. Here are some fragments that might
help you adapt your webish.py changes to work with the new layout:
web/root.py:
URIHandler.render_GET
uri = get_arg(req, "cap", get_arg(req, "uri", None))
class Root:
child_uri = URIHandler()
child_cap = URIHandler()
The URL-censoring code is still in webish.py . Everything else moved into
src/allmydata/web/{root|directory|filenode}.py
We need new tests to get coverage of this new functionality.. not a complete
copy of the existing tests (please.. test_web.py is long enough as it is :-)
but just one or two methods that check the basics. And of course I would
start with changing the docs to quietly mention that /cap and ?cap= are
accepted in the same places as /uri and ?uri= .
> This patch also refactors uri.py to have separate notions of
> encodings of caps "for humans" and encodings of caps "for
> computers". The latter may in the future be more highly compressed.
I like that change, but I'd like to see a document that shows the different
forms next to each other, so we can think ahead about how we parse them and
what sort of future-compatible wiggle room we have left in the parse tree
space. Having all URIs start with "URI:\s+:" makes it very clear where the
room for expansion lies. I don't want us to accidentally cut off a useful
portion of that space by creating a compressed file-/dir-cap format which,
say, doesn't start with a version number.
cheers,
-Brian
More information about the tahoe-dev
mailing list