savon 2.17.4 → 2.17.5

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: 2bba4a9ced6c62286d20de586b56ce7263413fa5e4b51771e87fded4c2433f39
4
- data.tar.gz: 9327a65ee629c258691084a822b635738b4d31ea38c5bd38f8e3399f11b16cd9
3
+ metadata.gz: ebee0f0be688d000144d03f78f17399219a59b9acdfa83a1416c603eaec79112
4
+ data.tar.gz: 3a5b2385872f10d4664f2cc298569e40249fe29e689194f0862148c0a474d5b1
5
5
  SHA512:
6
- metadata.gz: a1d50a4b5f588cc1e094189f41aada85a2bbecf7b6dbf92b27c6041d7b3eb882808ec69c0d2f0e907cc572cea73c17bad18f82d74c400e4019836200ce1255e9
7
- data.tar.gz: 9a61b3a21ae8a2c16761fb851c85355cd3e2575e540447ec7ac0fa5cbd42ae5bfa456c26813a5dce907fb9924f2cd6dece545f841f65a970a87445123fe90005
6
+ metadata.gz: 15ee4696bf210268256cd8110312f1e329524ae7c9efe6cebac86dfa35f918dfb7a7583667f7ae12e46504da7ee3de36e015d643aafc5472cfcef5eefd15bb88
7
+ data.tar.gz: ea85b81ec385af37c4e6e992b646c16bbfd8ff03f64cd4ce697f5dcabe6ba316c3d7829262caf73f14a30858c3c1af5fb3e73663a6b278748e8a374f8f384005
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.17.5] - 2026-09-09
9
+
10
+ ### Security
11
+
12
+ * `Savon::Model.operations` and `.all_operations` now reject names that normalize to reserved model methods with `ArgumentError`, before defining any methods. This prevents a WSDL operation named `client` from overwriting the client accessor and causing unbounded recursion. Call operations with reserved names explicitly through `model.client.call(:client, ...)`.
13
+
8
14
  ## [2.17.4] - 2026-07-03
9
15
 
10
16
  **Restore WS-Addressing headers and fix `:wsse_signature` resolution**
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Heavy metal SOAP client
4
4
 
5
- [![Ruby](https://github.com/savonrb/savon/actions/workflows/ci.yml/badge.svg)](https://github.com/savonrb/savon/actions/workflows/ci.yml)
6
- [![Gem Version](https://badge.fury.io/rb/savon.svg)](http://badge.fury.io/rb/savon)
7
- [![Coverage Status](https://coveralls.io/repos/savonrb/savon/badge.svg)](https://coveralls.io/r/savonrb/savon)
5
+ [![CI](https://github.com/savonrb/savon/actions/workflows/ci.yml/badge.svg)](https://github.com/savonrb/savon/actions/workflows/ci.yml)
6
+ [![Gem Version](https://img.shields.io/gem/v/savon.svg)](https://rubygems.org/gems/savon)
7
+ [![Coverage Status](https://coveralls.io/repos/github/savonrb/savon/badge.svg?branch=main)](https://coveralls.io/github/savonrb/savon?branch=main)
8
8
 
9
9
  Savon is a SOAP client for Ruby. [SOAP is the protocol](https://www.w3.org/TR/soap/) spoken by many enterprise systems. When they hand you a WSDL URL or file instead of a REST spec, it's SOAP. Savon reads the WSDL, maps available operations to Ruby symbols, converts Ruby hashes to SOAP envelopes and turns XML responses into hashes you can work with.
10
10
 
@@ -86,4 +86,4 @@ Callers on 2.13.0–2.15.x may see specific post-2.12.1 behaviors restored to th
86
86
 
87
87
  ## Contributing
88
88
 
89
- See [CONTRIBUTING.md](CONTRIBUTING.md). MIT licensed.
89
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Everyone interacting in Savon's codebases, issue trackers, and discussion forums is expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md). MIT licensed.
data/lib/savon/model.rb CHANGED
@@ -13,11 +13,13 @@ module Savon
13
13
 
14
14
  # Accepts one or more SOAP operations and generates both class and instance methods named
15
15
  # after the given operations. Each generated method accepts an optional SOAP message Hash.
16
+ # Raises ArgumentError for reserved model method names, before defining any methods.
16
17
  def operations(*operations)
17
- operations.each do |operation|
18
- define_class_operation(operation)
19
- define_instance_operation(operation)
18
+ operations.map { |operation| [operation, operation_method_name(operation)] }.each do |operation, method_name|
19
+ define_class_operation(operation, method_name)
20
+ define_instance_operation(method_name)
20
21
  end
22
+ operations
21
23
  end
22
24
 
23
25
  def all_operations
@@ -27,18 +29,14 @@ module Savon
27
29
  private
28
30
 
29
31
  # Defines a class-level SOAP operation.
30
- def define_class_operation(operation)
31
- method_name = operation_method_name(operation)
32
-
32
+ def define_class_operation(operation, method_name)
33
33
  class_operation_module.define_method(method_name) do |locals = {}|
34
34
  client.call operation, locals
35
35
  end
36
36
  end
37
37
 
38
38
  # Defines an instance-level SOAP operation.
39
- def define_instance_operation(operation)
40
- method_name = operation_method_name(operation)
41
-
39
+ def define_instance_operation(method_name)
42
40
  instance_operation_module.define_method(method_name) do |locals = {}|
43
41
  self.class.public_send(method_name, locals)
44
42
  end
@@ -46,7 +44,12 @@ module Savon
46
44
 
47
45
  # Returns the generated Ruby method name for a SOAP operation.
48
46
  def operation_method_name(operation)
49
- StringUtils.snakecase(operation.to_s).to_sym
47
+ method_name = StringUtils.snakecase(operation.to_s).to_sym
48
+ reserved_methods = Model.instance_methods(false) + Model.private_instance_methods(false) +
49
+ %i[client global raise_initialization_error!]
50
+ raise ArgumentError, "SOAP operation #{operation.inspect} conflicts with reserved Savon::Model method #{method_name.inspect}" if reserved_methods.include?(method_name)
51
+
52
+ method_name
50
53
  end
51
54
 
52
55
  # Class methods.
data/lib/savon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Savon
4
- VERSION = '2.17.4'
4
+ VERSION = '2.17.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savon
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.17.4
4
+ version: 2.17.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Harrington