foreman_rh_cloud 10.0.3 → 10.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ee25c439b8e8ef11143c3a772398691fde180e7b001c0746a7e2cbe4cfa4b8f
4
- data.tar.gz: 7f2bfb6dbcef65244329f71942fa9d40a5c753c307919414fd95beb3c6856f3e
3
+ metadata.gz: e8215c5bc0f5e21d7c4ee1b09ee2a38a44bc17d36c95606d77e8ee2cffc10d2e
4
+ data.tar.gz: f42e8b38e3f996cf29973a776ec03083aaa8db1fb58639690f7a50048c531260
5
5
  SHA512:
6
- metadata.gz: 0b2450546e69009b8621a8814d472ae373c765d99ca4b339f37349c2c78cd2f07f68f84f550a967feec6e646c4ecfc58a6f804336c521f2da91124f317e89a86
7
- data.tar.gz: 4f70f1b604a0493ad0d90f8a55af38685f4e298564addec4487fec5939943c92a6a1b7dc55c2a8c738edda963dedf842e278f5062a3fe01e75102be35379caa8
6
+ metadata.gz: bd2acf961ce05b7043013b695dccaab5d764d526b23aef83adc85373a0699fdc9a161bbd65c621d5fffc9139f254e88b6e6e53e2da9e5da6ade0330523c85f0b
7
+ data.tar.gz: 380d55213867c915d707f52470f6ec3aca269c3f2aa7bfc1aa2ba2db7659806c3c17824675fe5c9b2ef62df9704f0fb09f0cc2738bab17ea5339edd7c832dbad
@@ -51,7 +51,9 @@ module ForemanRhCloud
51
51
 
52
52
  def prepare_forward_params(original_request, branch_id)
53
53
  forward_params = original_request.query_parameters
54
- if original_request.user_agent && !original_request.user_agent.include?('redhat_access_cfme')
54
+ compliance_request = original_request.path.match?(/compliance\/v2(\/.*)?/)
55
+ user_agent = original_request.user_agent.present? && !original_request.user_agent.include?('redhat_access_cfme')
56
+ if user_agent && !compliance_request
55
57
  forward_params = forward_params.merge(:branch_id => branch_id)
56
58
  end
57
59
 
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '10.0.3'.freeze
2
+ VERSION = '10.0.4'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "10.0.3",
3
+ "version": "10.0.4",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -112,6 +112,30 @@ class CloudRequestForwarderTest < ActiveSupport::TestCase
112
112
  assert_equal params.merge(:branch_id => 74), @forwarder.prepare_forward_params(req, 74)
113
113
  end
114
114
 
115
+ test 'should NOT add branch id into forwarded params for compliance urls' do
116
+ user_agent = { :foo => :bar }
117
+ params = { :page => 5, :per_page => 42 }
118
+
119
+ uris = [
120
+ "/redhat_access/r/insights/platform/compliance/v2/systems/MyUUID/policies",
121
+ "/redhat_access/r/insights/platform/compliance/v2/policies/MyUUID",
122
+ "/redhat_access/r/insights/platform/compliance/v2/systems/MyUUID",
123
+ "/redhat_access/r/insights/platform/compliance/v2/policies",
124
+ "/redhat_access/r/insights/platform/compliance/v2/",
125
+ ]
126
+ uris.each do |uri|
127
+ req = ActionDispatch::Request.new(
128
+ 'REQUEST_URI' => uri,
129
+ 'REQUEST_METHOD' => 'GET',
130
+ 'HTTP_USER_AGENT' => user_agent,
131
+ 'rack.input' => ::Puma::NullIO.new,
132
+ 'action_dispatch.request.query_parameters' => params
133
+ )
134
+ req.stubs(:path).returns(uri)
135
+ refute @forwarder.prepare_forward_params(req, 74).key?(:branch_id), "Branch id should not be added for #{uri}"
136
+ end
137
+ end
138
+
115
139
  test 'should reuse BranchInfo identifiers for user_agent' do
116
140
  user_agent = { :foo => :bar }
117
141
  params = { :page => 5, :per_page => 42 }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.3
4
+ version: 10.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-04 00:00:00.000000000 Z
11
+ date: 2025-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman_ansible