[nova][osc][api-sig] How strict should our clients be?

Stephen Finucane stephenfin at redhat.com
Tue Jun 22 16:39:42 UTC 2021


Hey,

We have an interesting problem that I wanted to poll opinions on. In OSC 5.5.0,
we closed most of the gaps between novaclient and openstackclient. As part of
these changes, we introduced validation of a number of requests such as
validating enum-style values. For example, [1][2][3]. This validation already
occurs on the server side, but by adding it to the client side we prevent users
sending invalid requests to the server in the first place and allow users to
discover the correct API behaviour from the client rather than having to read
the API docs or use trial and error.

Now, an issue has been opened against OSC. Apparently someone has been relying
on a bug in Nova to pass a different value to the API that what the schema
should have allowed, and they are dismayed that the client no longer allows them
to do this. They have asked [4][5] that we relax the client-side validation to
allow them to continue relying on this bug. As you can probably tell from my
comments, this seems to me to be an open and shut case: you shouldn't fork an
OpenStack API and you shouldn't side-step validation. However, I wanted to see
if anyone disagreed and thought there was merit in loose or no validation of API
requests made via our clients.

Let me know what you think,
Stephen

[1] https://github.com/openstack/python-openstackclient/blob/5.5.0/openstackclient/compute/v2/server.py#L1789-L1808
[2] https://github.com/openstack/python-openstackclient/blob/5.5.0/openstackclient/compute/v2/server.py#L1907-L1921
[3] https://github.com/openstack/python-openstackclient/blob/5.5.0/openstackclient/compute/v2/server_group.py#L62-L67
[4] https://storyboard.openstack.org/#!/story/2008975
[5] https://github.com/openstack/python-openstackclient/commit/ab0b1fe885ee0a210a58008b631521025be7f3eb




More information about the openstack-discuss mailing list