On Wed, 13 Jan 2016, Sean Dague wrote:

Because this regex is built from a dictionary, hash seed matters, and it
is not stable which will get precedence.

Ow[1].

I'd like to propose for Nova we restrict project_id in the URL to
[0-9a-f]+, which is any valid hex string. Ints are a subset of this so
RAX will be fine. This will be enough to prevent the collision in the
case of extensions. I tried to float a question out to the operators
list about this, but I actually think this is sufficiently obscure
internals that most people aren't even aware that project_id isn't
always a uuid.

There was some discussion, if I recall correctly, about making the
restriction configurable, with the default [0-9a-f]+ (would
[0-9a-f-]+ be slight more flexible?) so that people who are doing
extra weird things (as pointed out by Morgan) have an option. That
seems like a good idea.

[1] python-routes seems pretty restricted (although better than
object dispatch!). I know its not something that is likely to
change (so this is really for people who might be considering modeling
themselves after Nova), but I've always preferred selector[2] because it
keeps an _ordered_ sequence of pattern/handler pairs that can be created
and extended either programmatically or through a declarative file[3].

[2] https://pypi.python.org/pypi/selector
[3] A reasonable example from the past:
https://github.com/tiddlyweb/tiddlyweb/blob/master/tiddlyweb/urls.map

--
Chris Dent               (�s°□°)�s�喋擤ォ�            http://anticdent.org/
freenode: cdent                                         tw: @anticdent
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to