simple_oauth 0.4.1 → 0.4.2

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: 73fa4671190dbbe2dc7178055d4ef82aeaabf7044b384d198ee12a0fa48f6de5
4
- data.tar.gz: f550391eb54731d6593dcab35f19bc419cbcbe63a6e48036be5f3cf4a419d069
3
+ metadata.gz: 5bce3e8cdfffe90e9a914e19705c101634ef6bccb620f1d7305761220ce104d4
4
+ data.tar.gz: 749264b00267e865c764beb8ea77429ecfb02f3d403b681a4734d40dd218d9f2
5
5
  SHA512:
6
- metadata.gz: 58f2b94d0568c491e46450e0c5cd35a9e45bed5827ee854fe17e02f4d02d74c3f5dd300eeebbfc890964afb72000a6e0f3b6db38db6599f063d3385b9dbe54c3
7
- data.tar.gz: be077693f5d1c95b30f748f1915376862b540c419558dc6376d39c99c5991e1380f172c79e37a396f9e1450af6f22e48cec1c843b2c3afce3488731ba69401fe
6
+ metadata.gz: bea32b53aafa6fb4d1a4d1dc4df26012899b2ae0015f533964a910e65b1443ae79b87a300ef91fcb24c731d11746f1a579fa31b2dce783f0caf64b0c33f0afe5
7
+ data.tar.gz: e9af430b5be60f4441402b28bd8932ff178fe327889c2f8c7fca778616fc8298a86c185fbc7d03476f3b5d84e74f30dbd455f0fe2c8d649f91d79ceb1d25e2ce
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [0.4.2] - 2026-09-12
2
+
3
+ ### Added
4
+
5
+ * Document passing `Header` parameters as an Array of key-value pairs when a key repeats
6
+
7
+ ### Fixed
8
+
9
+ * Accept an Array of key-value pairs as `Header` parameters in the RBS signatures, which already worked at runtime
10
+
1
11
  ## [0.4.1] - 2026-04-20
2
12
 
3
13
  ### Fixed
data/README.md CHANGED
@@ -40,6 +40,17 @@ header.to_s
40
40
  # => "OAuth oauth_consumer_key=\"consumer_key\", oauth_nonce=\"...\", ..."
41
41
  ```
42
42
 
43
+ ### Repeated Parameters
44
+
45
+ Pass parameters as an Array of key-value pairs when a key repeats:
46
+
47
+ ```ruby
48
+ header = SimpleOAuth::Header.new(:post, url, [["ids", "1"], ["ids", "2"]],
49
+ consumer_key: "key",
50
+ consumer_secret: "secret"
51
+ )
52
+ ```
53
+
43
54
  ### Signature Methods
44
55
 
45
56
  Built-in signature methods: `HMAC-SHA1` (default), `HMAC-SHA256`, `RSA-SHA1`, `RSA-SHA256`, and `PLAINTEXT`.
@@ -41,7 +41,7 @@ module SimpleOAuth
41
41
 
42
42
  # The request parameters to be signed
43
43
  #
44
- # @return [Hash] the request parameters
44
+ # @return [Hash, Array<Array(String, Object)>] the request parameters
45
45
  # @example
46
46
  # header.params # => {"status" => "Hello"}
47
47
  attr_reader :params
@@ -68,7 +68,8 @@ module SimpleOAuth
68
68
  # @api public
69
69
  # @param method [String, Symbol] the HTTP method
70
70
  # @param url [String, URI] the request URL
71
- # @param params [Hash] the request parameters (for form-encoded bodies)
71
+ # @param params [Hash, Array<Array(String, Object)>] the request parameters (for form-encoded bodies),
72
+ # as a Hash or as an Array of key-value pairs when a key repeats
72
73
  # @param oauth [Hash, String] OAuth options hash or an existing Authorization header to parse
73
74
  # @param body [String, nil] raw request body for oauth_body_hash (for non-form-encoded bodies)
74
75
  # @example Create a header with OAuth options
@@ -1,5 +1,5 @@
1
1
  # OAuth 1.0 header generation library
2
2
  module SimpleOauth
3
3
  # The current version of the SimpleOAuth gem
4
- VERSION = "0.4.1".freeze
4
+ VERSION = "0.4.2".freeze
5
5
  end
data/sig/simple_oauth.rbs CHANGED
@@ -60,6 +60,8 @@ module SimpleOAuth
60
60
  type ignored_key = :consumer_secret | :token_secret | :signature | :realm | :ignore_extra_keys
61
61
  type signature_method = "HMAC-SHA1" | "HMAC-SHA256" | "RSA-SHA1" | "RSA-SHA256" | "PLAINTEXT"
62
62
  type params_hash = Hash[String | Symbol, untyped]
63
+ type params_pairs = Array[[String | Symbol, untyped]]
64
+ type request_params = params_hash | params_pairs
63
65
  type oauth_options = Hash[Symbol, untyped]
64
66
  type signed_attributes_hash = Hash[Symbol, untyped]
65
67
 
@@ -67,7 +69,7 @@ module SimpleOAuth
67
69
  attr_reader method: String
68
70
 
69
71
  # The request parameters to be signed
70
- attr_reader params: params_hash
72
+ attr_reader params: request_params
71
73
 
72
74
  # The raw request body for oauth_body_hash computation
73
75
  attr_reader body: String?
@@ -94,7 +96,7 @@ module SimpleOAuth
94
96
  def self.decode: (String | _ToS value) -> String
95
97
 
96
98
  # Creates a new OAuth header
97
- def initialize: (String | Symbol method, String | URI::Generic url, params_hash params, ?oauth_options | String oauth, ?String? body) -> void
99
+ def initialize: (String | Symbol method, String | URI::Generic url, request_params params, ?oauth_options | String oauth, ?String? body) -> void
98
100
 
99
101
  # Returns the normalized URL without query string or fragment
100
102
  def url: () -> String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Richert
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 4.0.10
97
+ rubygems_version: 4.0.20
98
98
  specification_version: 4
99
99
  summary: Simply builds and verifies OAuth headers
100
100
  test_files: []