castle-rb 8.1.0 → 9.0.0

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.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +317 -0
  3. data/LICENSE +21 -0
  4. data/README.md +290 -112
  5. data/lib/castle/api/filter.rb +3 -1
  6. data/lib/castle/api/list_items/create_batch.rb +22 -0
  7. data/lib/castle/api/lists/create.rb +1 -1
  8. data/lib/castle/api/log.rb +2 -1
  9. data/lib/castle/api/privacy/delete_data.rb +23 -0
  10. data/lib/castle/api/privacy/request_data.rb +23 -0
  11. data/lib/castle/api/risk.rb +2 -1
  12. data/lib/castle/client.rb +12 -52
  13. data/lib/castle/client_actions/list_items.rb +7 -2
  14. data/lib/castle/client_actions/privacy.rb +20 -0
  15. data/lib/castle/commands/list_items/create_batch.rb +22 -0
  16. data/lib/castle/commands/privacy/delete_data.rb +20 -0
  17. data/lib/castle/commands/privacy/request_data.rb +20 -0
  18. data/lib/castle/core/get_connection.rb +5 -1
  19. data/lib/castle/core/process_response.rb +1 -0
  20. data/lib/castle/core/process_webhook.rb +1 -1
  21. data/lib/castle/core/send_request.rb +2 -1
  22. data/lib/castle/errors.rb +1 -5
  23. data/lib/castle/headers/filter.rb +1 -1
  24. data/lib/castle/version.rb +1 -1
  25. data/lib/castle.rb +8 -17
  26. metadata +34 -218
  27. data/lib/castle/api/approve_device.rb +0 -20
  28. data/lib/castle/api/authenticate.rb +0 -28
  29. data/lib/castle/api/end_impersonation.rb +0 -22
  30. data/lib/castle/api/get_device.rb +0 -20
  31. data/lib/castle/api/get_devices_for_user.rb +0 -20
  32. data/lib/castle/api/report_device.rb +0 -20
  33. data/lib/castle/api/start_impersonation.rb +0 -22
  34. data/lib/castle/api/track.rb +0 -19
  35. data/lib/castle/commands/approve_device.rb +0 -17
  36. data/lib/castle/commands/authenticate.rb +0 -23
  37. data/lib/castle/commands/end_impersonation.rb +0 -25
  38. data/lib/castle/commands/get_device.rb +0 -17
  39. data/lib/castle/commands/get_devices_for_user.rb +0 -17
  40. data/lib/castle/commands/report_device.rb +0 -17
  41. data/lib/castle/commands/start_impersonation.rb +0 -25
  42. data/lib/castle/commands/track.rb +0 -22
  43. data/lib/castle/support/hanami.rb +0 -15
  44. data/lib/castle/support/padrino.rb +0 -19
  45. data/spec/integration/rails/rails_spec.rb +0 -95
  46. data/spec/integration/rails/support/all.rb +0 -6
  47. data/spec/integration/rails/support/application.rb +0 -17
  48. data/spec/integration/rails/support/home_controller.rb +0 -39
  49. data/spec/lib/castle/api/approve_device_spec.rb +0 -17
  50. data/spec/lib/castle/api/authenticate_spec.rb +0 -133
  51. data/spec/lib/castle/api/end_impersonation_spec.rb +0 -59
  52. data/spec/lib/castle/api/filter_spec.rb +0 -5
  53. data/spec/lib/castle/api/get_device_spec.rb +0 -17
  54. data/spec/lib/castle/api/get_devices_for_user_spec.rb +0 -17
  55. data/spec/lib/castle/api/list_items/archive_spec.rb +0 -18
  56. data/spec/lib/castle/api/list_items/count_spec.rb +0 -21
  57. data/spec/lib/castle/api/list_items/create_spec.rb +0 -22
  58. data/spec/lib/castle/api/list_items/get_spec.rb +0 -18
  59. data/spec/lib/castle/api/list_items/query_spec.rb +0 -21
  60. data/spec/lib/castle/api/list_items/unarchive_spec.rb +0 -18
  61. data/spec/lib/castle/api/list_items/update_spec.rb +0 -22
  62. data/spec/lib/castle/api/lists/create_spec.rb +0 -21
  63. data/spec/lib/castle/api/lists/delete_spec.rb +0 -17
  64. data/spec/lib/castle/api/lists/get_all_spec.rb +0 -17
  65. data/spec/lib/castle/api/lists/get_spec.rb +0 -17
  66. data/spec/lib/castle/api/lists/query_spec.rb +0 -21
  67. data/spec/lib/castle/api/lists/update_spec.rb +0 -21
  68. data/spec/lib/castle/api/log_spec.rb +0 -5
  69. data/spec/lib/castle/api/report_device_spec.rb +0 -17
  70. data/spec/lib/castle/api/risk_spec.rb +0 -5
  71. data/spec/lib/castle/api/start_impersonation_spec.rb +0 -59
  72. data/spec/lib/castle/api/track_spec.rb +0 -65
  73. data/spec/lib/castle/api_spec.rb +0 -36
  74. data/spec/lib/castle/client_id/extract_spec.rb +0 -47
  75. data/spec/lib/castle/client_spec.rb +0 -342
  76. data/spec/lib/castle/command_spec.rb +0 -9
  77. data/spec/lib/castle/commands/approve_device_spec.rb +0 -24
  78. data/spec/lib/castle/commands/authenticate_spec.rb +0 -86
  79. data/spec/lib/castle/commands/end_impersonation_spec.rb +0 -72
  80. data/spec/lib/castle/commands/filter_spec.rb +0 -72
  81. data/spec/lib/castle/commands/get_device_spec.rb +0 -24
  82. data/spec/lib/castle/commands/get_devices_for_user_spec.rb +0 -24
  83. data/spec/lib/castle/commands/list_items/archive_spec.rb +0 -21
  84. data/spec/lib/castle/commands/list_items/count_spec.rb +0 -21
  85. data/spec/lib/castle/commands/list_items/create_spec.rb +0 -22
  86. data/spec/lib/castle/commands/list_items/get_spec.rb +0 -21
  87. data/spec/lib/castle/commands/list_items/query_spec.rb +0 -27
  88. data/spec/lib/castle/commands/list_items/unarchive_spec.rb +0 -21
  89. data/spec/lib/castle/commands/list_items/update_spec.rb +0 -21
  90. data/spec/lib/castle/commands/lists/create_spec.rb +0 -33
  91. data/spec/lib/castle/commands/lists/delete_spec.rb +0 -21
  92. data/spec/lib/castle/commands/lists/get_all_spec.rb +0 -11
  93. data/spec/lib/castle/commands/lists/get_spec.rb +0 -21
  94. data/spec/lib/castle/commands/lists/query_spec.rb +0 -27
  95. data/spec/lib/castle/commands/lists/update_spec.rb +0 -29
  96. data/spec/lib/castle/commands/log_spec.rb +0 -73
  97. data/spec/lib/castle/commands/report_device_spec.rb +0 -24
  98. data/spec/lib/castle/commands/risk_spec.rb +0 -73
  99. data/spec/lib/castle/commands/start_impersonation_spec.rb +0 -72
  100. data/spec/lib/castle/commands/track_spec.rb +0 -89
  101. data/spec/lib/castle/configuration_spec.rb +0 -14
  102. data/spec/lib/castle/context/get_default_spec.rb +0 -41
  103. data/spec/lib/castle/context/merge_spec.rb +0 -23
  104. data/spec/lib/castle/context/prepare_spec.rb +0 -42
  105. data/spec/lib/castle/context/sanitize_spec.rb +0 -27
  106. data/spec/lib/castle/core/get_connection_spec.rb +0 -43
  107. data/spec/lib/castle/core/process_response_spec.rb +0 -103
  108. data/spec/lib/castle/core/process_webhook_spec.rb +0 -52
  109. data/spec/lib/castle/core/send_request_spec.rb +0 -97
  110. data/spec/lib/castle/failover/strategy_spec.rb +0 -12
  111. data/spec/lib/castle/headers/extract_spec.rb +0 -103
  112. data/spec/lib/castle/headers/filter_spec.rb +0 -42
  113. data/spec/lib/castle/headers/format_spec.rb +0 -25
  114. data/spec/lib/castle/ips/extract_spec.rb +0 -91
  115. data/spec/lib/castle/logger_spec.rb +0 -39
  116. data/spec/lib/castle/payload/prepare_spec.rb +0 -52
  117. data/spec/lib/castle/secure_mode_spec.rb +0 -7
  118. data/spec/lib/castle/session_spec.rb +0 -61
  119. data/spec/lib/castle/singleton_configuration_spec.rb +0 -14
  120. data/spec/lib/castle/utils/clean_invalid_chars_spec.rb +0 -69
  121. data/spec/lib/castle/utils/clone_spec.rb +0 -19
  122. data/spec/lib/castle/utils/deep_symbolize_keys_spec.rb +0 -50
  123. data/spec/lib/castle/utils/get_timestamp_spec.rb +0 -16
  124. data/spec/lib/castle/utils/merge_spec.rb +0 -13
  125. data/spec/lib/castle/validators/not_supported_spec.rb +0 -19
  126. data/spec/lib/castle/validators/present_spec.rb +0 -25
  127. data/spec/lib/castle/verdict_spec.rb +0 -9
  128. data/spec/lib/castle/version_spec.rb +0 -5
  129. data/spec/lib/castle/webhooks/verify_spec.rb +0 -59
  130. data/spec/lib/castle_spec.rb +0 -58
  131. data/spec/spec_helper.rb +0 -26
  132. data/spec/support/shared_examples/action_request.rb +0 -167
  133. data/spec/support/shared_examples/configuration.rb +0 -99
  134. data/spec/support/shared_examples/list_items.rb +0 -52
  135. data/spec/support/shared_examples/lists.rb +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f571bda5aa4075f18ef7c64173155401d822ced4fe66fe7c4ceaf4c7c6c6c6e
4
- data.tar.gz: 15709ff2d5bbdf57063bdd0c1f3eb492f78beff5b1e2b8c61a848f3a2af1d32d
3
+ metadata.gz: '085ac2cdd6ebd7b69ab9171c72009c3f3d792c3d21d55b93d914abd93425098d'
4
+ data.tar.gz: c31f5076e77d08c27d06b7722558b816a56868a51e7a2f885b9fc9236fc50615
5
5
  SHA512:
6
- metadata.gz: 5186002c86cef93deb33c8c03c95ffc81adaa7b59b032a06f2f81ff1423d0cd247d198e0a7fce2a15e2a1ab6a76a986c524644c4f4338be5a7e16ec45ba6cdca
7
- data.tar.gz: a9c63ce6293981630ed431471ceb0ffb70fe990b68784f70088dba28140a63e7ff012286604d8da9a79f5b93486ba4cb8e3318c93ee3617c29f6f981ef737d86
6
+ metadata.gz: ecf515a3a5ff3a264a749171a6507d1c03635415359a392b8daafbf1e57291749e509501d449c902b1811903688a2499b7b845bc9cf27d167faa8412cb3ff40e
7
+ data.tar.gz: 125266f1b4875f105b024b4bef5baf38175af1741e53c35cfe66ab7051dceb6adb76dda87b330ccdd48b06fc30bd4434283868e8be4de540752fbbbe06028ff9
data/CHANGELOG.md ADDED
@@ -0,0 +1,317 @@
1
+ # Changelog
2
+
3
+ ## master
4
+
5
+ ## 9.0.0
6
+
7
+ **BREAKING CHANGES:**
8
+
9
+ - Drop support for Ruby < 3.2
10
+ - Drop legacy API endpoints and the matching DSL on `Castle::Client`:
11
+ - `Castle::API::Track`, `Castle::Client#track`
12
+ - `Castle::API::Authenticate`, `Castle::Client#authenticate`
13
+ - Device endpoints: `Castle::API::ApproveDevice`, `Castle::API::GetDevice`, `Castle::API::GetDevicesForUser`, `Castle::API::ReportDevice`
14
+ - Impersonation endpoints: `Castle::API::StartImpersonation`, `Castle::API::EndImpersonation`, `Castle::Client#start_impersonation`, `Castle::Client#end_impersonation`
15
+ - Removed `Castle::ImpersonationFailed` error class
16
+ - Use `Castle::API::Risk`, `Castle::API::Filter`, `Castle::API::Log` (and the matching `Castle::Client#risk` / `#filter` / `#log` methods) instead.
17
+ - Drop `castle/support/hanami` (only ever supported the long-EOL Hanami 1.x architecture) and `castle/support/padrino` (negligible adoption). The 3-line replacement is documented in the README.
18
+
19
+ **Enhancements:**
20
+
21
+ - Add `Castle::API::ListItems::CreateBatch` (`POST /v1/lists/{list_id}/items/batch`) and `Castle::Client#create_batch_list_items`
22
+ - Add `Castle::API::Privacy::RequestData` and `Castle::API::Privacy::DeleteData` (current `POST` / `DELETE /v1/privacy/users`) plus matching `Castle::Client#request_user_data` / `#delete_user_data` — closes [#261](https://github.com/castle/castle-ruby/issues/261). The deprecated path-based variants are intentionally not exposed.
23
+ - Add support for Ruby 3.4 and Rails 8.0 / 8.1. CI matrix runs nine representative Ruby × Rails combinations across Ruby 3.2/3.3/3.4 and Rails 7.0–8.1; see [`.github/workflows/specs.yml`](.github/workflows/specs.yml) for the exact list
24
+ - Migrate CI from CircleCI to GitHub Actions (`specs.yml` and `lint.yml`); the dormant CircleCI integration and stale checkout key are removed
25
+ - Replace `appraisal` with hand-maintained `gemfiles/*.gemfile` (Rails 7.0, 7.1, 7.2, 8.0, 8.1)
26
+ - Switch from RVM-style `.ruby-gemset` to asdf-style `.tool-versions`
27
+ - Modernize `.rubocop.yml`: drop deprecated `prettier` inherit, target Ruby 3.2, add `rubocop-rake`
28
+ - Drop deprecated `coveralls_reborn`; rely on `simplecov` directly
29
+ - Drop `byebug` dev dependency in favor of stdlib `debug`
30
+ - Add gem metadata (`source_code_uri`, `changelog_uri`, `bug_tracker_uri`, `rubygems_mfa_required`)
31
+ - Drop the dormant Coditsu CI integration
32
+
33
+ **Bug fixes:**
34
+
35
+ - Failover handlers in `Castle::API::Risk` / `Filter` / `Log` no longer crash with `NoMethodError` when `options[:user]` is missing — closes [#279](https://github.com/castle/castle-ruby/issues/279). `Filter` additionally falls back to `matching_user_id`.
36
+ - The same hardening is applied to the `Castle::Client#filter` / `#risk` / `#log` do-not-track path, which previously crashed with the same shape when tracking was disabled and the payload had no `:user` block.
37
+ - A per-call `Castle::Configuration` passed via `Castle::API::Risk.call(payload.merge(config: …))` now correctly drives the underlying HTTP connection (host, port, timeouts, SSL) — previously only the request body honored it while the connection was always built from the global singleton.
38
+ - `Castle::Core::GetConnection` now sets both `open_timeout` and `read_timeout` from `request_timeout`, so slow TCP/TLS handshakes hit the configured budget instead of falling back to Net::HTTP's 60 s default.
39
+
40
+ ## 8.1.0
41
+
42
+ - [#272](https://github.com/castle/castle-ruby/pull/272)
43
+ - Add support for Lists API
44
+
45
+ ## 8.0.0
46
+
47
+ - [#267](https://github.com/castle/castle-ruby/pull/267)
48
+ - fix issues with non-string values in headers
49
+
50
+ - [#262](https://github.com/castle/castle-ruby/pull/262)[#268](https://github.com/castle/castle-ruby/pull/268)
51
+ - add 429 RateLimitError
52
+
53
+ - Bump dependencies
54
+ - Add support for Rubies 3.1 and 3.2 and 3.3
55
+ - Add support Rails 7
56
+
57
+ **BREAKING CHANGES:**
58
+
59
+ - Drop support for Rubies < 2.7 and Rails < 6
60
+
61
+ ## 7.2.0
62
+
63
+ - [#253](https://github.com/castle/castle-ruby/pull/253)
64
+
65
+ - added InvalidRequestTokenError
66
+
67
+ - [#254](https://github.com/castle/castle-ruby/pull/254)
68
+ - remove X-Castle-\* headers from allowlist
69
+
70
+ ## 7.1.2
71
+
72
+ - [#247](https://github.com/castle/castle-ruby/pull/247)
73
+ - fixed issue with body as null
74
+
75
+ ## 7.1.1
76
+
77
+ - [#246](https://github.com/castle/castle-ruby/pull/246)
78
+ - support failover for risk and filter
79
+
80
+ ## 7.1.0 (2021-06-09)
81
+
82
+ - [#245](https://github.com/castle/castle-ruby/pull/245)
83
+ - removed not needed sdk based validations
84
+
85
+ ## 7.0.0 (2021-06-03)
86
+
87
+ **BREAKING CHANGES:**
88
+
89
+ - [#237](https://github.com/castle/castle-ruby/pull/237)
90
+ - remove `identify` and `review` commands - they are no longer supported
91
+ - remove `Castle::Events` - please use [recognized events](https://docs.castle.io/v1/reference/events/) instead
92
+
93
+ **Enhancements:**
94
+
95
+ - [#243](https://github.com/castle/castle-ruby/pull/243)
96
+ - add risk, filter and log endpoints
97
+ - [#242](https://github.com/castle/castle-ruby/pull/242)
98
+ - correct configuration used by the logger
99
+ - prevent unnecessary calls to the singleton configuration
100
+
101
+ ## 6.0.1 (2021-01-19)
102
+
103
+ **Enhancements:**
104
+
105
+ - [#234](https://github.com/castle/castle-ruby/pull/234) rename the namespace from `IP` to `IPs`
106
+
107
+ ## 6.0.0 (2021-01-19)
108
+
109
+ **BREAKING CHANGES:**
110
+
111
+ - [#228](https://github.com/castle/castle-ruby/pull/228) change the impersonation-related DSL
112
+ - [#213](https://github.com/castle/castle-ruby/pull/213) rename config.url to config.base_url
113
+ - [#214](https://github.com/castle/castle-ruby/pull/214) reorganize structure of the SDK, Castle::API::Session renamed to Castle::Session
114
+ - [#216](https://github.com/castle/castle-ruby/pull/216) add new context and payload builders, changed DSL
115
+
116
+ **Enhancements:**
117
+
118
+ - [#231](https://github.com/castle/castle-ruby/pull/231) allow to instantiate the configuration
119
+ - [#230](https://github.com/castle/castle-ruby/pull/230) add webhooks verification
120
+ - [#223](https://github.com/castle/castle-ruby/pull/223), [#224](https://github.com/castle/castle-ruby/pull/224), [#225](https://github.com/castle/castle-ruby/pull/225), [#226](https://github.com/castle/castle-ruby/pull/226), [#227](https://github.com/castle/castle-ruby/pull/227) allow to manage the devices
121
+ - [#221](https://github.com/castle/castle-ruby/pull/221), [#222](https://github.com/castle/castle-ruby/pull/222) add more tests
122
+ - [#220](https://github.com/castle/castle-ruby/pull/220) update the default timeout
123
+ - [#218](https://github.com/castle/castle-ruby/pull/218) add logger config option
124
+ - [#212](https://github.com/castle/castle-ruby/pull/212) drop origin from the default context
125
+
126
+ ## 5.0.0 (2020-09-29)
127
+
128
+ **BREAKING CHANGES:**
129
+
130
+ - [#207](https://github.com/castle/castle-ruby/pull/207) allow to reuse the connection (https://github.com/castle/castle-ruby#connection-reuse)
131
+ - [#204](https://github.com/castle/castle-ruby/pull/204) drop the configuration `host`, `port`, `url_prefix` options in favor of `url`
132
+ - [#203](https://github.com/castle/castle-ruby/pull/203) rename the `whitelist/blacklist` configuration option to `allowlist/denylist`
133
+
134
+ **Enhancements:**
135
+
136
+ - [#208](https://github.com/castle/castle-ruby/pull/208) bump the dependencies
137
+ - [#205](https://github.com/castle/castle-ruby/pull/205) extend DEFAULT_ALLOWLIST
138
+
139
+ ## 4.3.0 (2020-05-22)
140
+
141
+ - [#197](https://github.com/castle/castle-ruby/pull/197) add `trusted_proxy_depth` and `trust_proxy_chain` configuration options
142
+
143
+ ## 4.2.1 (2020-04-07)
144
+
145
+ - [#189](https://github.com/castle/castle-ruby/pull/189) added missing require
146
+
147
+ ## 4.2.0 (2020-03-31)
148
+
149
+ - [#187](https://github.com/castle/castle-ruby/pull/187) dropped X-Client-Id from calculation of ip, drop appending default ip headers to the ip_header list config when config is provided (in that case default headers have to explicitly provided)
150
+
151
+ ## 4.1.0 (2020-03-27)
152
+
153
+ - [#184](https://github.com/castle/castle-ruby/pull/184) added Castle::API::Session which exposes Net:Http instance for reuse
154
+ - [#183](https://github.com/castle/castle-ruby/pull/183) change format of url_prefix config and renamed internal classes/variables
155
+
156
+ ## 4.0.0 (2020-03-19)
157
+
158
+ **BREAKING CHANGES:**
159
+
160
+ - [#178](https://github.com/castle/castle-ruby/pull/178) calculation of ip requires setup of ip_headers and trusted_proxies if needed
161
+ - [#180](https://github.com/castle/castle-ruby/pull/180) api key config overwrites env provided key
162
+ - [#175](https://github.com/castle/castle-ruby/pull/175) drop special handling of cf ip header (it has to provided by ip_headers config)
163
+
164
+ **Enhancements:**
165
+
166
+ - [#171](https://github.com/castle/castle-ruby/pull/171) test against Rails 5 and Rails 6
167
+
168
+ ## 3.6.2 (2020-04-24)
169
+
170
+ - [#192](https://github.com/castle/castle-ruby/pull/192) fixed problem with symbols in env
171
+
172
+ ## 3.6.1 (2020-01-16)
173
+
174
+ **Bug fixes**:
175
+
176
+ - [#168](https://github.com/castle/castle-ruby/pull/168) do not apply whitelisting by default
177
+
178
+ ## 3.6.0 (2020-01-07)
179
+
180
+ **BREAKING CHANGES:**
181
+
182
+ - [#165](https://github.com/castle/castle-ruby/pull/165) support ruby >= 2.4
183
+
184
+ **Enhancements:**
185
+
186
+ - [#163](https://github.com/castle/castle-ruby/pull/163) scrub headers instead of dropping them
187
+
188
+ ## 3.5.2 (2019-01-09)
189
+
190
+ **Enhancements:**
191
+
192
+ - [#131](https://github.com/castle/castle-ruby/pull/131) remove requirement for `user_id`
193
+
194
+ ## 3.5.1 (2018-10-27)
195
+
196
+ **Enhancements:**
197
+
198
+ - [#132](https://github.com/castle/castle-ruby/pull/132) refactor internal `Castle::API` and it's components
199
+
200
+ ## 3.5.0 (2018-04-18)
201
+
202
+ **BREAKING CHANGES:**
203
+
204
+ - [#119](https://github.com/castle/castle-ruby/pull/119) usage of `traits` key is deprecated, use `user_traits` instead
205
+
206
+ **Enhancements:**
207
+
208
+ - [#122](https://github.com/castle/castle-ruby/pull/122) `X-Castle-Client-Id` takes precedence over `cid` from `cookies`
209
+ - [#121](https://github.com/castle/castle-ruby/pull/121) raise Castle::ImpersonationFailed when impersonation request failed
210
+
211
+ ## 3.4.2 (2018-02-26)
212
+
213
+ **Features:**
214
+
215
+ - [#115](https://github.com/castle/castle-ruby/pull/114) added reset option to `impersonate`
216
+
217
+ ## 3.4.1 (2018-02-21)
218
+
219
+ - [#113](https://github.com/castle/castle-ruby/pull/113) support ruby >= 2.2.6
220
+
221
+ **Enhancements:**
222
+
223
+ - [#108](https://github.com/castle/castle-ruby/pull/108) move context and command validation to their own scope and classes, code cleanup
224
+
225
+ ## 3.4.0 (2018-01-27)
226
+
227
+ - [#101](https://github.com/castle/castle-ruby/pull/103) added `impersonate` method with `user_id`, `impersonator` and `context` options
228
+
229
+ ## 3.3.1 (2018-01-22)
230
+
231
+ **Enhancements:**
232
+
233
+ - [#100](https://github.com/castle/castle-ruby/pull/100) use request.remote_ip and CF connecting IP in favour of request.ip if present
234
+ - [#100](https://github.com/castle/castle-ruby/pull/100) added `X-Forwarded-For` and `CF_CONNECTING_IP` to whitelisted headers
235
+
236
+ ## 3.3.0 (2018-01-12)
237
+
238
+ **BREAKING CHANGES:**
239
+
240
+ - [#97](https://github.com/castle/castle-ruby/pull/97) when data is sent in batches you may want to wrap data options with to_options method before you send it to the worker (see README) to include proper timestamp in the query
241
+
242
+ **Features:**
243
+
244
+ - [#97](https://github.com/castle/castle-ruby/pull/97) `Castle::Client` has additional option `timestamp`, `timestamp` and `sent_at` time values are automatically added to the requests, added `Castle::Client.to_options` method which adds properly formatted timestamp param to the options
245
+
246
+ ## 3.2.0 (2017-12-15)
247
+
248
+ **BREAKING CHANGES:**
249
+
250
+ - [#91](https://github.com/castle/castle-ruby/pull/91) symbolize keys for failover strategy
251
+
252
+ ## 3.1.0 (2017-12-11)
253
+
254
+ **Enhancements:**
255
+
256
+ - [#90](https://github.com/castle/castle-ruby/pull/90) added ability to extract context object and initialize client with that object
257
+
258
+ **BREAKING CHANGES:**
259
+
260
+ - `Castle::Client.new` does not not build context object anymore
261
+ - to use previous functionality use `Castle::Client.from_request`
262
+
263
+ **Features:**
264
+
265
+ - added `Castle::Client.to_context` method which allows to generate context object from the request
266
+
267
+ ## 3.0.1 (2017-11-20)
268
+
269
+ **Bug fixes:**
270
+
271
+ - [#84](https://github.com/castle/castle-ruby/pull/84) allow to use symbols for headers data
272
+
273
+ ## 3.0.0 (2017-10-18)
274
+
275
+ **Enhancements:**
276
+
277
+ - [#35](https://github.com/castle/castle-ruby/pull/35) dropped unused cookie store class, more informative Castle:Client constructor params
278
+ - [#30](https://github.com/castle/castle-ruby/pull/30) change request timeout to 500ms
279
+ - [#31](https://github.com/castle/castle-ruby/pull/31) remove auto-integration with Rails, Padrino, Sinatra (see BREAKING CHANGES, README)
280
+
281
+ **BREAKING CHANGES:**
282
+
283
+ - add `require 'castle/support/rails'` to have Castle client instance available as `castle` in your Rails controllers
284
+ - add `require 'castle/support/padrino'` to have Castle client instance available as `castle` in your Padrino helpers
285
+ - add `require 'castle/support/sinatra'` to have Castle client instance available as `castle` in your Sinatra helpers
286
+ - request timeout uses milliseconds unit from now on
287
+ - renamed `track!` to `enable_tracking`
288
+ - renamed `do_no_track!` to `disable_tracking`
289
+ - renamed `don_no_track?` to `tracked?` with opposite behaviour
290
+ - `Castle::Client.new` now takes options as a second argument
291
+ - drop support for ruby 2.1
292
+ - replaced `config.api_endpoint` with `config.host` and `config.port`
293
+ - renamed `fetch_review` to `Castle::Review.retrieve`
294
+
295
+ **Features:**
296
+
297
+ - [#32](https://github.com/castle/castle-ruby/pull/32) added helper for generating signature
298
+ - [#27](https://github.com/castle/castle-ruby/pull/27) added whitelisted and blacklisted to configuration (with defaults)
299
+ - [#41](https://github.com/castle/castle-ruby/pull/41) added Hanami helpers
300
+ - [#42](https://github.com/castle/castle-ruby/pull/42) added possibility to set do_not_track flag in `Castle::Client` options
301
+ - [#48](https://github.com/castle/castle-ruby/pull/48) added failover strategies for `authenticate` method
302
+
303
+ ## 2.3.2
304
+
305
+ **Bug fixes:**
306
+
307
+ - fix for outdated Gemfile.lock
308
+
309
+ ## 2.3.0
310
+
311
+ **Features:**
312
+
313
+ - extract `client_id` from `HTTP_X_CASTLE_CLIENT_ID` header when not found in cookies
314
+
315
+ **Enhancements:**
316
+
317
+ - repository cleanup
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2021 Castle
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.