auth-centric-firewall 0.2.1 → 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc2f3aca527fbc2739d1b610cf088baf6ae46eeb45ea7a104466d40703e736ce
|
4
|
+
data.tar.gz: ed5f467da6383769b27944433c02c2c4584cefa7aa57f0f39083a828c6e1d842
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1490f3dd51f050efd3e22afb49975137945f517f94a2ea2025e8d1198aa4b79122fe7ca5d6c61f17094640a8a1f272469ff46668b25041cd1bdb34532f603ae
|
7
|
+
data.tar.gz: 95fdccb063d40d4415c11b054c00d0f64093d990519e0f5c52c9e43dfc3c20ff6f8e4873cb2581077d04757b4119083b62f34208951c788b088a26facd7ebdb7
|
data/CHANGELOG.md
CHANGED
@@ -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
|
@@ -4,10 +4,11 @@ module Auth
|
|
4
4
|
module Centric
|
5
5
|
module Captcha
|
6
6
|
module Retrieve
|
7
|
-
def retrieve_captcha
|
7
|
+
def retrieve_captcha(background_color: 'gray14')
|
8
8
|
return true unless enabled?
|
9
9
|
|
10
10
|
payload = {
|
11
|
+
background_color:,
|
11
12
|
security_captcha: {
|
12
13
|
ip: @ip_address,
|
13
14
|
session_id: @session_id
|
@@ -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
|
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.
|
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
|