[openstack-dev] [nova] path forward on making project_id optional in API URLs

Chris Dent cdent+os at anticdent.org
Wed Jan 13 15:31:02 UTC 2016

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.


> 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:

Chris Dent               (¨s¡ã¡õ¡ã)¨s¦à©ß©¥©ß            http://anticdent.org/
freenode: cdent                                         tw: @anticdent

More information about the OpenStack-dev mailing list