verify_it 0.4.0.beta → 0.4.1.beta

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: ccaee3a9738dcd530a9afc7015401a5e13151f19b6e26e76dbf02d88b38294bd
4
- data.tar.gz: 423c5f4b1354fd994be521a72303c6f61435263b5f71477177b0bbd68c9a89a4
3
+ metadata.gz: 4f2e332e6a7ecae4c16eaf2232cb6f5826c26cd1a5c3de98c98a7cf0f1bf9968
4
+ data.tar.gz: 14e43962ebc0e2b2ca553324aadb0780aa1c2e6b22f4d4a1c6c9ab7fad285442
5
5
  SHA512:
6
- metadata.gz: 14e0947db04ce6fab19be9a0b1a475d99d6e16a6967ec079488fa162fecf45c37abdf37b7ad4e763d96a8110b1447dbca1a13923d3e0a5377d7f7e2bad5fe147
7
- data.tar.gz: 3e5a97c488b04b36487c1ee8bb6591c2eb2c2987dd79dc62dbfe5b610ee1dac7813a5fd63927db745354f8ee54abd224fd67f587acbb273283731794c2f42904
6
+ metadata.gz: cc77c48de4632d3c129dcd3b3f614e909107d906dd3bdbf66d3d0771eb3609a3978916c318ccdaef873544b50f64f1a6be411f5554a8a882b1ec681eda4c0e8e
7
+ data.tar.gz: ecff61e7e94a7aaf27bf91f7ea0e13635c64dcde5413054077d366a8f36e2dd546bb049c18939374885675a8f5fdb9fe714ba82d4cd3caca3f875fe3245a9362
data/.DS_Store CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ### Added
4
+ - `on_verify_success` callback now receives `request:` as an optional keyword argument,
5
+ enabling apps to access HTTP context (e.g. set session) at verification time.
6
+ Thread: `VerifyIt.verify_code(request:)` → `Verifier#verify_code` → `handle_verification_success`.
7
+ Existing proc-based callbacks are unaffected (procs ignore unknown keyword args);
8
+ lambda-based callbacks should add `request: nil` to their signature.
9
+
10
+ ### Changed
11
+ - Dropped Ruby 3.1 support; minimum required Ruby is now 3.2 (due to `connection_pool >= 3.0` transitive dependency)
12
+
3
13
  ## [0.4.0] - 2026-03-07
4
14
 
5
15
  ### Added
@@ -34,7 +34,7 @@ module VerifyIt
34
34
 
35
35
  channel = resolve_channel
36
36
  identifier = resolve_identifier(record, channel)
37
- result = VerifyIt.verify_code(to: identifier, code: params[:code].to_s, record: record)
37
+ result = VerifyIt.verify_code(to: identifier, code: params[:code].to_s, record: record, request: request)
38
38
 
39
39
  if result.success?
40
40
  render json: { message: I18n.t("verify_it.responses.verified") }, status: :ok
@@ -30,7 +30,7 @@ module VerifyIt
30
30
  finalize_send(to: to, record: record, channel: channel, code_data: code_data)
31
31
  end
32
32
 
33
- def verify_code(to:, code:, record:)
33
+ def verify_code(to:, code:, record:, request: nil)
34
34
  rate_limit_result = check_verification_rate_limit(to: to, record: record)
35
35
  return rate_limit_result if rate_limit_result
36
36
 
@@ -40,7 +40,7 @@ module VerifyIt
40
40
  current_attempts = rate_limiter.record_verification_attempt(identifier: to, record: record)
41
41
 
42
42
  if code_matches?(code, stored_code)
43
- handle_verification_success(to: to, record: record, attempts: current_attempts)
43
+ handle_verification_success(to: to, record: record, attempts: current_attempts, request: request)
44
44
  else
45
45
  handle_verification_failure(to: to, record: record, attempts: current_attempts)
46
46
  end
@@ -120,12 +120,12 @@ module VerifyIt
120
120
  )
121
121
  end
122
122
 
123
- def handle_verification_success(to:, record:, attempts:)
123
+ def handle_verification_success(to:, record:, attempts:, request: nil)
124
124
  storage.delete_code(identifier: to, record: record)
125
125
  storage.reset_attempts(identifier: to, record: record)
126
126
  storage.reset_send_count(identifier: to, record: record)
127
127
 
128
- invoke_callback(config.on_verify_success, record: record, identifier: to)
128
+ invoke_callback(config.on_verify_success, record: record, identifier: to, request: request)
129
129
 
130
130
  success_result("Verification successful", verified: true, attempts: attempts)
131
131
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VerifyIt
4
- VERSION = "0.4.0.beta"
4
+ VERSION = "0.4.1.beta"
5
5
  end
data/lib/verify_it.rb CHANGED
@@ -37,8 +37,8 @@ module VerifyIt
37
37
  verifier.send_code(to: to, record: record, channel: channel, context: context)
38
38
  end
39
39
 
40
- def verify_code(to:, code:, record:)
41
- verifier.verify_code(to: to, code: code, record: record)
40
+ def verify_code(to:, code:, record:, request: nil)
41
+ verifier.verify_code(to: to, code: code, record: record, request: request)
42
42
  end
43
43
 
44
44
  def cleanup(to:, record:)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verify_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.beta
4
+ version: 0.4.1.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremias Ramirez
@@ -193,12 +193,7 @@ files:
193
193
  - lib/verify_it/verifiable.rb
194
194
  - lib/verify_it/verifier.rb
195
195
  - lib/verify_it/version.rb
196
- - pkg/verify_it-0.1.0.gem
197
196
  - sig/verify_it.rbs
198
- - verify_it-0.1.0.gem
199
- - verify_it-0.1.1.gem
200
- - verify_it-0.2.0.gem
201
- - verify_it-0.3.0.gem
202
197
  homepage: https://github.com/JeremasPosta/verify_it
203
198
  licenses:
204
199
  - MIT
@@ -215,7 +210,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
210
  requirements:
216
211
  - - ">="
217
212
  - !ruby/object:Gem::Version
218
- version: '3.0'
213
+ version: '3.2'
219
214
  required_rubygems_version: !ruby/object:Gem::Requirement
220
215
  requirements:
221
216
  - - ">="
Binary file
data/verify_it-0.1.0.gem DELETED
Binary file
data/verify_it-0.1.1.gem DELETED
Binary file
data/verify_it-0.2.0.gem DELETED
Binary file
data/verify_it-0.3.0.gem DELETED
Binary file