gapic-common 1.5.0 → 1.5.1

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: f9cc2de9bcbe93a62a1706acc73f6d37064bbde7a81a5c9fd434570ed8c6e22f
4
- data.tar.gz: 3be68b0522ce0e3465bfb555820c7c73882f2e1bf36ac009fd4bb4f31c0bb3bd
3
+ metadata.gz: 3906b246e3ecacee83c366fee3cd10077a56a72b29c3490ca8ff01ac4e124d65
4
+ data.tar.gz: c0a72cf00fa758234a196d385f53303d41c82cd895a17a339b185b7db529cf3b
5
5
  SHA512:
6
- metadata.gz: f958c2009dead1a09f0f20a9dda26f65d1698399657462b47b501297aff0e6af7496b4b0314237485bbb4f9a61d3866b9ee8e61ac26469c0ee69184c53cddd5b
7
- data.tar.gz: e8fd4368fab545fbc33636d5999e73bd9f8b664006f5967929cd8e09b25cfafb22e34a17d58ce1481b94474d952d2c7add11ba7644ba77ffab23b98c2b83728a
6
+ metadata.gz: 4aaff885138cd52a4f822ebb51af2f2c658700e7ba71d3b1199ada4c3871343e16cb66c1fc65a44606cf178316a07bb61f553a40bcf1ffd80e98a00758e18d51
7
+ data.tar.gz: 59232d7d58c9711b6e0e9e0b1da7ca3f0d69abbda9d10d4fa72412e463d8a57062a45f46131c5c24a392cbbc5e8e99be63b7491c4bcf668f77ed48b4e44a235f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 1.5.1 (2026-09-30)
4
+
5
+ #### Bug Fixes
6
+
7
+ * tighten path template matching in the REST transcoder ([#83](https://github.com/googleapis/ruby-core-libraries/issues/83))
8
+
3
9
  ### 1.5.0 (2026-09-29)
4
10
 
5
11
  #### Features
@@ -14,6 +14,6 @@
14
14
 
15
15
  module Gapic
16
16
  module Common
17
- VERSION = "1.5.0".freeze
17
+ VERSION = "1.5.1".freeze
18
18
  end
19
19
  end
@@ -111,7 +111,7 @@ module Gapic
111
111
  # @return [Hash{String, String}]
112
112
  # Name to value hash of the variables for the uri template expansion.
113
113
  # The values are percent-escaped with slashes potentially preserved.
114
- # @raise [Gapic::Common::Error] If any parameter value fails path traversal or injection validation.
114
+ # @raise [Gapic::Common::Error] If any parameter value fails path traversal validation.
115
115
  def bind_uri_values! http_binding, request_hash
116
116
  http_binding.field_bindings.to_h do |field_binding|
117
117
  field_path_camel = field_binding.field_path.split(".").map { |part| camel_name_for part }.join(".")
@@ -252,7 +252,7 @@ module Gapic
252
252
  # Returns nil if:
253
253
  # - the field is not found
254
254
  # - the field is a Message or an array,
255
- # - the regex does not match
255
+ # - the regex does not match the entire string representation
256
256
  # @param request_hash [Hash]
257
257
  # A hash of the GRPC request or the sub-request with the unset
258
258
  # proto3_optional fields removed.
@@ -266,7 +266,9 @@ module Gapic
266
266
 
267
267
  # Covers the case where in `foo.bar.baz`, `baz` is still a submessage or an array.
268
268
  return nil if value.is_a?(::Hash) || value.is_a?(::Array)
269
- value.to_s if value.to_s =~ regex
269
+ str = value.to_s
270
+ match = regex.match str
271
+ str if match && match.pre_match.empty? && match.post_match.empty?
270
272
  end
271
273
 
272
274
  # Finds a value in the hash by path.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gapic-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google API Authors