Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-31007

Unexpected parameter passed to Compliance API

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 6.17.0
    • RH Cloud
    • 1
    • False
    • Important
    • Sprint 145
    • None
    • None
    • None
    • No Coverage

      Description of Problem

      When systems registered via Satellite try to upload report to Insights Compliance,
      branch_id parameter[1] is appended to the request.

      This causes Insights Compliance[2] to fail, because the API is designed not to accept unexpected parameters:

      I, [2025-02-05T01:06:20.163709 #32]  INFO -- : Started GET "/api/compliance/v2/systems/1987654d-32c1-0a9b-875a-ae5e12f3456c/policies?branch_id=9ea2b1ed-6755-4852-ac4e-114032e3662a" for 66.198.8.109 at 2025-02-05 01:06:20 +0000
      I, [2025-02-05T01:06:20.168597 #32]  INFO -- : Processing by V2::PoliciesController#index as */*
      I, [2025-02-05T01:06:20.168643 #32]  INFO -- :   Parameters: {"branch_id"=>"8937614d-32c3-0a3b-853a-ae3e32f4353c", "parents"=>[:systems], "system_id"=>"1987654d-32c1-0a9b-875a-ae5e12f3456c"}
      I, [2025-02-05T01:06:20.297491 #32]  INFO -- : found unpermitted parameter: :branch_id (ActionController::UnpermittedParameters)
      I, [2025-02-05T01:06:20.301450 #32]  INFO -- : Completed 422 Unprocessable Entity in 133ms (Views: 0.2ms | ActiveRecord: 0.7ms (1 query, 0 cached) | GC: 0.0ms)
      

      [1] https://github.com/theforeman/foreman_rh_cloud/blob/d995c7479152daca552960983a2aa8c330361890/app/services/foreman_rh_cloud/cloud_request_forwarder.rb#L54
      [2] https://github.com/RedHatInsights/compliance-backend/blob/d18f4c15f3fff82f93dd0075959b6c47d362c2b7/swagger/v2/openapi.json

      How reproducible

      Always

      Steps to Reproduce

      1. see https://issues.redhat.com/browse/RHINENG-15696

      Actual Behavior

      branch_id parameter[1] is appended to the request.

      Expected Behavior

      No Compliance APIv2 endpoint should be called with branch_id parameter

      Business Impact / Additional info

      Customers registering hosts via Satellite can not upload report to Insights Compliance.

              rhn-engineering-paji Partha Aji
              rhn-engineering-rblanco Roman Blanco
              Votes:
              0 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated:
                Resolved: