private_captcha 0.0.6 → 0.0.7

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: 8cfbe57b68cd76d99caf830425f5c0b266807cd9f0b1290e7f973f10b3d6ff58
4
- data.tar.gz: 9dc9b9cb80b0ed3efeaa15992233688836a07d0a2e26f8640f1801f023db0958
3
+ metadata.gz: 4ea1e68f250aa0c997731cafe49505b1a063460aa4e633d42af1b3834e2da2f7
4
+ data.tar.gz: 6b95d1bad72ac1bb61215278df8d355a08ebaa54eb4955a9f3736fc67b671caf
5
5
  SHA512:
6
- metadata.gz: 9cfab92357a7f4a13d2b6f9aa63a2f523f29de75bcd0c2d79b252e49f65ca02cda3881ecadb7a2d5785eb9f85fa7e48df1561c4dad217718e532834ced62d8fc
7
- data.tar.gz: 3cac0cac74a8e081a3a67e405481306d2ddfe01a8d9790de575fb45ee1ab40fa3bb08d4bcb86f2110bccc5b248c054434323cc371f0d814016352452113047f4
6
+ metadata.gz: 4e63dd18a8bffa1da77c9bedbab1fd7f74f78c60c2067fbd433492388bf00327712ee38389a776530cf1fb4d452d3d77211e36eb6c9eabab40f2493bc068ea08
7
+ data.tar.gz: daaed38d698c3dd4cce081a9ad6615572d8dc6405a328d8047cfc870f5e0ad64777229cab66e5805cffd4c35881d524dccdc9e038d9db4bedf0a4d845ed06334
@@ -75,11 +75,11 @@ module PrivateCaptcha
75
75
  end
76
76
  # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
77
77
 
78
- def verify_request(request, form_field: nil)
78
+ def verify_request(request, form_field: nil, sitekey: nil)
79
79
  field = form_field || @config.form_field
80
80
  solution = extract_form_value(request, field)
81
81
 
82
- output = verify(solution)
82
+ output = verify(solution, sitekey: sitekey)
83
83
 
84
84
  unless output.ok?
85
85
  raise Error.new("captcha verification failed: #{output.error_message}",
@@ -16,7 +16,8 @@ module PrivateCaptcha
16
16
  TEST_PROPERTY_ERROR = 10
17
17
  INTEGRITY_ERROR = 11
18
18
  ORG_SCOPE_ERROR = 12
19
- VERIFY_CODES_COUNT = 13
19
+ SOLUTION_TIMING_ERROR = 13
20
+ VERIFY_CODES_COUNT = 14
20
21
 
21
22
  ERROR_MESSAGES = {
22
23
  VERIFY_NO_ERROR => '',
@@ -31,17 +32,19 @@ module PrivateCaptcha
31
32
  MAINTENANCE_MODE_ERROR => 'maintenance-mode',
32
33
  TEST_PROPERTY_ERROR => 'property-test',
33
34
  INTEGRITY_ERROR => 'integrity-error',
34
- ORG_SCOPE_ERROR => 'org-scope-error'
35
+ ORG_SCOPE_ERROR => 'org-scope-error',
36
+ SOLUTION_TIMING_ERROR => 'solution-timing'
35
37
  }.freeze
36
38
 
37
39
  attr_accessor :success, :code, :origin, :timestamp
38
40
  attr_reader :trace_id, :attempt
39
41
 
40
- def initialize(success: false, code: VERIFY_NO_ERROR, origin: nil, timestamp: nil, trace_id: nil, attempt: 0)
42
+ def initialize(success: false, code: VERIFY_NO_ERROR, origin: nil, timestamp: nil, edge_token: nil, trace_id: nil, attempt: 0)
41
43
  @success = success
42
44
  @code = code
43
45
  @origin = origin
44
46
  @timestamp = timestamp
47
+ @edge_token = edge_token
45
48
  @trace_id = trace_id
46
49
  @attempt = attempt
47
50
  end
@@ -60,6 +63,7 @@ module PrivateCaptcha
60
63
  code: json_data['code'] || VERIFY_NO_ERROR,
61
64
  origin: json_data['origin'],
62
65
  timestamp: json_data['timestamp'],
66
+ edge_token: json_data['edge_token'],
63
67
  trace_id: trace_id,
64
68
  attempt: attempt
65
69
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PrivateCaptcha
4
- VERSION = '0.0.6'
4
+ VERSION = '0.0.7'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: private_captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taras Kushnir
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-23 00:00:00.000000000 Z
11
+ date: 2026-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack