linzer 0.8.0.beta2 → 0.8.0

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: 7a917fda2b4d4646e642ba3a52d11bd41a500b5bfed044142a6e0434e0ef1c94
4
- data.tar.gz: 8d9296ba21595cba696532a41b20f123569d3b31de0730ba6e7e6f693e87e009
3
+ metadata.gz: 47932906cedb5dd66d7d2bbc5e8eaac9f01b4e17dd7089bc87b4a06b9505b366
4
+ data.tar.gz: abe9bf21ac6d66a08f229de3fb10e77bc911c112f812cd0cf620d9f3947d580e
5
5
  SHA512:
6
- metadata.gz: 2f6b61e4a340594891976d77b651527b8e0d49ff9ab11d73c56f01b5baecc1ad3fdf8ad23d987652496929ef30495cb116ba04a53f1b7ef2d881e8c1c1cfa1c9
7
- data.tar.gz: fb4800f527d14823e9ed76b776056fe20a60f35fc3e08c30ce15c05758648476f8489c2d8bb89851fe2c77eeff56891b96ec955663bf08b7b6326cdf4425c881
6
+ metadata.gz: b4352492dedad2bd9881b9bc6ac5888cdf7855a798f2b650040a9a64c4f7ea81c34178a4bfadb77f5953d82498f1eea69c90529d8b3888d9d182d3896e8415ed
7
+ data.tar.gz: b2540b62b29a07666c66969f5d6843f674994747fe80e47e71c0ba7f03ad554ccfbd1fcfefca796b7115f6fa2643f2b57b4d058de755c499a87ac87f883a4282
data/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.8.0] - 2026-08-08
4
+
5
+ (Only one change since the last beta: the Faraday bug fix below. Everything
6
+ else shipped in earlier 0.8.0 betas.)
7
+
8
+ - Optimize signature parsing, serialization, and validation performance
9
+ across signing and verifying flows, improving `sign!` throughput by
10
+ 473% and `verify!` by 136% by minimizing Starry usage in hot paths
11
+ where possible.
12
+
13
+ - Add comprehensive benchmarking and profiling infrastructure across all
14
+ supported algorithms.
15
+
16
+ - Make Rack an optional dependency.
17
+
18
+ - Add Web Bot Auth support, implementing the current IETF draft
19
+ (draft-meunier-web-bot-auth-architecture-05).
20
+ Includes recommended signature parameter defaults, nonce generation,
21
+ and optional Signature-Agent header handling.
22
+
23
+ - Fix Faraday adapter deriving URI components from a re-encoded query
24
+ string, which could differ from the URI faraday actually sent and fail
25
+ verification at the origin. Affected `@target-uri`, `@request-target`
26
+ and `@query`. The query is now encoded with the request's own
27
+ `params_encoder`, so it tracks the URL faraday puts on the wire:
28
+
29
+ - Spaces no longer always encode as `+`. Faraday honours the
30
+ process-wide `Faraday::Utils.default_space_encoding`, which other
31
+ gems may set (the `oauth2` gem sets it to `"%20"` on load), so a
32
+ query value containing a space signed a URI the verifier could not
33
+ reproduce.
34
+
35
+ - A request with no query parameters no longer appends a stray `?`.
36
+
37
+ - A `params_encoder` configured on the connection or request is now
38
+ preserved, instead of being replaced with the default encoder.
39
+
3
40
  ## [0.8.0.beta2] - 2026-05-20
4
41
 
5
42
  - Add Web Bot Auth support, implementing the current IETF draft
@@ -14,13 +14,20 @@ module Linzer
14
14
  # {Linzer::Message::Adapter::Faraday::Request}, preserving the
15
15
  # original HTTP method, URL, and headers from the environment.
16
16
  #
17
+ # Preserves the environment's request options when present, so that
18
+ # a +params_encoder+ configured on the connection or request is
19
+ # carried over. The adapter re-encodes query parameters when
20
+ # deriving +@target-uri+ and friends, and must use the same encoder
21
+ # Faraday used to write the URL, or the signed value will not match
22
+ # the URI actually sent.
23
+ #
17
24
  # @param env [::Faraday::Env] the middleware environment
18
25
  # @return [::Faraday::Request] a new request object
19
26
  def self.create_request(env)
20
27
  ::Faraday::Request.create(env.method) do |req|
21
28
  req.params = ::Faraday::Utils::ParamsHash.new
22
29
  req.headers = ::Faraday::Utils::Headers.new(env.request_headers.dup)
23
- req.options = ::Faraday::ConnectionOptions.from(nil).request
30
+ req.options = env.request || ::Faraday::ConnectionOptions.from(nil).request
24
31
  req.url env.url
25
32
  end
26
33
  end
@@ -37,10 +37,24 @@ module Linzer
37
37
 
38
38
  # Builds the full URI including query parameters.
39
39
  #
40
+ # Encodes the query with the request's own +params_encoder+,
41
+ # mirroring how faraday builds the URL it puts on the wire
42
+ # (+Faraday::Connection#build_env+). Encoding it independently
43
+ # here would diverge from the URI actually sent: notably
44
+ # +URI.encode_www_form+ always encodes a space as +++, while
45
+ # faraday honours the process-wide
46
+ # +Faraday::Utils.default_space_encoding+, which other gems may
47
+ # set to +%20+. The signer would then cover a +@target-uri+ the
48
+ # verifier cannot reproduce from the request it received.
49
+ #
50
+ # An empty query is left as +nil+ rather than +""+, as assigning
51
+ # +""+ would append a stray +?+ that faraday does not send.
52
+ #
40
53
  # @return [URI] the complete request URI with encoded query string
41
54
  def uri
42
55
  uri = @operation.path.dup
43
- uri.query = URI.encode_www_form(@operation.params)
56
+ query = @operation.params.to_query(@operation.options.params_encoder)
57
+ uri.query = query unless query.empty?
44
58
  uri
45
59
  end
46
60
 
@@ -3,5 +3,5 @@
3
3
  module Linzer
4
4
  # Current version of the Linzer gem.
5
5
  # @return [String]
6
- VERSION = "0.8.0.beta2"
6
+ VERSION = "0.8.0"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.beta2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Landaeta