CCI-MOC / flocx-market

2 stars 9 forks source link

Invalid config queries should not be added to database #99

Open jdtzmn opened 5 years ago

jdtzmn commented 5 years ago

Posting to /bid with invalid server_config_query responds with a 500 status code, but the invalid query is still added to the database.

For example, the following server_config_query would respond with a status code of 500:

[
    [
      [
        "cpu_type",
        "contains",
        "intel"
      ],
      [
        "cores",
        ">=",
        "4"
      ],
      [
        "RAM_GB",
        ">=",
        "8"
      ],
      [
        "storage_size_GB",
        ">=",
        "512"
      ]
    ]
  ]

Later, when getting /bid, a 500 status code is shown because the flocx-market code is expecting a dict instead of an array. See the stack trace for more information.

There should be input checking for server queries to ensure that one can always see the existing bids.

larsks commented 5 years ago

@jdtzmn if this still reproduces, can you include the stack trace here? The link in your original report has expired.