Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-15299

Absent validation of of stack_version id during API request to deeper entities

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.0
    • 2.4.0
    • ambari-server
    • None

    Description

      Request:

      http://server:8080/api/v1/clusters/cl1/stack_versions
      

      returns:

      {
      "href" : "http://server:8080/api/v1/clusters/cl1/stack_versions",
      "items" : [
      {
      "href" : "http://server:8080/api/v1/clusters/cl1/stack_versions/1",
      "ClusterStackVersions" : {
      "cluster_name" : "cl1",
      "id" : 1,
      "repository_version" : 1,
      "stack" : "HDP",
      "version" : "2.3"
      }
      }
      ]
      }
      

      But we can sent request to not available stack_versions:

      http://server:8080/api/v1/clusters/cl1/stack_versions/34343rfff4/repository_versions/1/operating_systems/debian7/repositories/HDP-2.3
      

      returns:

      {
      "href" : "http://server:8080/api/v1/clusters/cl1/stack_versions/34343rfff4/repository_versions/1/operating_systems/debian7/repositories/HDP-2.3",
      "Repositories" : {
      "base_url" : "http://s3.amazonaws.com/hortonworks.com/HDP/debian7/2.x/BUILDS/2.3.4.0-3335",
      "default_base_url" : "",
      "latest_base_url" : "",
      "mirrors_list" : "",
      "os_type" : "debian7",
      "repo_id" : "HDP-2.3",
      "repo_name" : "HDP",
      "repository_version_id" : 1,
      "stack_name" : "HDP",
      "stack_version" : "2.3"
      }
      }
      

      There should be some type of validation of used stack_versio.

      Attachments

        1. AMBARI-15299.patch
          1 kB
          Dmitry Lysnichenko

        Issue Links

          Activity

            People

              dmitriusan Dmitry Lysnichenko
              dmitriusan Dmitry Lysnichenko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: