kettle-dev 3.1.32 → 3.1.33

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: 303fb467106510d7b721c570c3e37269a81ddd18c70d5208857f5e0b6dcb9e8d
4
- data.tar.gz: 2e7f824acb72e33999dcb9a417b046d40231103f6bc0ff81a60a26b29a1a5bb6
3
+ metadata.gz: bd1df5ff35332b6e32cc015b2d501bf6faab0ad35f4aa0fbdd96e0dcc3a5bd39
4
+ data.tar.gz: f29c4bbd741c0067a3351e61196c15a33ffd91e081562010d0da3c9a70e0f9c9
5
5
  SHA512:
6
- metadata.gz: 862bf474d7cbabae096a053da2fd561a3b5bbca3457774cede01855c07a4fcc6f7248dbe2de1dfa8b37cb534eee9058d9b1c84e71ee86244e057d8ac7cc64baf
7
- data.tar.gz: 66ce63717d0cc434a95ce16bf547033cef186d66570344115e49ed2f0163a7edfd2f1d87a09c3717cab118e00317613c31c06f6418fc0eca3eeef1735443ba83
6
+ metadata.gz: e145148d99b4d8b962d33a143cc7261a9525651b52748d31b991e258451af9f88a6cf678e38c31f439359d1773e9b58d9b7f5154394bcaa87e0ca9bc8345eb52
7
+ data.tar.gz: e0421b686337c18156e947338a21ef079dd8cbe0b6c928c5c7607f82d03ab79191a25720142f88e8b5bbb115c25ade43cbd5a22261f27d19738794120c65e753
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,17 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [3.1.33] - 2026-11-27
34
+
35
+ - TAG: [v3.1.33][3.1.33t]
36
+ - COVERAGE: 92.25% -- 6038/6545 lines in 50 files
37
+ - BRANCH COVERAGE: 76.31% -- 2307/3023 branches in 50 files
38
+ - 55.92% documented
39
+
40
+ ### Fixed
41
+
42
+ - release interactive command: compute scrubbed prompt text before `scrub_secrets_from_chunk` mutates `@secret_scrub_carryover` (preventing held-back carryover bytes from being re-fed into a cleared prompt buffer) and require a prompt delimiter (`:`/`?`) in `otp_response_prompt?` so RubyGems' intro sentence (`Please enter OTP code.`) and `Code: ` prompt no longer trigger two consecutive OTP requests; also stop `call_with_open3` from waiting on an open TTY stdin after child stdout/stderr close
43
+
33
44
  ## [3.1.32] - 2026-11-26
34
45
 
35
46
  - TAG: [v3.1.32][3.1.32t]
@@ -4397,7 +4408,9 @@ Please file a bug if you notice a violation of semantic versioning.
4397
4408
  - Selecting will run the selected workflow via `act`
4398
4409
  - This may move to its own gem in the future.
4399
4410
 
4400
- [Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.32...HEAD
4411
+ [Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.33...HEAD
4412
+ [3.1.33]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.32...v3.1.33
4413
+ [3.1.33t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.33
4401
4414
  [3.1.32]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.31...v3.1.32
4402
4415
  [3.1.32t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.32
4403
4416
  [3.1.31]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.30...v3.1.31
data/README.md CHANGED
@@ -1034,7 +1034,7 @@ Thanks for RTFM. ☺️
1034
1034
  [📌gitmoji]: https://gitmoji.dev
1035
1035
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
1036
1036
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
1037
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-6.531-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
1037
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-6.545-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
1038
1038
  [🔐security]: https://github.com/kettle-dev/kettle-dev/blob/main/SECURITY.md
1039
1039
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
1040
1040
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -51,26 +51,22 @@ module Kettle
51
51
  if reader.equal?(@input)
52
52
  input.write(@input.readpartial(1024))
53
53
  else
54
- chunk = output.readpartial(1024)
54
+ raw_chunk = output.readpartial(1024)
55
55
  # Two views of the same bytes, with independent state.
56
56
  #
57
57
  # Emitted view: holds back a trailing window so a secret
58
58
  # split across chunks can never reach the log; the window
59
59
  # is released by flush_secret_scrub_carryover at stream end.
60
60
  #
61
- # Prompt view: scrubbed but never held back. A child that
62
- # prints its prompt and then blocks on stdin (Gem's OTP
63
- # `Code: ` ask) produces no further output; if the prompt
64
- # tail sat in the emitted view's holdback, detection would
65
- # never fire and the child would deadlock. The prompt view
66
- # therefore scrubs the raw chunk directly (plus the emitted
67
- # view's carryover, read-only, so bytes spanning the
68
- # boundary are still masked) instead of consuming it.
69
- chunk = scrub_secrets_from_chunk(chunk)
70
- prompt_text = scrub_secrets_for_prompt_detection(chunk)
61
+ # Prompt view: computed BEFORE scrub_secrets_from_chunk
62
+ # mutates @secret_scrub_carryover, so boundary secrets are
63
+ # masked without holding back the prompt tail or re-feeding
64
+ # old carryover bytes into a freshly cleared prompt buffer.
65
+ prompt_buffer = append_prompt_text(prompt_buffer, raw_chunk)
66
+ chunk = scrub_secrets_from_chunk(raw_chunk)
71
67
  stdout_str << chunk
72
68
  @output.print(chunk)
73
- prompt_buffer = handle_prompt(input, prompt_text, prompt_buffer: prompt_buffer)
69
+ prompt_buffer = handle_prompt(input, "", prompt_buffer: prompt_buffer)
74
70
  end
75
71
  end
76
72
  end
@@ -99,15 +95,16 @@ module Kettle
99
95
  Open3.popen3(env, *argv) do |input, output, error, wait_thread|
100
96
  readers = [output, error]
101
97
  readers << @input if @forward_stdin && @input.tty?
102
- until readers.empty?
98
+ while readers.include?(output) || readers.include?(error)
103
99
  ready = IO.select(readers)
104
100
  ready.first.each do |reader|
105
101
  if reader.equal?(@input)
106
102
  input.write(@input.readpartial(1024))
107
103
  else
108
104
  begin
109
- chunk = reader.readpartial(1024)
110
- chunk = scrub_secrets_from_chunk(chunk)
105
+ raw_chunk = reader.readpartial(1024)
106
+ prompt_buffer = append_prompt_text(prompt_buffer, raw_chunk)
107
+ chunk = scrub_secrets_from_chunk(raw_chunk)
111
108
  if reader.equal?(output)
112
109
  stdout_str << chunk
113
110
  @output.print(chunk)
@@ -115,7 +112,7 @@ module Kettle
115
112
  stderr_str << chunk
116
113
  @error.print(chunk)
117
114
  end
118
- prompt_buffer = handle_prompt(input, chunk, prompt_buffer: prompt_buffer)
115
+ prompt_buffer = handle_prompt(input, "", prompt_buffer: prompt_buffer)
119
116
  rescue EOFError
120
117
  readers.delete(reader)
121
118
  end
@@ -225,17 +222,33 @@ module Kettle
225
222
  chunk
226
223
  end
227
224
 
228
- # Prompt-detection view: scrubbed, but never holds back a trailing
229
- # window. Reads (never consumes) the emitted view's carryover so bytes
230
- # spanning a chunk boundary are still masked here. Without this view, a
231
- # prompt whose tail falls inside the holdback — a child that blocks on
232
- # stdin and produces no further output — would never be answered, and
233
- # the release would deadlock.
234
- def scrub_secrets_for_prompt_detection(chunk)
235
- return chunk if @written_secrets.empty?
225
+ # Prompt-detection view: appends only the newly scrubbed bytes from
226
+ # raw_chunk to prompt_buffer without holding back a trailing window and
227
+ # without re-emitting carryover bytes that were already processed (or
228
+ # cleared after answering a prompt). Must run before
229
+ # scrub_secrets_from_chunk updates @secret_scrub_carryover.
230
+ def append_prompt_text(prompt_buffer, raw_chunk)
231
+ prompt_buffer = prompt_buffer.to_s.dup
232
+ if @written_secrets.empty?
233
+ prompt_buffer << raw_chunk.to_s
234
+ else
235
+ before = @secret_scrub_carryover
236
+ scrubbed = (before + raw_chunk.to_s).gsub(Regexp.union(@written_secrets), "[SECRET REMOVED]")
237
+ prefix_len = common_prefix_bytesize(before, scrubbed)
238
+ overlap = before.bytesize - prefix_len
239
+ if overlap.positive? && prompt_buffer.end_with?(before)
240
+ prompt_buffer = prompt_buffer.byteslice(0, prompt_buffer.bytesize - overlap).to_s
241
+ end
242
+ prompt_buffer << scrubbed.byteslice(prefix_len, scrubbed.bytesize - prefix_len).to_s
243
+ end
244
+ prompt_buffer.byteslice([prompt_buffer.bytesize - 4096, 0].max, 4096).to_s
245
+ end
236
246
 
237
- buffer = @secret_scrub_carryover + chunk
238
- buffer.gsub(Regexp.union(@written_secrets), "[SECRET REMOVED]")
247
+ def common_prefix_bytesize(left, right)
248
+ limit = [left.bytesize, right.bytesize].min
249
+ index = 0
250
+ index += 1 while index < limit && left.getbyte(index) == right.getbyte(index)
251
+ index
239
252
  end
240
253
 
241
254
  def otp_prompt?(chunk)
@@ -243,7 +256,7 @@ module Kettle
243
256
  end
244
257
 
245
258
  def otp_response_prompt?(chunk)
246
- chunk.match?(/(?:OTP code|one-time password|\bCode:\s*)/i)
259
+ chunk.match?(/(?:OTP code|one-time password|\bCode)\s*[:?]\s*\z/i)
247
260
  end
248
261
 
249
262
  def signing_password_prompt?(chunk)
@@ -5,7 +5,7 @@ module Kettle
5
5
  # Version namespace for this gem.
6
6
  module Version
7
7
  # Current gem version.
8
- VERSION = "3.1.32"
8
+ VERSION = "3.1.33"
9
9
  end
10
10
  # Current gem version exposed at the traditional constant location.
11
11
  VERSION = Version::VERSION # Traditional Constant Location
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kettle-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.32
4
+ version: 3.1.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -476,10 +476,10 @@ licenses:
476
476
  - AGPL-3.0-only
477
477
  metadata:
478
478
  homepage_uri: "https://kettle-dev.galtzo.com"
479
- source_code_uri: "https://github.com/kettle-dev/kettle-dev/tree/v3.1.32"
480
- changelog_uri: "https://github.com/kettle-dev/kettle-dev/blob/v3.1.32/CHANGELOG.md"
479
+ source_code_uri: "https://github.com/kettle-dev/kettle-dev/tree/v3.1.33"
480
+ changelog_uri: "https://github.com/kettle-dev/kettle-dev/blob/v3.1.33/CHANGELOG.md"
481
481
  bug_tracker_uri: "https://github.com/kettle-dev/kettle-dev/issues"
482
- documentation_uri: "https://www.rubydoc.info/gems/kettle-dev/3.1.32"
482
+ documentation_uri: "https://www.rubydoc.info/gems/kettle-dev/3.1.33"
483
483
  funding_uri: "https://github.com/sponsors/pboling"
484
484
  wiki_uri: "https://github.com/kettle-dev/kettle-dev/wiki"
485
485
  news_uri: "https://www.railsbling.com/tags/kettle-dev"
metadata.gz.sig CHANGED
Binary file