disarm 0.12.0-x86_64-linux → 0.13.0-x86_64-linux

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: f9f317c76f9e7612de73e24d1e3e72ba1fc44073adce205d25da3adcc77c2c73
4
- data.tar.gz: bf385f386de445f5cf59df2bc6859509bfe74bd904d04795c7178ed1366388fb
3
+ metadata.gz: d81c4bbe604fd099bba7266d2921248be9972a688da6a5b15b355f582a69f058
4
+ data.tar.gz: 0ec9829b26b563078dfac28f4b13989055d85ba80fcf985b917627c983ed1ed5
5
5
  SHA512:
6
- metadata.gz: de5a1b6640d856e54b7495127a680ed7deaf839850ab41b97df0057eb6644d678a5c476a21b93dd6bf28b7eaab7cb0d392c53885bacff19dceb07fe3bd29bfa8
7
- data.tar.gz: ee656c9075eff178c391e76d1766aec7ae40af24fdf66474c7962180ce890997d74411207a6dcff8204bc4d772aac129ea510e29bdc39840f19f3ed04f1d56e6
6
+ metadata.gz: 466a9a07bf889ecd2d17acdb319bd306f52bbad97bc1ba09dd99243c6c9450bac2a54c651022a2c0c0ca0da388933d5442cf8fbd25328f0e9a457642d80e5f39
7
+ data.tar.gz: 87ec554bed96f2dcc23d8642a20e41a7e88d8f772a3410a3751c1056ed3978bfd25c07025070ca3e49803ca4cc55a567195dde8a0f7efb176b172e5cf3ee646a
Binary file
Binary file
Binary file
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Disarm
4
4
  # Kept in lockstep with the Rust crate / Python package version.
5
- VERSION = "0.12.0"
5
+ VERSION = "0.13.0"
6
6
  end
data/lib/disarm.rb CHANGED
@@ -159,6 +159,33 @@ module Disarm
159
159
  translate_errors { _suspicious_hostname?(host) }
160
160
  end
161
161
 
162
+ # The full hostname homoglyph analysis (#549) behind #suspicious_hostname?,
163
+ # as a Hash. `:suspicious` is a maximally conservative screen (an any-character
164
+ # confusable test flags essentially every non-Latin host), not a precise verdict;
165
+ # branch on the granular signals plus your own policy. Keys: :suspicious,
166
+ # :scripts, :mixed_script, :has_confusables, :bidi_conflict, :cross_label_script,
167
+ # :label_scripts, :whole_script_confusable, :label_whole_script_confusable,
168
+ # :canonical. `:whole_script_confusable` is a graded signal, NOT folded into
169
+ # `:suspicious` (see #545).
170
+ def analyze_hostname(host)
171
+ suspicious, scripts, mixed_script, has_confusables, bidi_conflict,
172
+ cross_label_script, label_scripts, whole_script_confusable,
173
+ label_whole_script_confusable, canonical =
174
+ translate_errors { _analyze_hostname(host) }
175
+ {
176
+ suspicious:,
177
+ scripts:,
178
+ mixed_script:,
179
+ has_confusables:,
180
+ bidi_conflict:,
181
+ cross_label_script:,
182
+ label_scripts:,
183
+ whole_script_confusable:,
184
+ label_whole_script_confusable:,
185
+ canonical:,
186
+ }
187
+ end
188
+
162
189
  # Apply a Unicode normalization form. `form:` is :nfc (default), :nfd,
163
190
  # :nfkc, or :nfkd (a Symbol or String; case-insensitive).
164
191
  def normalize(text, form: :nfc)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disarm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Richard Quinn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-15 00:00:00.000000000 Z
11
+ date: 2026-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake