foreman_rh_cloud 13.2.3 → 13.2.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: 1137f9e903ac50cfdc823dd9df696230ae3963775a5e83419ad12c66d7bd29fe
4
- data.tar.gz: ef51daa638785296e25ffb43f7afaa10047fc4bea9cc940283496fb8509c3395
3
+ metadata.gz: 626ea42063dcd5c2b6ab1c8548b99039a64eb49570e828e416699a05e3fd8e4e
4
+ data.tar.gz: a1b14513544d7bf58ac8344364333e8517eaee6a444f57aab61a0b4efe8b6807
5
5
  SHA512:
6
- metadata.gz: fe25655b0fc41e329148dd9d365b7253685b95674651fa0e749d2a150e3a75c5a439d7f96e9ba74011ba5f276c216d5862180c75a25440aa26481d20247babd2
7
- data.tar.gz: 1c97da22e1e2ca4119c879c3d934460cbcb7b6a2d89ee042750b1e0d7fd94f16193771a4dffa75634b9f4f29650df72e664531befb94a00af3a32d9b68d1ce7f
6
+ metadata.gz: 9fc3cfd8db7340f6262802328a902ffe72fb68157ba2dbff2d85fa66c5e683144ac7fe38989e0e2fafbf2e2a39bd358723454438feec4699554e9e0985699082
7
+ data.tar.gz: 39c5017bb1d123f6e960e9cd7ed6578a4efe2cef613b9a808c4345a0aa89b6218c956de88175091417499f966bd06c950648442a887371cbee5f8ce4a34e05e5
@@ -224,14 +224,21 @@ module ForemanRhCloud
224
224
  def scope_request?(original_request, path)
225
225
  return nil unless original_request.get?
226
226
 
227
- # Only consider patterns that define tag_name - this ensures patterns without
228
- # tag_name (permission-only entries) cannot override tag-supporting patterns
229
- matching_patterns = SCOPED_REQUESTS.select { |pattern| pattern[:tag_name] && pattern[:test].match?(path) }
227
+ # Find patterns that match this path AND are relevant for GET requests.
228
+ # A pattern is relevant if it either:
229
+ # - Has tag_name defined (supports scoping)
230
+ # - Has GET permissions defined (explicitly handles GET, even without tags)
231
+ # This ensures patterns like api/vulnerability/v1/cves/[^/]+$ (GET without tags)
232
+ # take precedence over general patterns, while POST-only patterns are ignored.
233
+ matching_patterns = SCOPED_REQUESTS.select do |pattern|
234
+ pattern[:test].match?(path) && (pattern[:tag_name] || pattern.dig(:permissions, 'GET'))
235
+ end
230
236
  return nil if matching_patterns.empty?
231
237
 
232
- # Choose the most specific pattern by regex source length for consistency
233
- # with required_permission_for behavior
238
+ # Choose the most specific pattern by regex source length
234
239
  request_pattern = matching_patterns.max_by { |pattern| pattern[:test].source.length }
240
+
241
+ # Return the tag_name (may be nil if the most specific pattern doesn't support tags)
235
242
  request_pattern[:tag_name]
236
243
  end
237
244
 
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '13.2.3'.freeze
2
+ VERSION = '13.2.4'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "13.2.3",
3
+ "version": "13.2.4",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.2.3
4
+ version: 13.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team