castle-rb 8.1.0 → 9.1.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 (144) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +339 -0
  3. data/LICENSE +21 -0
  4. data/README.md +290 -112
  5. data/lib/castle/api/events/group.rb +22 -0
  6. data/lib/castle/api/events/query.rb +22 -0
  7. data/lib/castle/api/events/schema.rb +22 -0
  8. data/lib/castle/api/filter.rb +3 -1
  9. data/lib/castle/api/list_items/create_batch.rb +22 -0
  10. data/lib/castle/api/lists/create.rb +1 -1
  11. data/lib/castle/api/log.rb +2 -1
  12. data/lib/castle/api/privacy/delete_data.rb +23 -0
  13. data/lib/castle/api/privacy/request_data.rb +23 -0
  14. data/lib/castle/api/risk.rb +2 -1
  15. data/lib/castle/client.rb +13 -52
  16. data/lib/castle/client_actions/events.rb +23 -0
  17. data/lib/castle/client_actions/list_items.rb +7 -2
  18. data/lib/castle/client_actions/privacy.rb +20 -0
  19. data/lib/castle/commands/events/group.rb +21 -0
  20. data/lib/castle/commands/events/query.rb +21 -0
  21. data/lib/castle/commands/events/schema.rb +18 -0
  22. data/lib/castle/commands/list_items/create_batch.rb +22 -0
  23. data/lib/castle/commands/privacy/delete_data.rb +20 -0
  24. data/lib/castle/commands/privacy/request_data.rb +20 -0
  25. data/lib/castle/core/get_connection.rb +6 -4
  26. data/lib/castle/core/process_response.rb +1 -0
  27. data/lib/castle/core/process_webhook.rb +1 -1
  28. data/lib/castle/core/send_request.rb +2 -1
  29. data/lib/castle/errors.rb +1 -5
  30. data/lib/castle/headers/filter.rb +1 -1
  31. data/lib/castle/session.rb +0 -2
  32. data/lib/castle/version.rb +1 -1
  33. data/lib/castle.rb +15 -18
  34. metadata +41 -219
  35. data/lib/castle/api/approve_device.rb +0 -20
  36. data/lib/castle/api/authenticate.rb +0 -28
  37. data/lib/castle/api/end_impersonation.rb +0 -22
  38. data/lib/castle/api/get_device.rb +0 -20
  39. data/lib/castle/api/get_devices_for_user.rb +0 -20
  40. data/lib/castle/api/report_device.rb +0 -20
  41. data/lib/castle/api/start_impersonation.rb +0 -22
  42. data/lib/castle/api/track.rb +0 -19
  43. data/lib/castle/commands/approve_device.rb +0 -17
  44. data/lib/castle/commands/authenticate.rb +0 -23
  45. data/lib/castle/commands/end_impersonation.rb +0 -25
  46. data/lib/castle/commands/get_device.rb +0 -17
  47. data/lib/castle/commands/get_devices_for_user.rb +0 -17
  48. data/lib/castle/commands/report_device.rb +0 -17
  49. data/lib/castle/commands/start_impersonation.rb +0 -25
  50. data/lib/castle/commands/track.rb +0 -22
  51. data/lib/castle/support/hanami.rb +0 -15
  52. data/lib/castle/support/padrino.rb +0 -19
  53. data/lib/castle/validators/not_supported.rb +0 -18
  54. data/spec/integration/rails/rails_spec.rb +0 -95
  55. data/spec/integration/rails/support/all.rb +0 -6
  56. data/spec/integration/rails/support/application.rb +0 -17
  57. data/spec/integration/rails/support/home_controller.rb +0 -39
  58. data/spec/lib/castle/api/approve_device_spec.rb +0 -17
  59. data/spec/lib/castle/api/authenticate_spec.rb +0 -133
  60. data/spec/lib/castle/api/end_impersonation_spec.rb +0 -59
  61. data/spec/lib/castle/api/filter_spec.rb +0 -5
  62. data/spec/lib/castle/api/get_device_spec.rb +0 -17
  63. data/spec/lib/castle/api/get_devices_for_user_spec.rb +0 -17
  64. data/spec/lib/castle/api/list_items/archive_spec.rb +0 -18
  65. data/spec/lib/castle/api/list_items/count_spec.rb +0 -21
  66. data/spec/lib/castle/api/list_items/create_spec.rb +0 -22
  67. data/spec/lib/castle/api/list_items/get_spec.rb +0 -18
  68. data/spec/lib/castle/api/list_items/query_spec.rb +0 -21
  69. data/spec/lib/castle/api/list_items/unarchive_spec.rb +0 -18
  70. data/spec/lib/castle/api/list_items/update_spec.rb +0 -22
  71. data/spec/lib/castle/api/lists/create_spec.rb +0 -21
  72. data/spec/lib/castle/api/lists/delete_spec.rb +0 -17
  73. data/spec/lib/castle/api/lists/get_all_spec.rb +0 -17
  74. data/spec/lib/castle/api/lists/get_spec.rb +0 -17
  75. data/spec/lib/castle/api/lists/query_spec.rb +0 -21
  76. data/spec/lib/castle/api/lists/update_spec.rb +0 -21
  77. data/spec/lib/castle/api/log_spec.rb +0 -5
  78. data/spec/lib/castle/api/report_device_spec.rb +0 -17
  79. data/spec/lib/castle/api/risk_spec.rb +0 -5
  80. data/spec/lib/castle/api/start_impersonation_spec.rb +0 -59
  81. data/spec/lib/castle/api/track_spec.rb +0 -65
  82. data/spec/lib/castle/api_spec.rb +0 -36
  83. data/spec/lib/castle/client_id/extract_spec.rb +0 -47
  84. data/spec/lib/castle/client_spec.rb +0 -342
  85. data/spec/lib/castle/command_spec.rb +0 -9
  86. data/spec/lib/castle/commands/approve_device_spec.rb +0 -24
  87. data/spec/lib/castle/commands/authenticate_spec.rb +0 -86
  88. data/spec/lib/castle/commands/end_impersonation_spec.rb +0 -72
  89. data/spec/lib/castle/commands/filter_spec.rb +0 -72
  90. data/spec/lib/castle/commands/get_device_spec.rb +0 -24
  91. data/spec/lib/castle/commands/get_devices_for_user_spec.rb +0 -24
  92. data/spec/lib/castle/commands/list_items/archive_spec.rb +0 -21
  93. data/spec/lib/castle/commands/list_items/count_spec.rb +0 -21
  94. data/spec/lib/castle/commands/list_items/create_spec.rb +0 -22
  95. data/spec/lib/castle/commands/list_items/get_spec.rb +0 -21
  96. data/spec/lib/castle/commands/list_items/query_spec.rb +0 -27
  97. data/spec/lib/castle/commands/list_items/unarchive_spec.rb +0 -21
  98. data/spec/lib/castle/commands/list_items/update_spec.rb +0 -21
  99. data/spec/lib/castle/commands/lists/create_spec.rb +0 -33
  100. data/spec/lib/castle/commands/lists/delete_spec.rb +0 -21
  101. data/spec/lib/castle/commands/lists/get_all_spec.rb +0 -11
  102. data/spec/lib/castle/commands/lists/get_spec.rb +0 -21
  103. data/spec/lib/castle/commands/lists/query_spec.rb +0 -27
  104. data/spec/lib/castle/commands/lists/update_spec.rb +0 -29
  105. data/spec/lib/castle/commands/log_spec.rb +0 -73
  106. data/spec/lib/castle/commands/report_device_spec.rb +0 -24
  107. data/spec/lib/castle/commands/risk_spec.rb +0 -73
  108. data/spec/lib/castle/commands/start_impersonation_spec.rb +0 -72
  109. data/spec/lib/castle/commands/track_spec.rb +0 -89
  110. data/spec/lib/castle/configuration_spec.rb +0 -14
  111. data/spec/lib/castle/context/get_default_spec.rb +0 -41
  112. data/spec/lib/castle/context/merge_spec.rb +0 -23
  113. data/spec/lib/castle/context/prepare_spec.rb +0 -42
  114. data/spec/lib/castle/context/sanitize_spec.rb +0 -27
  115. data/spec/lib/castle/core/get_connection_spec.rb +0 -43
  116. data/spec/lib/castle/core/process_response_spec.rb +0 -103
  117. data/spec/lib/castle/core/process_webhook_spec.rb +0 -52
  118. data/spec/lib/castle/core/send_request_spec.rb +0 -97
  119. data/spec/lib/castle/failover/strategy_spec.rb +0 -12
  120. data/spec/lib/castle/headers/extract_spec.rb +0 -103
  121. data/spec/lib/castle/headers/filter_spec.rb +0 -42
  122. data/spec/lib/castle/headers/format_spec.rb +0 -25
  123. data/spec/lib/castle/ips/extract_spec.rb +0 -91
  124. data/spec/lib/castle/logger_spec.rb +0 -39
  125. data/spec/lib/castle/payload/prepare_spec.rb +0 -52
  126. data/spec/lib/castle/secure_mode_spec.rb +0 -7
  127. data/spec/lib/castle/session_spec.rb +0 -61
  128. data/spec/lib/castle/singleton_configuration_spec.rb +0 -14
  129. data/spec/lib/castle/utils/clean_invalid_chars_spec.rb +0 -69
  130. data/spec/lib/castle/utils/clone_spec.rb +0 -19
  131. data/spec/lib/castle/utils/deep_symbolize_keys_spec.rb +0 -50
  132. data/spec/lib/castle/utils/get_timestamp_spec.rb +0 -16
  133. data/spec/lib/castle/utils/merge_spec.rb +0 -13
  134. data/spec/lib/castle/validators/not_supported_spec.rb +0 -19
  135. data/spec/lib/castle/validators/present_spec.rb +0 -25
  136. data/spec/lib/castle/verdict_spec.rb +0 -9
  137. data/spec/lib/castle/version_spec.rb +0 -5
  138. data/spec/lib/castle/webhooks/verify_spec.rb +0 -59
  139. data/spec/lib/castle_spec.rb +0 -58
  140. data/spec/spec_helper.rb +0 -26
  141. data/spec/support/shared_examples/action_request.rb +0 -167
  142. data/spec/support/shared_examples/configuration.rb +0 -99
  143. data/spec/support/shared_examples/list_items.rb +0 -52
  144. 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: c138f51f6546b1a01b53f8542506e6e8566928d4b0907992d33dcb648788c9ee
4
+ data.tar.gz: d8f282e27ad75bad8e0d137b21ca15158ac3b6c3603f89098a3d77487cfa3658
5
5
  SHA512:
6
- metadata.gz: 5186002c86cef93deb33c8c03c95ffc81adaa7b59b032a06f2f81ff1423d0cd247d198e0a7fce2a15e2a1ab6a76a986c524644c4f4338be5a7e16ec45ba6cdca
7
- data.tar.gz: a9c63ce6293981630ed431471ceb0ffb70fe990b68784f70088dba28140a63e7ff012286604d8da9a79f5b93486ba4cb8e3318c93ee3617c29f6f981ef737d86
6
+ metadata.gz: 9b5c96cf024088766cd6cf1dad0b6c371dcfee03241ec695fc148c08d5bafd5658b4731514db4e8cf88ad430607cf26650077ce0db2ee9b95d56d62459b6a987
7
+ data.tar.gz: 054deed51da4427e2c715b2e5f63a646d8acc73125e64d30b5d3fa2fadbd42119baf536d2b83e31b158fb5423f0b18b7d0bda67613d0f1fbb360c59c8f4959e3
data/CHANGELOG.md ADDED
@@ -0,0 +1,339 @@
1
+ # Changelog
2
+
3
+ ## 9.1.0
4
+
5
+ **Enhancements:**
6
+
7
+ - Add Events API support (enterprise) — three new client methods for querying event data:
8
+ - `events_schema` — `GET /v1/events/schema`
9
+ - `query_events` — `POST /v1/events/query`
10
+ - `group_events` — `POST /v1/events/group`
11
+
12
+ **Housekeeping:**
13
+
14
+ - Remove unused `Castle::Validators::NotSupported` (dead code)
15
+ - Remove unused `Session::HTTPS_SCHEME` constant; inline the comparison in `GetConnection`
16
+ - Replace deprecated `:mingw, :x64_mingw` Bundler platforms with `:windows`
17
+ - Bump Bundler 2.6.9 → 2.7.2
18
+ - Bump json 2.19.5 → 2.19.7
19
+
20
+ ## master
21
+
22
+ - Bump dependencies (rack 3.1.19 → 3.2.6, rake, rspec-\*, timecop, simplecov-html, diff-lcs)
23
+ - Bump Ruby to 3.4.9 (zlib CVE-2026-27820)
24
+ - Bump Node.js to 24.16.0 in `.tool-versions`
25
+ - Repair `yarn format:check`: add `syntax_tree` to the dev group (required by `@prettier/plugin-ruby` 4.x), reformat 11 spec files, and disable rubocop cops that conflict with prettier-ruby (`Layout/SpaceInsideHashLiteralBraces`, `Style/EmptyMethod`)
26
+
27
+ ## 9.0.0
28
+
29
+ **BREAKING CHANGES:**
30
+
31
+ - Drop support for Ruby < 3.2
32
+ - Drop legacy API endpoints and the matching DSL on `Castle::Client`:
33
+ - `Castle::API::Track`, `Castle::Client#track`
34
+ - `Castle::API::Authenticate`, `Castle::Client#authenticate`
35
+ - Device endpoints: `Castle::API::ApproveDevice`, `Castle::API::GetDevice`, `Castle::API::GetDevicesForUser`, `Castle::API::ReportDevice`
36
+ - Impersonation endpoints: `Castle::API::StartImpersonation`, `Castle::API::EndImpersonation`, `Castle::Client#start_impersonation`, `Castle::Client#end_impersonation`
37
+ - Removed `Castle::ImpersonationFailed` error class
38
+ - Use `Castle::API::Risk`, `Castle::API::Filter`, `Castle::API::Log` (and the matching `Castle::Client#risk` / `#filter` / `#log` methods) instead.
39
+ - 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.
40
+
41
+ **Enhancements:**
42
+
43
+ - Add `Castle::API::ListItems::CreateBatch` (`POST /v1/lists/{list_id}/items/batch`) and `Castle::Client#create_batch_list_items`
44
+ - 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.
45
+ - 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
46
+ - Migrate CI from CircleCI to GitHub Actions (`specs.yml` and `lint.yml`); the dormant CircleCI integration and stale checkout key are removed
47
+ - Replace `appraisal` with hand-maintained `gemfiles/*.gemfile` (Rails 7.0, 7.1, 7.2, 8.0, 8.1)
48
+ - Switch from RVM-style `.ruby-gemset` to asdf-style `.tool-versions`
49
+ - Modernize `.rubocop.yml`: drop deprecated `prettier` inherit, target Ruby 3.2, add `rubocop-rake`
50
+ - Drop deprecated `coveralls_reborn`; rely on `simplecov` directly
51
+ - Drop `byebug` dev dependency in favor of stdlib `debug`
52
+ - Add gem metadata (`source_code_uri`, `changelog_uri`, `bug_tracker_uri`, `rubygems_mfa_required`)
53
+ - Drop the dormant Coditsu CI integration
54
+
55
+ **Bug fixes:**
56
+
57
+ - 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`.
58
+ - 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.
59
+ - 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.
60
+ - `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.
61
+
62
+ ## 8.1.0
63
+
64
+ - [#272](https://github.com/castle/castle-ruby/pull/272)
65
+ - Add support for Lists API
66
+
67
+ ## 8.0.0
68
+
69
+ - [#267](https://github.com/castle/castle-ruby/pull/267)
70
+ - fix issues with non-string values in headers
71
+
72
+ - [#262](https://github.com/castle/castle-ruby/pull/262)[#268](https://github.com/castle/castle-ruby/pull/268)
73
+ - add 429 RateLimitError
74
+
75
+ - Bump dependencies
76
+ - Add support for Rubies 3.1 and 3.2 and 3.3
77
+ - Add support Rails 7
78
+
79
+ **BREAKING CHANGES:**
80
+
81
+ - Drop support for Rubies < 2.7 and Rails < 6
82
+
83
+ ## 7.2.0
84
+
85
+ - [#253](https://github.com/castle/castle-ruby/pull/253)
86
+
87
+ - added InvalidRequestTokenError
88
+
89
+ - [#254](https://github.com/castle/castle-ruby/pull/254)
90
+ - remove X-Castle-\* headers from allowlist
91
+
92
+ ## 7.1.2
93
+
94
+ - [#247](https://github.com/castle/castle-ruby/pull/247)
95
+ - fixed issue with body as null
96
+
97
+ ## 7.1.1
98
+
99
+ - [#246](https://github.com/castle/castle-ruby/pull/246)
100
+ - support failover for risk and filter
101
+
102
+ ## 7.1.0 (2021-06-09)
103
+
104
+ - [#245](https://github.com/castle/castle-ruby/pull/245)
105
+ - removed not needed sdk based validations
106
+
107
+ ## 7.0.0 (2021-06-03)
108
+
109
+ **BREAKING CHANGES:**
110
+
111
+ - [#237](https://github.com/castle/castle-ruby/pull/237)
112
+ - remove `identify` and `review` commands - they are no longer supported
113
+ - remove `Castle::Events` - please use [recognized events](https://docs.castle.io/v1/reference/events/) instead
114
+
115
+ **Enhancements:**
116
+
117
+ - [#243](https://github.com/castle/castle-ruby/pull/243)
118
+ - add risk, filter and log endpoints
119
+ - [#242](https://github.com/castle/castle-ruby/pull/242)
120
+ - correct configuration used by the logger
121
+ - prevent unnecessary calls to the singleton configuration
122
+
123
+ ## 6.0.1 (2021-01-19)
124
+
125
+ **Enhancements:**
126
+
127
+ - [#234](https://github.com/castle/castle-ruby/pull/234) rename the namespace from `IP` to `IPs`
128
+
129
+ ## 6.0.0 (2021-01-19)
130
+
131
+ **BREAKING CHANGES:**
132
+
133
+ - [#228](https://github.com/castle/castle-ruby/pull/228) change the impersonation-related DSL
134
+ - [#213](https://github.com/castle/castle-ruby/pull/213) rename config.url to config.base_url
135
+ - [#214](https://github.com/castle/castle-ruby/pull/214) reorganize structure of the SDK, Castle::API::Session renamed to Castle::Session
136
+ - [#216](https://github.com/castle/castle-ruby/pull/216) add new context and payload builders, changed DSL
137
+
138
+ **Enhancements:**
139
+
140
+ - [#231](https://github.com/castle/castle-ruby/pull/231) allow to instantiate the configuration
141
+ - [#230](https://github.com/castle/castle-ruby/pull/230) add webhooks verification
142
+ - [#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
143
+ - [#221](https://github.com/castle/castle-ruby/pull/221), [#222](https://github.com/castle/castle-ruby/pull/222) add more tests
144
+ - [#220](https://github.com/castle/castle-ruby/pull/220) update the default timeout
145
+ - [#218](https://github.com/castle/castle-ruby/pull/218) add logger config option
146
+ - [#212](https://github.com/castle/castle-ruby/pull/212) drop origin from the default context
147
+
148
+ ## 5.0.0 (2020-09-29)
149
+
150
+ **BREAKING CHANGES:**
151
+
152
+ - [#207](https://github.com/castle/castle-ruby/pull/207) allow to reuse the connection (https://github.com/castle/castle-ruby#connection-reuse)
153
+ - [#204](https://github.com/castle/castle-ruby/pull/204) drop the configuration `host`, `port`, `url_prefix` options in favor of `url`
154
+ - [#203](https://github.com/castle/castle-ruby/pull/203) rename the `whitelist/blacklist` configuration option to `allowlist/denylist`
155
+
156
+ **Enhancements:**
157
+
158
+ - [#208](https://github.com/castle/castle-ruby/pull/208) bump the dependencies
159
+ - [#205](https://github.com/castle/castle-ruby/pull/205) extend DEFAULT_ALLOWLIST
160
+
161
+ ## 4.3.0 (2020-05-22)
162
+
163
+ - [#197](https://github.com/castle/castle-ruby/pull/197) add `trusted_proxy_depth` and `trust_proxy_chain` configuration options
164
+
165
+ ## 4.2.1 (2020-04-07)
166
+
167
+ - [#189](https://github.com/castle/castle-ruby/pull/189) added missing require
168
+
169
+ ## 4.2.0 (2020-03-31)
170
+
171
+ - [#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)
172
+
173
+ ## 4.1.0 (2020-03-27)
174
+
175
+ - [#184](https://github.com/castle/castle-ruby/pull/184) added Castle::API::Session which exposes Net:Http instance for reuse
176
+ - [#183](https://github.com/castle/castle-ruby/pull/183) change format of url_prefix config and renamed internal classes/variables
177
+
178
+ ## 4.0.0 (2020-03-19)
179
+
180
+ **BREAKING CHANGES:**
181
+
182
+ - [#178](https://github.com/castle/castle-ruby/pull/178) calculation of ip requires setup of ip_headers and trusted_proxies if needed
183
+ - [#180](https://github.com/castle/castle-ruby/pull/180) api key config overwrites env provided key
184
+ - [#175](https://github.com/castle/castle-ruby/pull/175) drop special handling of cf ip header (it has to provided by ip_headers config)
185
+
186
+ **Enhancements:**
187
+
188
+ - [#171](https://github.com/castle/castle-ruby/pull/171) test against Rails 5 and Rails 6
189
+
190
+ ## 3.6.2 (2020-04-24)
191
+
192
+ - [#192](https://github.com/castle/castle-ruby/pull/192) fixed problem with symbols in env
193
+
194
+ ## 3.6.1 (2020-01-16)
195
+
196
+ **Bug fixes**:
197
+
198
+ - [#168](https://github.com/castle/castle-ruby/pull/168) do not apply whitelisting by default
199
+
200
+ ## 3.6.0 (2020-01-07)
201
+
202
+ **BREAKING CHANGES:**
203
+
204
+ - [#165](https://github.com/castle/castle-ruby/pull/165) support ruby >= 2.4
205
+
206
+ **Enhancements:**
207
+
208
+ - [#163](https://github.com/castle/castle-ruby/pull/163) scrub headers instead of dropping them
209
+
210
+ ## 3.5.2 (2019-01-09)
211
+
212
+ **Enhancements:**
213
+
214
+ - [#131](https://github.com/castle/castle-ruby/pull/131) remove requirement for `user_id`
215
+
216
+ ## 3.5.1 (2018-10-27)
217
+
218
+ **Enhancements:**
219
+
220
+ - [#132](https://github.com/castle/castle-ruby/pull/132) refactor internal `Castle::API` and it's components
221
+
222
+ ## 3.5.0 (2018-04-18)
223
+
224
+ **BREAKING CHANGES:**
225
+
226
+ - [#119](https://github.com/castle/castle-ruby/pull/119) usage of `traits` key is deprecated, use `user_traits` instead
227
+
228
+ **Enhancements:**
229
+
230
+ - [#122](https://github.com/castle/castle-ruby/pull/122) `X-Castle-Client-Id` takes precedence over `cid` from `cookies`
231
+ - [#121](https://github.com/castle/castle-ruby/pull/121) raise Castle::ImpersonationFailed when impersonation request failed
232
+
233
+ ## 3.4.2 (2018-02-26)
234
+
235
+ **Features:**
236
+
237
+ - [#115](https://github.com/castle/castle-ruby/pull/114) added reset option to `impersonate`
238
+
239
+ ## 3.4.1 (2018-02-21)
240
+
241
+ - [#113](https://github.com/castle/castle-ruby/pull/113) support ruby >= 2.2.6
242
+
243
+ **Enhancements:**
244
+
245
+ - [#108](https://github.com/castle/castle-ruby/pull/108) move context and command validation to their own scope and classes, code cleanup
246
+
247
+ ## 3.4.0 (2018-01-27)
248
+
249
+ - [#101](https://github.com/castle/castle-ruby/pull/103) added `impersonate` method with `user_id`, `impersonator` and `context` options
250
+
251
+ ## 3.3.1 (2018-01-22)
252
+
253
+ **Enhancements:**
254
+
255
+ - [#100](https://github.com/castle/castle-ruby/pull/100) use request.remote_ip and CF connecting IP in favour of request.ip if present
256
+ - [#100](https://github.com/castle/castle-ruby/pull/100) added `X-Forwarded-For` and `CF_CONNECTING_IP` to whitelisted headers
257
+
258
+ ## 3.3.0 (2018-01-12)
259
+
260
+ **BREAKING CHANGES:**
261
+
262
+ - [#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
263
+
264
+ **Features:**
265
+
266
+ - [#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
267
+
268
+ ## 3.2.0 (2017-12-15)
269
+
270
+ **BREAKING CHANGES:**
271
+
272
+ - [#91](https://github.com/castle/castle-ruby/pull/91) symbolize keys for failover strategy
273
+
274
+ ## 3.1.0 (2017-12-11)
275
+
276
+ **Enhancements:**
277
+
278
+ - [#90](https://github.com/castle/castle-ruby/pull/90) added ability to extract context object and initialize client with that object
279
+
280
+ **BREAKING CHANGES:**
281
+
282
+ - `Castle::Client.new` does not not build context object anymore
283
+ - to use previous functionality use `Castle::Client.from_request`
284
+
285
+ **Features:**
286
+
287
+ - added `Castle::Client.to_context` method which allows to generate context object from the request
288
+
289
+ ## 3.0.1 (2017-11-20)
290
+
291
+ **Bug fixes:**
292
+
293
+ - [#84](https://github.com/castle/castle-ruby/pull/84) allow to use symbols for headers data
294
+
295
+ ## 3.0.0 (2017-10-18)
296
+
297
+ **Enhancements:**
298
+
299
+ - [#35](https://github.com/castle/castle-ruby/pull/35) dropped unused cookie store class, more informative Castle:Client constructor params
300
+ - [#30](https://github.com/castle/castle-ruby/pull/30) change request timeout to 500ms
301
+ - [#31](https://github.com/castle/castle-ruby/pull/31) remove auto-integration with Rails, Padrino, Sinatra (see BREAKING CHANGES, README)
302
+
303
+ **BREAKING CHANGES:**
304
+
305
+ - add `require 'castle/support/rails'` to have Castle client instance available as `castle` in your Rails controllers
306
+ - add `require 'castle/support/padrino'` to have Castle client instance available as `castle` in your Padrino helpers
307
+ - add `require 'castle/support/sinatra'` to have Castle client instance available as `castle` in your Sinatra helpers
308
+ - request timeout uses milliseconds unit from now on
309
+ - renamed `track!` to `enable_tracking`
310
+ - renamed `do_no_track!` to `disable_tracking`
311
+ - renamed `don_no_track?` to `tracked?` with opposite behaviour
312
+ - `Castle::Client.new` now takes options as a second argument
313
+ - drop support for ruby 2.1
314
+ - replaced `config.api_endpoint` with `config.host` and `config.port`
315
+ - renamed `fetch_review` to `Castle::Review.retrieve`
316
+
317
+ **Features:**
318
+
319
+ - [#32](https://github.com/castle/castle-ruby/pull/32) added helper for generating signature
320
+ - [#27](https://github.com/castle/castle-ruby/pull/27) added whitelisted and blacklisted to configuration (with defaults)
321
+ - [#41](https://github.com/castle/castle-ruby/pull/41) added Hanami helpers
322
+ - [#42](https://github.com/castle/castle-ruby/pull/42) added possibility to set do_not_track flag in `Castle::Client` options
323
+ - [#48](https://github.com/castle/castle-ruby/pull/48) added failover strategies for `authenticate` method
324
+
325
+ ## 2.3.2
326
+
327
+ **Bug fixes:**
328
+
329
+ - fix for outdated Gemfile.lock
330
+
331
+ ## 2.3.0
332
+
333
+ **Features:**
334
+
335
+ - extract `client_id` from `HTTP_X_CASTLE_CLIENT_ID` header when not found in cookies
336
+
337
+ **Enhancements:**
338
+
339
+ - 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.