Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-1059

Proxy Policies Chain Update endpoint fails with a 500 if policies_config format is incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 2.9.1 GA
    • 2.2 GA, SaaS
    • System
    • None
    • 3scale 2019-12-09, 3scale 2019-12-23, 3scale 2020-01-13, 3scale 2020-01-27, 3scale 2020-02-03, 3scale 2020-02-17, 3scale 2020-03-09, 3scale 2020-03-23

      If the value of the policies_config parameter is not of an expected data type (e.g not an array), a 500 – Internal Server Error is thrown.

      Example:

      curl -v  -X PUT "https://3scale-admin.<DOMAIN>/admin/api/services/2/proxy/policies.json" -d 'access_token=<ACCESS_TOKEN>&policies_config=%7B%22policies_config%22%3A%5B%7B%22name%22%3A%22apicast%22%2C%22version%22%3A%22builtin%22%2C%22configuration%22%3A%7B%7D%2C%22enabled%22%3Atrue%7D%5D%7D'
      

      The payload is:

      {"policies_config":[{"name":"apicast","version":"builtin","configuration":{},"enabled":true}]}
      

      The exception shouldn't be raised, and some useful error message should be shown here instead.

      The documentation also needs to be improved and indicate what's the expected format of the parameter value.

      Dev notes

      1. Rework on the documentation, as people make mistake often
      2. Add a custom validation for the policy chain instead of failing hard (please talk to hramihaj)

            Unassigned Unassigned
            rhn-support-dmayorov Daria Mayorova
            Michael Coelho Michael Coelho
            Michal Macejko Michal Macejko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: