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 +4 -4
- data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +12 -5
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 626ea42063dcd5c2b6ab1c8548b99039a64eb49570e828e416699a05e3fd8e4e
|
|
4
|
+
data.tar.gz: a1b14513544d7bf58ac8344364333e8517eaee6a444f57aab61a0b4efe8b6807
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
#
|
|
228
|
-
#
|
|
229
|
-
|
|
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
|
|
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
|
|
data/package.json
CHANGED