auth-centric-firewall 0.2.2 → 0.2.3

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: 3ed5d8123b837430dfb0ffe3bd9e5e71e12ccf989830a27146bc68a599ac457a
4
- data.tar.gz: 27c67ca3e5a06155274d249502b256dd454dbba589bc1a9cb0285e544e57a5d4
3
+ metadata.gz: dc2f3aca527fbc2739d1b610cf088baf6ae46eeb45ea7a104466d40703e736ce
4
+ data.tar.gz: ed5f467da6383769b27944433c02c2c4584cefa7aa57f0f39083a828c6e1d842
5
5
  SHA512:
6
- metadata.gz: 938ac41e242aa305cdbbc7d4aa5f8b9402e9f5a1492e3f55f7491ab6cd04e37225b3a376375ee775046ee57719dabc80d4b2d6439a793ef1119c0fc793d32f13
7
- data.tar.gz: 14586f49bd491afe2c1acaf34290904656e404ab0288ba3e3b667cdc0630c5d38e444edaa0cee08acfdaf2b80d8c831afe701725e7cd076f7fa168ce779ee347
6
+ metadata.gz: d1490f3dd51f050efd3e22afb49975137945f517f94a2ea2025e8d1198aa4b79122fe7ca5d6c61f17094640a8a1f272469ff46668b25041cd1bdb34532f603ae
7
+ data.tar.gz: 95fdccb063d40d4415c11b054c00d0f64093d990519e0f5c52c9e43dfc3c20ff6f8e4873cb2581077d04757b4119083b62f34208951c788b088a26facd7ebdb7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Released]
2
2
 
3
+ ## [0.2.3] - 2025-09-14
4
+
5
+ - Delete Captcha
6
+
3
7
  ## [0.2.2] - 2025-09-13
4
8
 
5
9
  - Ability to change background color of captcha
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth
4
+ module Centric
5
+ module Captcha
6
+ module Delete
7
+ def delete_captcha(id)
8
+ return true unless enabled?
9
+
10
+ http = HTTP
11
+ .timeout(timeout_seconds)
12
+ .headers(apikey:)
13
+ .delete(delete_path(id))
14
+
15
+ case http.status
16
+ when 204
17
+ true
18
+ else
19
+ raise Error, "#{http.status}: #{http.body}"
20
+ end
21
+ rescue HTTP::TimeoutError
22
+ false
23
+ end
24
+
25
+ def delete_path(id)
26
+ [host, "api/v1/security_captchas/#{id}"].join('/')
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -3,7 +3,7 @@
3
3
  module Auth
4
4
  module Centric
5
5
  module Firewall
6
- VERSION = '0.2.2'
6
+ VERSION = '0.2.3'
7
7
  end
8
8
  end
9
9
  end
@@ -75,10 +75,12 @@ module Auth
75
75
  class SecurityCaptcha
76
76
  require_relative 'captcha/retrieve'
77
77
  require_relative 'captcha/check_code'
78
+ require_relative 'captcha/delete'
78
79
 
79
80
  include Common::Settings
80
81
  include Captcha::Retrieve
81
82
  include Captcha::CheckCode
83
+ include Captcha::Delete
82
84
 
83
85
  def initialize(ip_address:, session_id:)
84
86
  @ip_address = ip_address
@@ -0,0 +1,11 @@
1
+ module Auth
2
+ module Centric
3
+ module Captcha
4
+ module Delete
5
+ def delete_captcha: -> bool
6
+
7
+ def delete_path: -> string
8
+ end
9
+ end
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth-centric-firewall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saimon Lovell
@@ -52,6 +52,7 @@ files:
52
52
  - README.md
53
53
  - Rakefile
54
54
  - lib/auth/centric/captcha/check_code.rb
55
+ - lib/auth/centric/captcha/delete.rb
55
56
  - lib/auth/centric/captcha/retrieve.rb
56
57
  - lib/auth/centric/common/settings.rb
57
58
  - lib/auth/centric/firewall.rb
@@ -61,6 +62,7 @@ files:
61
62
  - lib/auth/centric/firewall/version.rb
62
63
  - public/403.html
63
64
  - sig/auth/centric/captcha/check_code.rbs
65
+ - sig/auth/centric/captcha/delete.rbs
64
66
  - sig/auth/centric/captcha/retrieve.rbs
65
67
  - sig/auth/centric/common/settings.rbs
66
68
  - sig/auth/centric/firewall.rbs