castle-rb 6.0.1 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -8
  3. data/lib/castle.rb +7 -11
  4. data/lib/castle/api.rb +7 -12
  5. data/lib/castle/api/approve_device.rb +1 -6
  6. data/lib/castle/api/authenticate.rb +10 -7
  7. data/lib/castle/api/end_impersonation.rb +3 -8
  8. data/lib/castle/api/filter.rb +37 -0
  9. data/lib/castle/api/get_device.rb +1 -6
  10. data/lib/castle/api/get_devices_for_user.rb +1 -6
  11. data/lib/castle/api/log.rb +37 -0
  12. data/lib/castle/api/report_device.rb +1 -6
  13. data/lib/castle/api/risk.rb +37 -0
  14. data/lib/castle/api/start_impersonation.rb +3 -8
  15. data/lib/castle/api/track.rb +1 -6
  16. data/lib/castle/client.rb +36 -16
  17. data/lib/castle/commands/approve_device.rb +1 -5
  18. data/lib/castle/commands/end_impersonation.rb +1 -1
  19. data/lib/castle/commands/filter.rb +23 -0
  20. data/lib/castle/commands/get_device.rb +1 -5
  21. data/lib/castle/commands/get_devices_for_user.rb +1 -5
  22. data/lib/castle/commands/{identify.rb → log.rb} +4 -3
  23. data/lib/castle/commands/report_device.rb +1 -5
  24. data/lib/castle/commands/risk.rb +23 -0
  25. data/lib/castle/commands/start_impersonation.rb +1 -1
  26. data/lib/castle/configuration.rb +18 -8
  27. data/lib/castle/core/get_connection.rb +3 -1
  28. data/lib/castle/core/process_response.rb +5 -2
  29. data/lib/castle/core/process_webhook.rb +10 -5
  30. data/lib/castle/core/send_request.rb +8 -16
  31. data/lib/castle/errors.rb +37 -13
  32. data/lib/castle/failover/prepare_response.rb +2 -7
  33. data/lib/castle/failover/strategy.rb +3 -0
  34. data/lib/castle/headers/extract.rb +4 -4
  35. data/lib/castle/headers/filter.rb +9 -6
  36. data/lib/castle/ips/extract.rb +4 -2
  37. data/lib/castle/logger.rb +3 -3
  38. data/lib/castle/payload/prepare.rb +3 -4
  39. data/lib/castle/secure_mode.rb +3 -2
  40. data/lib/castle/support/hanami.rb +2 -6
  41. data/lib/castle/support/rails.rb +1 -3
  42. data/lib/castle/utils/clean_invalid_chars.rb +1 -3
  43. data/lib/castle/verdict.rb +2 -0
  44. data/lib/castle/version.rb +1 -1
  45. data/lib/castle/webhooks/verify.rb +9 -7
  46. data/spec/integration/rails/rails_spec.rb +9 -7
  47. data/spec/integration/rails/support/home_controller.rb +26 -24
  48. data/spec/lib/castle/api/approve_device_spec.rb +3 -3
  49. data/spec/lib/castle/api/authenticate_spec.rb +20 -24
  50. data/spec/lib/castle/api/end_impersonation_spec.rb +11 -5
  51. data/spec/lib/castle/api/filter_spec.rb +5 -0
  52. data/spec/lib/castle/api/get_device_spec.rb +3 -3
  53. data/spec/lib/castle/api/get_devices_for_user_spec.rb +3 -3
  54. data/spec/lib/castle/api/log_spec.rb +5 -0
  55. data/spec/lib/castle/api/report_device_spec.rb +3 -3
  56. data/spec/lib/castle/api/risk_spec.rb +5 -0
  57. data/spec/lib/castle/api/start_impersonation_spec.rb +11 -5
  58. data/spec/lib/castle/api/track_spec.rb +11 -7
  59. data/spec/lib/castle/api_spec.rb +4 -20
  60. data/spec/lib/castle/client_id/extract_spec.rb +4 -13
  61. data/spec/lib/castle/client_spec.rb +81 -84
  62. data/spec/lib/castle/commands/authenticate_spec.rb +8 -15
  63. data/spec/lib/castle/commands/end_impersonation_spec.rb +6 -9
  64. data/spec/lib/castle/commands/{identify_spec.rb → filter_spec.rb} +41 -19
  65. data/spec/lib/castle/commands/log_spec.rb +100 -0
  66. data/spec/lib/castle/commands/risk_spec.rb +100 -0
  67. data/spec/lib/castle/commands/start_impersonation_spec.rb +6 -9
  68. data/spec/lib/castle/commands/track_spec.rb +9 -18
  69. data/spec/lib/castle/configuration_spec.rb +2 -6
  70. data/spec/lib/castle/context/get_default_spec.rb +8 -8
  71. data/spec/lib/castle/context/prepare_spec.rb +6 -7
  72. data/spec/lib/castle/core/get_connection_spec.rb +6 -22
  73. data/spec/lib/castle/core/process_response_spec.rb +1 -8
  74. data/spec/lib/castle/core/send_request_spec.rb +4 -29
  75. data/spec/lib/castle/headers/extract_spec.rb +1 -3
  76. data/spec/lib/castle/headers/filter_spec.rb +12 -11
  77. data/spec/lib/castle/ips/extract_spec.rb +4 -13
  78. data/spec/lib/castle/logger_spec.rb +2 -6
  79. data/spec/lib/castle/payload/prepare_spec.rb +5 -4
  80. data/spec/lib/castle/session_spec.rb +13 -36
  81. data/spec/lib/castle/singleton_configuration_spec.rb +2 -6
  82. data/spec/lib/castle/utils/clean_invalid_chars_spec.rb +2 -2
  83. data/spec/lib/castle/utils/merge_spec.rb +3 -1
  84. data/spec/lib/castle/validators/present_spec.rb +5 -6
  85. data/spec/lib/castle/webhooks/verify_spec.rb +8 -24
  86. data/spec/lib/castle_spec.rb +4 -10
  87. data/spec/spec_helper.rb +1 -3
  88. data/spec/support/shared_examples/action_request.rb +152 -0
  89. data/spec/support/shared_examples/configuration.rb +14 -42
  90. metadata +23 -18
  91. data/lib/castle/api/identify.rb +0 -26
  92. data/lib/castle/api/review.rb +0 -24
  93. data/lib/castle/commands/review.rb +0 -17
  94. data/lib/castle/events.rb +0 -49
  95. data/spec/lib/castle/api/identify_spec.rb +0 -68
  96. data/spec/lib/castle/api/review_spec.rb +0 -19
  97. data/spec/lib/castle/commands/review_spec.rb +0 -24
  98. data/spec/lib/castle/events_spec.rb +0 -5
@@ -5,7 +5,9 @@ describe Castle::Utils::Merge do
5
5
 
6
6
  describe 'call' do
7
7
  let(:first) { { test: { test1: { c: '4' }, test2: { c: '3' }, a: '1', b: '2' } } }
8
- let(:second) { { test2: '2', test: { 'test1' => { d: '5' }, test2: '6', a: nil, b: '3' } } }
8
+ let(:second) do
9
+ { test2: '2', test: { 'test1' => { d: '5' }, :test2 => '6', :a => nil, :b => '3' } }
10
+ end
9
11
  let(:result) { { test2: '2', test: { test1: { c: '4', d: '5' }, test2: '6', b: '3' } } }
10
12
 
11
13
  it { expect(merge.call(first, second)).to be_eql(result) }
@@ -8,9 +8,7 @@ describe Castle::Validators::Present do
8
8
  let(:keys) { %i[second third] }
9
9
 
10
10
  it do
11
- expect do
12
- call
13
- end.to raise_error(Castle::InvalidParametersError, 'third is missing or empty')
11
+ expect { call }.to raise_error(Castle::InvalidParametersError, 'third is missing or empty')
14
12
  end
15
13
  end
16
14
 
@@ -18,9 +16,10 @@ describe Castle::Validators::Present do
18
16
  let(:keys) { %i[second invalid] }
19
17
 
20
18
  it do
21
- expect do
22
- call
23
- end.to raise_error(Castle::InvalidParametersError, 'invalid is missing or empty')
19
+ expect { call }.to raise_error(
20
+ Castle::InvalidParametersError,
21
+ 'invalid is missing or empty'
22
+ )
24
23
  end
25
24
  end
26
25
 
@@ -4,12 +4,7 @@ describe Castle::Webhooks::Verify do
4
4
  describe '#call' do
5
5
  subject(:call) { described_class.call(webhook) }
6
6
 
7
- let(:env) do
8
- Rack::MockRequest.env_for(
9
- '/',
10
- 'HTTP_X_CASTLE_SIGNATURE' => signature
11
- )
12
- end
7
+ let(:env) { Rack::MockRequest.env_for('/', 'HTTP_X_CASTLE_SIGNATURE' => signature) }
13
8
 
14
9
  let(:webhook) { Rack::Request.new(env) }
15
10
  let(:user_id) { '12345' }
@@ -37,32 +32,21 @@ describe Castle::Webhooks::Verify do
37
32
  context 'when success' do
38
33
  let(:signature) { '3ptx3rUOBnGEqPjMrbcJn2UUfzwTKP54dFyP5uyPY+Y=' }
39
34
 
40
- before do
41
- allow(Castle::Core::ProcessWebhook)
42
- .to receive(:call)
43
- .and_return(webhook_body)
44
- end
35
+ before { allow(Castle::Core::ProcessWebhook).to receive(:call).and_return(webhook_body) }
45
36
 
46
- it do
47
- expect { call }.not_to raise_error
48
- end
37
+ it { expect { call }.not_to raise_error }
49
38
  end
50
39
 
51
40
  context 'when signature is malformed' do
52
41
  let(:signature) { '123' }
53
42
 
54
- before do
55
- allow(Castle::Core::ProcessWebhook)
56
- .to receive(:call)
57
- .and_return(webhook_body)
58
- end
43
+ before { allow(Castle::Core::ProcessWebhook).to receive(:call).and_return(webhook_body) }
59
44
 
60
45
  it do
61
- expect { call }
62
- .to raise_error(
63
- Castle::WebhookVerificationError,
64
- 'Signature not matching the expected signature'
65
- )
46
+ expect { call }.to raise_error(
47
+ Castle::WebhookVerificationError,
48
+ 'Signature not matching the expected signature'
49
+ )
66
50
  end
67
51
  end
68
52
  end
@@ -42,11 +42,7 @@ describe Castle do
42
42
  end
43
43
 
44
44
  context 'with block and options' do
45
- before do
46
- castle.configure(request_timeout: timeout) do |config|
47
- config.api_secret = value
48
- end
49
- end
45
+ before { castle.configure(request_timeout: timeout) { |config| config.api_secret = value } }
50
46
 
51
47
  it_behaves_like 'config_setup'
52
48
  end
@@ -56,11 +52,9 @@ describe Castle do
56
52
  let(:value) { 'new_secret' }
57
53
 
58
54
  it do
59
- expect do
60
- castle.configure do |config|
61
- config.wrong_config = value
62
- end
63
- end.to raise_error(Castle::ConfigurationError)
55
+ expect { castle.configure { |config| config.wrong_config = value } }.to raise_error(
56
+ Castle::ConfigurationError
57
+ )
64
58
  end
65
59
  end
66
60
  end
data/spec/spec_helper.rb CHANGED
@@ -19,8 +19,6 @@ Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
19
19
  RSpec.configure do |config|
20
20
  config.before do
21
21
  Castle.config.reset
22
- Castle.configure do |cfg|
23
- cfg.api_secret = 'secret'
24
- end
22
+ Castle.configure { |cfg| cfg.api_secret = 'secret' }
25
23
  end
26
24
  end
@@ -0,0 +1,152 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.shared_examples_for 'action request' do |action|
4
+ subject(:request_response) { client.send(action.to_sym, options) }
5
+
6
+ let(:options) do
7
+ {
8
+ request_token: request_token,
9
+ event: event,
10
+ status: status,
11
+ user: user,
12
+ context: context,
13
+ properties: properties
14
+ }
15
+ end
16
+ let(:request_token) { '7e51335b-f4bc-4bc7-875d-b713fb61eb23-bf021a3022a1a302' }
17
+ let(:event) { '$login' }
18
+ let(:status) { '$succeeded' }
19
+ let(:user) { { id: '1234', email: 'foobar@mail.com' } }
20
+ let(:properties) { {} }
21
+ let(:request_body) do
22
+ {
23
+ request_token: request_token,
24
+ event: event,
25
+ status: status,
26
+ user: user,
27
+ context: context,
28
+ properties: properties,
29
+ timestamp: time_auto,
30
+ sent_at: time_auto
31
+ }
32
+ end
33
+
34
+ context 'when used with symbol keys' do
35
+ it do
36
+ request_response
37
+
38
+ assert_requested :post, "https://api.castle.io/v1/#{action}", times: 1 do |req|
39
+ JSON.parse(req.body) == JSON.parse(request_body.to_json)
40
+ end
41
+ end
42
+
43
+ context 'when passed timestamp in options and no defined timestamp' do
44
+ let(:client) { client_with_no_timestamp }
45
+
46
+ before do
47
+ options[:timestamp] = time_user
48
+ request_body[:timestamp] = time_user
49
+
50
+ request_response
51
+ end
52
+
53
+ it do
54
+ assert_requested :post, "https://api.castle.io/v1/#{action}", times: 1 do |req|
55
+ JSON.parse(req.body) == JSON.parse(request_body.to_json)
56
+ end
57
+ end
58
+ end
59
+
60
+ context 'with client initialized with timestamp' do
61
+ let(:client) { client_with_user_timestamp }
62
+
63
+ before do
64
+ request_body[:timestamp] = time_user
65
+
66
+ request_response
67
+ end
68
+
69
+ it do
70
+ assert_requested :post, "https://api.castle.io/v1/#{action}", times: 1 do |req|
71
+ JSON.parse(req.body) == JSON.parse(request_body.to_json)
72
+ end
73
+ end
74
+ end
75
+ end
76
+
77
+ context 'when used with string keys' do
78
+ before { request_response }
79
+
80
+ it do
81
+ assert_requested :post, "https://api.castle.io/v1/#{action}", times: 1 do |req|
82
+ JSON.parse(req.body) == JSON.parse(request_body.to_json)
83
+ end
84
+ end
85
+ end
86
+
87
+ context 'when tracking enabled' do
88
+ before { request_response }
89
+
90
+ it do
91
+ assert_requested :post, "https://api.castle.io/v1/#{action}", times: 1 do |req|
92
+ JSON.parse(req.body) == JSON.parse(request_body.to_json)
93
+ end
94
+ end
95
+
96
+ it { expect(request_response[:failover]).to be false }
97
+ it { expect(request_response[:failover_reason]).to be_nil }
98
+ end
99
+
100
+ context 'when tracking disabled' do
101
+ before do
102
+ client.disable_tracking
103
+ request_response
104
+ end
105
+
106
+ it { assert_not_requested :post, "https://api.castle.io/v1/#{action}" }
107
+ it { expect(request_response[:action]).to be_eql(Castle::Verdict::ALLOW) }
108
+ it { expect(request_response[:user_id]).to be_eql('1234') }
109
+ it { expect(request_response[:failover]).to be true }
110
+ it { expect(request_response[:failover_reason]).to be_eql('Castle is set to do not track.') }
111
+ end
112
+
113
+ context 'when request with fail' do
114
+ before do
115
+ allow(Castle::API).to receive(:send_request).and_raise(
116
+ Castle::RequestError.new(Timeout::Error)
117
+ )
118
+ end
119
+
120
+ context 'with request error and throw strategy' do
121
+ before { allow(Castle.config).to receive(:failover_strategy).and_return(:throw) }
122
+
123
+ it { expect { request_response }.to raise_error(Castle::RequestError) }
124
+ end
125
+
126
+ context 'with request error and not throw on eg deny strategy' do
127
+ it { assert_not_requested :post, "https:/:secret@api.castle.io/v1/#{action}" }
128
+ it { expect(request_response[:action]).to be_eql('allow') }
129
+ it { expect(request_response[:user_id]).to be_eql('1234') }
130
+ it { expect(request_response[:failover]).to be true }
131
+ it { expect(request_response[:failover_reason]).to be_eql('Castle::RequestError') }
132
+ end
133
+ end
134
+
135
+ context 'when request is internal server error' do
136
+ before { allow(Castle::API).to receive(:send_request).and_raise(Castle::InternalServerError) }
137
+
138
+ describe 'throw strategy' do
139
+ before { allow(Castle.config).to receive(:failover_strategy).and_return(:throw) }
140
+
141
+ it { expect { request_response }.to raise_error(Castle::InternalServerError) }
142
+ end
143
+
144
+ describe 'not throw on eg deny strategy' do
145
+ it { assert_not_requested :post, "https:/:secret@api.castle.io/v1/#{action}" }
146
+ it { expect(request_response[:action]).to be_eql('allow') }
147
+ it { expect(request_response[:user_id]).to be_eql('1234') }
148
+ it { expect(request_response[:failover]).to be true }
149
+ it { expect(request_response[:failover_reason]).to be_eql('Castle::InternalServerError') }
150
+ end
151
+ end
152
+ end
@@ -16,81 +16,55 @@ end
16
16
 
17
17
  shared_examples 'configuration_request_timeout' do
18
18
  describe 'request_timeout' do
19
- it do
20
- expect(config.request_timeout).to be_eql(1000)
21
- end
19
+ it { expect(config.request_timeout).to be_eql(1000) }
22
20
 
23
21
  context 'with setter' do
24
22
  let(:value) { 50.0 }
25
23
 
26
- before do
27
- config.request_timeout = value
28
- end
24
+ before { config.request_timeout = value }
29
25
 
30
- it do
31
- expect(config.request_timeout).to be_eql(value)
32
- end
26
+ it { expect(config.request_timeout).to be_eql(value) }
33
27
  end
34
28
  end
35
29
  end
36
30
 
37
31
  shared_examples 'configuration_allowlisted' do
38
32
  describe 'allowlisted' do
39
- it do
40
- expect(config.allowlisted.size).to be_eql(0)
41
- end
33
+ it { expect(config.allowlisted.size).to be_eql(0) }
42
34
 
43
35
  context 'with setter' do
44
- before do
45
- config.allowlisted = ['header']
46
- end
36
+ before { config.allowlisted = ['header'] }
47
37
 
48
- it do
49
- expect(config.allowlisted).to be_eql(['Header'])
50
- end
38
+ it { expect(config.allowlisted).to be_eql(['Header']) }
51
39
  end
52
40
  end
53
41
  end
54
42
 
55
43
  shared_examples 'configuration_denylisted' do
56
44
  describe 'denylisted' do
57
- it do
58
- expect(config.denylisted.size).to be_eql(0)
59
- end
45
+ it { expect(config.denylisted.size).to be_eql(0) }
60
46
 
61
47
  context 'with setter' do
62
- before do
63
- config.denylisted = ['header']
64
- end
48
+ before { config.denylisted = ['header'] }
65
49
 
66
- it do
67
- expect(config.denylisted).to be_eql(['Header'])
68
- end
50
+ it { expect(config.denylisted).to be_eql(['Header']) }
69
51
  end
70
52
  end
71
53
  end
72
54
 
73
55
  shared_examples 'configuration_failover_strategy' do
74
56
  describe 'failover_strategy' do
75
- it do
76
- expect(config.failover_strategy).to be_eql(Castle::Failover::Strategy::ALLOW)
77
- end
57
+ it { expect(config.failover_strategy).to be_eql(Castle::Failover::Strategy::ALLOW) }
78
58
 
79
59
  context 'with setter' do
80
- before do
81
- config.failover_strategy = Castle::Failover::Strategy::DENY
82
- end
60
+ before { config.failover_strategy = Castle::Failover::Strategy::DENY }
83
61
 
84
- it do
85
- expect(config.failover_strategy).to be_eql(Castle::Failover::Strategy::DENY)
86
- end
62
+ it { expect(config.failover_strategy).to be_eql(Castle::Failover::Strategy::DENY) }
87
63
  end
88
64
 
89
65
  context 'when broken' do
90
66
  it do
91
- expect do
92
- config.failover_strategy = :unicorn
93
- end.to raise_error(Castle::ConfigurationError)
67
+ expect { config.failover_strategy = :unicorn }.to raise_error(Castle::ConfigurationError)
94
68
  end
95
69
  end
96
70
  end
@@ -103,9 +77,7 @@ shared_examples 'configuration_api_secret' do
103
77
  let(:secret_key) { 'secret_key' }
104
78
 
105
79
  before do
106
- allow(ENV).to receive(:fetch).with(
107
- 'CASTLE_API_SECRET', ''
108
- ).and_return(secret_key_env)
80
+ allow(ENV).to receive(:fetch).with('CASTLE_API_SECRET', '').and_return(secret_key_env)
109
81
  config.reset
110
82
  end
111
83
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: castle-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan Brissmyr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-19 00:00:00.000000000 Z
11
+ date: 2021-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -37,11 +37,12 @@ files:
37
37
  - lib/castle/api/approve_device.rb
38
38
  - lib/castle/api/authenticate.rb
39
39
  - lib/castle/api/end_impersonation.rb
40
+ - lib/castle/api/filter.rb
40
41
  - lib/castle/api/get_device.rb
41
42
  - lib/castle/api/get_devices_for_user.rb
42
- - lib/castle/api/identify.rb
43
+ - lib/castle/api/log.rb
43
44
  - lib/castle/api/report_device.rb
44
- - lib/castle/api/review.rb
45
+ - lib/castle/api/risk.rb
45
46
  - lib/castle/api/start_impersonation.rb
46
47
  - lib/castle/api/track.rb
47
48
  - lib/castle/client.rb
@@ -50,11 +51,12 @@ files:
50
51
  - lib/castle/commands/approve_device.rb
51
52
  - lib/castle/commands/authenticate.rb
52
53
  - lib/castle/commands/end_impersonation.rb
54
+ - lib/castle/commands/filter.rb
53
55
  - lib/castle/commands/get_device.rb
54
56
  - lib/castle/commands/get_devices_for_user.rb
55
- - lib/castle/commands/identify.rb
57
+ - lib/castle/commands/log.rb
56
58
  - lib/castle/commands/report_device.rb
57
- - lib/castle/commands/review.rb
59
+ - lib/castle/commands/risk.rb
58
60
  - lib/castle/commands/start_impersonation.rb
59
61
  - lib/castle/commands/track.rb
60
62
  - lib/castle/configuration.rb
@@ -67,7 +69,6 @@ files:
67
69
  - lib/castle/core/process_webhook.rb
68
70
  - lib/castle/core/send_request.rb
69
71
  - lib/castle/errors.rb
70
- - lib/castle/events.rb
71
72
  - lib/castle/failover/prepare_response.rb
72
73
  - lib/castle/failover/strategy.rb
73
74
  - lib/castle/headers/extract.rb
@@ -101,11 +102,12 @@ files:
101
102
  - spec/lib/castle/api/approve_device_spec.rb
102
103
  - spec/lib/castle/api/authenticate_spec.rb
103
104
  - spec/lib/castle/api/end_impersonation_spec.rb
105
+ - spec/lib/castle/api/filter_spec.rb
104
106
  - spec/lib/castle/api/get_device_spec.rb
105
107
  - spec/lib/castle/api/get_devices_for_user_spec.rb
106
- - spec/lib/castle/api/identify_spec.rb
108
+ - spec/lib/castle/api/log_spec.rb
107
109
  - spec/lib/castle/api/report_device_spec.rb
108
- - spec/lib/castle/api/review_spec.rb
110
+ - spec/lib/castle/api/risk_spec.rb
109
111
  - spec/lib/castle/api/start_impersonation_spec.rb
110
112
  - spec/lib/castle/api/track_spec.rb
111
113
  - spec/lib/castle/api_spec.rb
@@ -115,11 +117,12 @@ files:
115
117
  - spec/lib/castle/commands/approve_device_spec.rb
116
118
  - spec/lib/castle/commands/authenticate_spec.rb
117
119
  - spec/lib/castle/commands/end_impersonation_spec.rb
120
+ - spec/lib/castle/commands/filter_spec.rb
118
121
  - spec/lib/castle/commands/get_device_spec.rb
119
122
  - spec/lib/castle/commands/get_devices_for_user_spec.rb
120
- - spec/lib/castle/commands/identify_spec.rb
123
+ - spec/lib/castle/commands/log_spec.rb
121
124
  - spec/lib/castle/commands/report_device_spec.rb
122
- - spec/lib/castle/commands/review_spec.rb
125
+ - spec/lib/castle/commands/risk_spec.rb
123
126
  - spec/lib/castle/commands/start_impersonation_spec.rb
124
127
  - spec/lib/castle/commands/track_spec.rb
125
128
  - spec/lib/castle/configuration_spec.rb
@@ -131,7 +134,6 @@ files:
131
134
  - spec/lib/castle/core/process_response_spec.rb
132
135
  - spec/lib/castle/core/process_webhook_spec.rb
133
136
  - spec/lib/castle/core/send_request_spec.rb
134
- - spec/lib/castle/events_spec.rb
135
137
  - spec/lib/castle/failover/strategy_spec.rb
136
138
  - spec/lib/castle/headers/extract_spec.rb
137
139
  - spec/lib/castle/headers/filter_spec.rb
@@ -154,6 +156,7 @@ files:
154
156
  - spec/lib/castle/webhooks/verify_spec.rb
155
157
  - spec/lib/castle_spec.rb
156
158
  - spec/spec_helper.rb
159
+ - spec/support/shared_examples/action_request.rb
157
160
  - spec/support/shared_examples/configuration.rb
158
161
  homepage: https://castle.io
159
162
  licenses:
@@ -174,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
177
  - !ruby/object:Gem::Version
175
178
  version: '0'
176
179
  requirements: []
177
- rubygems_version: 3.1.3
180
+ rubygems_version: 3.0.6
178
181
  signing_key:
179
182
  specification_version: 4
180
183
  summary: Castle
@@ -184,6 +187,7 @@ test_files:
184
187
  - spec/integration/rails/support/all.rb
185
188
  - spec/integration/rails/support/home_controller.rb
186
189
  - spec/integration/rails/rails_spec.rb
190
+ - spec/support/shared_examples/action_request.rb
187
191
  - spec/support/shared_examples/configuration.rb
188
192
  - spec/lib/castle_spec.rb
189
193
  - spec/lib/castle/session_spec.rb
@@ -213,30 +217,31 @@ test_files:
213
217
  - spec/lib/castle/headers/format_spec.rb
214
218
  - spec/lib/castle/headers/extract_spec.rb
215
219
  - spec/lib/castle/headers/filter_spec.rb
216
- - spec/lib/castle/api/review_spec.rb
217
220
  - spec/lib/castle/api/report_device_spec.rb
218
221
  - spec/lib/castle/api/authenticate_spec.rb
219
222
  - spec/lib/castle/api/track_spec.rb
220
223
  - spec/lib/castle/api/get_device_spec.rb
224
+ - spec/lib/castle/api/risk_spec.rb
221
225
  - spec/lib/castle/api/start_impersonation_spec.rb
226
+ - spec/lib/castle/api/log_spec.rb
222
227
  - spec/lib/castle/api/approve_device_spec.rb
223
228
  - spec/lib/castle/api/get_devices_for_user_spec.rb
224
229
  - spec/lib/castle/api/end_impersonation_spec.rb
225
- - spec/lib/castle/api/identify_spec.rb
226
- - spec/lib/castle/commands/review_spec.rb
230
+ - spec/lib/castle/api/filter_spec.rb
227
231
  - spec/lib/castle/commands/report_device_spec.rb
228
232
  - spec/lib/castle/commands/authenticate_spec.rb
229
233
  - spec/lib/castle/commands/track_spec.rb
230
234
  - spec/lib/castle/commands/get_device_spec.rb
235
+ - spec/lib/castle/commands/risk_spec.rb
231
236
  - spec/lib/castle/commands/start_impersonation_spec.rb
237
+ - spec/lib/castle/commands/log_spec.rb
232
238
  - spec/lib/castle/commands/approve_device_spec.rb
233
239
  - spec/lib/castle/commands/get_devices_for_user_spec.rb
234
240
  - spec/lib/castle/commands/end_impersonation_spec.rb
235
- - spec/lib/castle/commands/identify_spec.rb
241
+ - spec/lib/castle/commands/filter_spec.rb
236
242
  - spec/lib/castle/validators/not_supported_spec.rb
237
243
  - spec/lib/castle/validators/present_spec.rb
238
244
  - spec/lib/castle/webhooks/verify_spec.rb
239
245
  - spec/lib/castle/failover/strategy_spec.rb
240
246
  - spec/lib/castle/secure_mode_spec.rb
241
247
  - spec/lib/castle/singleton_configuration_spec.rb
242
- - spec/lib/castle/events_spec.rb