sqreen 1.21.0 → 1.23.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -0
  3. data/lib/sqreen/actions.rb +1 -1
  4. data/lib/sqreen/actions/actions_index.rb +5 -1
  5. data/lib/sqreen/actions/base.rb +1 -1
  6. data/lib/sqreen/actions/block_ip.rb +1 -1
  7. data/lib/sqreen/actions/block_user.rb +1 -1
  8. data/lib/sqreen/actions/ip_range_indexed_action_class.rb +1 -1
  9. data/lib/sqreen/actions/ip_ranges_index.rb +1 -1
  10. data/lib/sqreen/actions/redirect_ip.rb +1 -1
  11. data/lib/sqreen/actions/redirect_user.rb +1 -1
  12. data/lib/sqreen/actions/repository.rb +1 -1
  13. data/lib/sqreen/actions/unknown_action_type.rb +1 -1
  14. data/lib/sqreen/actions/user_action_class.rb +1 -1
  15. data/lib/sqreen/actions/users_index.rb +5 -1
  16. data/lib/sqreen/agent_message.rb +5 -0
  17. data/lib/sqreen/aggregated_metric.rb +5 -0
  18. data/lib/sqreen/attack_blocked.rb +1 -1
  19. data/lib/sqreen/binding_accessor.rb +1 -1
  20. data/lib/sqreen/binding_accessor/path_elem.rb +1 -1
  21. data/lib/sqreen/binding_accessor/transforms.rb +1 -1
  22. data/lib/sqreen/call_countable.rb +1 -1
  23. data/lib/sqreen/capped_queue.rb +1 -1
  24. data/lib/sqreen/cb.rb +1 -1
  25. data/lib/sqreen/condition_evaluator.rb +1 -1
  26. data/lib/sqreen/conditionable.rb +1 -1
  27. data/lib/sqreen/context.rb +1 -1
  28. data/lib/sqreen/default_cb.rb +1 -1
  29. data/lib/sqreen/deferred_logger.rb +1 -1
  30. data/lib/sqreen/deliveries.rb +1 -1
  31. data/lib/sqreen/deliveries/batch.rb +1 -1
  32. data/lib/sqreen/deliveries/simple.rb +1 -1
  33. data/lib/sqreen/dependency.rb +1 -1
  34. data/lib/sqreen/dependency/detector.rb +11 -3
  35. data/lib/sqreen/dependency/new_relic.rb +10 -1
  36. data/lib/sqreen/deprecation.rb +1 -1
  37. data/lib/sqreen/ecosystem.rb +5 -0
  38. data/lib/sqreen/ecosystem/databases/database_connection_data.rb +5 -0
  39. data/lib/sqreen/ecosystem/databases/mongo.rb +5 -0
  40. data/lib/sqreen/ecosystem/databases/mysql.rb +5 -0
  41. data/lib/sqreen/ecosystem/databases/postgres.rb +5 -0
  42. data/lib/sqreen/ecosystem/databases/redis.rb +5 -0
  43. data/lib/sqreen/ecosystem/dispatch_table.rb +5 -0
  44. data/lib/sqreen/ecosystem/exception_reporting.rb +5 -0
  45. data/lib/sqreen/ecosystem/http/net_http.rb +5 -0
  46. data/lib/sqreen/ecosystem/http/rack_request.rb +5 -0
  47. data/lib/sqreen/ecosystem/loggable.rb +5 -0
  48. data/lib/sqreen/ecosystem/messaging/bunny.rb +5 -0
  49. data/lib/sqreen/ecosystem/messaging/kafka.rb +5 -0
  50. data/lib/sqreen/ecosystem/messaging/kinesis.rb +5 -0
  51. data/lib/sqreen/ecosystem/messaging/sqs.rb +5 -0
  52. data/lib/sqreen/ecosystem/module_api.rb +5 -0
  53. data/lib/sqreen/ecosystem/module_api/event_listener.rb +5 -0
  54. data/lib/sqreen/ecosystem/module_api/instrumentation.rb +5 -0
  55. data/lib/sqreen/ecosystem/module_api/message_producer.rb +5 -0
  56. data/lib/sqreen/ecosystem/module_api/signal_producer.rb +5 -0
  57. data/lib/sqreen/ecosystem/module_api/tracing.rb +5 -0
  58. data/lib/sqreen/ecosystem/module_api/tracing/client_data.rb +5 -0
  59. data/lib/sqreen/ecosystem/module_api/tracing/consumer_data.rb +5 -0
  60. data/lib/sqreen/ecosystem/module_api/tracing/messaging_data.rb +5 -0
  61. data/lib/sqreen/ecosystem/module_api/tracing/producer_data.rb +5 -0
  62. data/lib/sqreen/ecosystem/module_api/tracing/server_data.rb +5 -0
  63. data/lib/sqreen/ecosystem/module_api/tracing_id_generation.rb +5 -0
  64. data/lib/sqreen/ecosystem/module_api/transaction_storage.rb +5 -0
  65. data/lib/sqreen/ecosystem/module_registry.rb +5 -0
  66. data/lib/sqreen/ecosystem/tracing/modules/client.rb +5 -0
  67. data/lib/sqreen/ecosystem/tracing/modules/consumer.rb +5 -0
  68. data/lib/sqreen/ecosystem/tracing/modules/determine_ip.rb +5 -0
  69. data/lib/sqreen/ecosystem/tracing/modules/producer.rb +5 -0
  70. data/lib/sqreen/ecosystem/tracing/modules/server.rb +5 -0
  71. data/lib/sqreen/ecosystem/tracing/sampler.rb +5 -0
  72. data/lib/sqreen/ecosystem/tracing/sampling_configuration.rb +5 -0
  73. data/lib/sqreen/ecosystem/tracing/signals/tracing_client.rb +5 -0
  74. data/lib/sqreen/ecosystem/tracing/signals/tracing_consumer.rb +5 -0
  75. data/lib/sqreen/ecosystem/tracing/signals/tracing_producer.rb +5 -0
  76. data/lib/sqreen/ecosystem/tracing/signals/tracing_server.rb +5 -0
  77. data/lib/sqreen/ecosystem/tracing_broker.rb +5 -0
  78. data/lib/sqreen/ecosystem/tracing_id_setup.rb +5 -0
  79. data/lib/sqreen/ecosystem/transaction_storage.rb +5 -0
  80. data/lib/sqreen/ecosystem/util/call_writers_from_init.rb +5 -0
  81. data/lib/sqreen/ecosystem_integration.rb +5 -0
  82. data/lib/sqreen/ecosystem_integration/around_callbacks.rb +5 -0
  83. data/lib/sqreen/ecosystem_integration/instrumentation_service.rb +5 -0
  84. data/lib/sqreen/ecosystem_integration/request_lifecycle_tracking.rb +5 -0
  85. data/lib/sqreen/ecosystem_integration/signal_consumption.rb +6 -8
  86. data/lib/sqreen/endpoint_testing.rb +5 -0
  87. data/lib/sqreen/error_handling_middleware.rb +1 -1
  88. data/lib/sqreen/event.rb +1 -1
  89. data/lib/sqreen/events/attack.rb +1 -1
  90. data/lib/sqreen/events/remote_exception.rb +1 -1
  91. data/lib/sqreen/events/request_record.rb +1 -1
  92. data/lib/sqreen/exception.rb +1 -1
  93. data/lib/sqreen/formatter_with_tid.rb +1 -1
  94. data/lib/sqreen/framework_cb.rb +1 -1
  95. data/lib/sqreen/frameworks/generic.rb +18 -0
  96. data/lib/sqreen/frameworks/sqreen_test.rb +1 -1
  97. data/lib/sqreen/graft.rb +1 -1
  98. data/lib/sqreen/graft/call.rb +1 -1
  99. data/lib/sqreen/graft/callback.rb +1 -1
  100. data/lib/sqreen/graft/hook.rb +8 -294
  101. data/lib/sqreen/graft/hook.ruby_2.rb +305 -0
  102. data/lib/sqreen/graft/hook.ruby_3.rb +305 -0
  103. data/lib/sqreen/graft/hook_point.rb +7 -7
  104. data/lib/sqreen/graft/hook_point.ruby_2.rb +18 -0
  105. data/lib/sqreen/graft/hook_point.ruby_3.rb +19 -0
  106. data/lib/sqreen/graft/hook_point_error.rb +1 -1
  107. data/lib/sqreen/invalid_signature_exception.rb +1 -1
  108. data/lib/sqreen/js.rb +1 -1
  109. data/lib/sqreen/js/call_context.rb +1 -1
  110. data/lib/sqreen/js/context_pool.rb +8 -6
  111. data/lib/sqreen/js/exec_js_runnable.rb +1 -1
  112. data/lib/sqreen/js/execjs_adapter.rb +1 -1
  113. data/lib/sqreen/js/executable_js.rb +1 -1
  114. data/lib/sqreen/js/js_service_adapter.rb +1 -1
  115. data/lib/sqreen/js/mini_racer_adapter.rb +2 -1
  116. data/lib/sqreen/js/mini_racer_executable_js.rb +2 -0
  117. data/lib/sqreen/js/thread_local_exec_js_runnable.rb +1 -1
  118. data/lib/sqreen/legacy.rb +1 -1
  119. data/lib/sqreen/log/loggable.rb +1 -1
  120. data/lib/sqreen/logger.rb +1 -1
  121. data/lib/sqreen/metrics.rb +1 -1
  122. data/lib/sqreen/metrics/average.rb +1 -1
  123. data/lib/sqreen/metrics/base.rb +1 -1
  124. data/lib/sqreen/metrics/binning.rb +1 -1
  125. data/lib/sqreen/metrics/collect.rb +1 -1
  126. data/lib/sqreen/metrics/sum.rb +1 -1
  127. data/lib/sqreen/metrics_store.rb +1 -1
  128. data/lib/sqreen/metrics_store/already_registered_metric.rb +1 -1
  129. data/lib/sqreen/metrics_store/unknown_metric.rb +1 -1
  130. data/lib/sqreen/metrics_store/unregistered_metric.rb +1 -1
  131. data/lib/sqreen/middleware.rb +1 -1
  132. data/lib/sqreen/node.rb +1 -1
  133. data/lib/sqreen/not_implemented_yet.rb +1 -1
  134. data/lib/sqreen/null_logger.rb +1 -1
  135. data/lib/sqreen/payload_creator/header_section.rb +1 -1
  136. data/lib/sqreen/performance_notifications.rb +1 -1
  137. data/lib/sqreen/performance_notifications/binned_metrics.rb +1 -1
  138. data/lib/sqreen/performance_notifications/log.rb +1 -1
  139. data/lib/sqreen/performance_notifications/log_performance.rb +1 -1
  140. data/lib/sqreen/performance_notifications/metrics.rb +1 -1
  141. data/lib/sqreen/prefix.rb +1 -1
  142. data/lib/sqreen/rails_middleware.rb +1 -1
  143. data/lib/sqreen/remote_command.rb +1 -1
  144. data/lib/sqreen/remote_command/failure_output.rb +1 -1
  145. data/lib/sqreen/rules/attrs.rb +1 -1
  146. data/lib/sqreen/rules/execjs_cb.rb +1 -0
  147. data/lib/sqreen/rules/run_user_actions.rb +1 -1
  148. data/lib/sqreen/run_when_called_cb.rb +1 -1
  149. data/lib/sqreen/safe_json.rb +1 -1
  150. data/lib/sqreen/sensitive_data_redactor.rb +2 -2
  151. data/lib/sqreen/serializer.rb +1 -1
  152. data/lib/sqreen/shared_storage.rb +1 -1
  153. data/lib/sqreen/shrink_wrap.rb +1 -1
  154. data/lib/sqreen/signals/conversions.rb +5 -0
  155. data/lib/sqreen/signals/http_trace_redaction.rb +5 -0
  156. data/lib/sqreen/signals/signals_submission_strategy.rb +5 -0
  157. data/lib/sqreen/signature_verifier.rb +1 -1
  158. data/lib/sqreen/sinatra_middleware.rb +1 -1
  159. data/lib/sqreen/sqreen_signed_verifier.rb +1 -1
  160. data/lib/sqreen/token_invalid_exception.rb +1 -1
  161. data/lib/sqreen/token_not_found_exception.rb +1 -1
  162. data/lib/sqreen/trie.rb +1 -1
  163. data/lib/sqreen/unauthorized.rb +1 -1
  164. data/lib/sqreen/util.rb +1 -1
  165. data/lib/sqreen/util/capped_array.rb +1 -1
  166. data/lib/sqreen/util/capped_hash.rb +1 -1
  167. data/lib/sqreen/util/capped_string.rb +1 -1
  168. data/lib/sqreen/util/capper.rb +1 -1
  169. data/lib/sqreen/version.rb +2 -2
  170. data/lib/sqreen/waf_error.rb +1 -1
  171. data/lib/sqreen/weave.rb +1 -1
  172. data/lib/sqreen/weave/budget.rb +1 -1
  173. data/lib/sqreen/weave/hardcoded.rb +1 -1
  174. data/lib/sqreen/weave/instrumentor.rb +1 -1
  175. data/lib/sqreen/weave/legacy.rb +1 -1
  176. data/lib/sqreen/weave/legacy/instrumentation.rb +112 -12
  177. data/lib/sqreen/web_server/generic.rb +1 -1
  178. data/lib/sqreen/web_server/webrick.rb +1 -1
  179. data/lib/sqreen/worker.rb +1 -1
  180. metadata +21 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acfd752e97a36e2f1f2d0cb224e72a409334d379a6e8c3e05b002bade311e097
4
- data.tar.gz: cb15f77dbc7e21faa5136a3cfc2493dd576164f2e49c532573c9f8adfa331e77
3
+ metadata.gz: a273f9a80bf30fbd4dcf8fc21551639e1c8df66b3dfa8be2d16e8ad5d58d4b47
4
+ data.tar.gz: cf2ff1d623cdae5a55ec39bc9959351775375836e5cf2ae71844bb7ee51b5ab6
5
5
  SHA512:
6
- metadata.gz: a4025d0a2500ff46db50b33eb7f3340065ae687f3e8d218a14ca3f2690ccecee4412b4901a4dcd93fd67a7fc0036ee025f4f4cf08a6d254101741ddaf4bbcf07
7
- data.tar.gz: 54755c74c6211c7aad3ae75aa8f2a5c307a074acef5ebf182ee31a5f50580a3115bd499be80d24cd5566ce16ef82c169f50ee9bed18531e7d0944e6864e7f610
6
+ metadata.gz: 68e69af0cb0d36971cea1ea58919372840faa792d620d99e7bc9e30c6afc39aa2aa564cf529a8f67bea8da79411c5d270df9e27a4db71e015461eba1c2d9f788
7
+ data.tar.gz: 14b82f5804bf6da658f44c3702ca8f877811cb0363f754703f2f7efa6440c0ffaa1a19e09c17c96f920e2855382041420069169bed8d7a77d1b4285d083af3ca
data/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## 1.23.1
2
+
3
+ * Improve compatibility with gems such as puma and graphql on Ruby 3.0
4
+
5
+ ## 1.23.0
6
+
7
+ * Implement GraphQL support
8
+
9
+ ## 1.22.1
10
+
11
+ * Fix excessive exception reporting, reducing CPU and network load
12
+ * Fix sensitive information attachment on pure tracing payloads
13
+ * Redact more sensitive fields by default
14
+ * Ensure preliminary compatibility with Ruby 3.0 previews
15
+ * Allow update to Sqreen MiniRacer 0.3.1
16
+
17
+ ## 1.22.0
18
+
19
+ * Update WAF via libsqreen
20
+ * Add support for raw body
21
+ * Improve signature check
22
+ * Improve APM detection
23
+
24
+ ## 1.21.1
25
+
26
+ * Work around NewRelic initialisation (see https://github.com/newrelic/newrelic-ruby-agent/issues/461)
27
+
1
28
  ## 1.21.0
2
29
 
3
30
  * Add support for transport and tracing facilities
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,8 @@
1
- # typed: true
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
2
6
  module Sqreen
3
7
  module Actions
4
8
  # documents the operations an actions index should implement
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,8 @@
1
- # typed: true
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
2
6
  require 'sqreen/actions/actions_index'
3
7
 
4
8
  module Sqreen
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'digest'
2
7
 
3
8
  module Sqreen
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'sqreen/rules/rule_cb'
2
7
  require 'sqreen/metrics/base'
3
8
 
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
data/lib/sqreen/cb.rb CHANGED
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: false
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: strong
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,4 +1,4 @@
1
- # typed: true
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -25,6 +25,14 @@ module Sqreen
25
25
  end
26
26
  end
27
27
 
28
+ def to_app_hook_strategy
29
+ if Sqreen::Dependency::NewRelic.bundled? || Sqreen::Dependency::NewRelic.required?
30
+ :chain
31
+ else
32
+ :prepend
33
+ end
34
+ end
35
+
28
36
  def hook(&block)
29
37
  Sqreen.log.debug "[#{Process.pid}] Startup command: #{$0}"
30
38
 
@@ -34,7 +42,7 @@ module Sqreen
34
42
  Sqreen::Dependency::Rails.insert_sqreen_middlewares
35
43
  end if Sqreen::Dependency::Rails.required?
36
44
 
37
- Sqreen::Graft::Hook.add('Rack::Builder#to_app') do
45
+ Sqreen::Graft::Hook.add('Rack::Builder#to_app', to_app_hook_strategy) do
38
46
  after do
39
47
  Sqreen::Dependency::Rails.inspect_middlewares
40
48
  end
@@ -48,7 +56,7 @@ module Sqreen
48
56
  end
49
57
  end.install if Sqreen::Dependency::Sinatra.required?
50
58
 
51
- Sqreen::Graft::Hook.add('Rack::Builder#to_app') do
59
+ Sqreen::Graft::Hook.add('Rack::Builder#to_app', to_app_hook_strategy) do
52
60
  after do |call|
53
61
  builder = call.instance
54
62
 
@@ -58,7 +66,7 @@ module Sqreen
58
66
 
59
67
  # ensure startup of thread in request handling processes
60
68
 
61
- Sqreen::Graft::Hook.add('Rack::Builder#to_app') do
69
+ Sqreen::Graft::Hook.add('Rack::Builder#to_app', to_app_hook_strategy) do
62
70
  after do |call|
63
71
  callback = call.callback
64
72
 
@@ -8,8 +8,17 @@ module Sqreen
8
8
  module NewRelic
9
9
  module_function
10
10
 
11
+ def bundled?
12
+ defined?(Gem) && Gem.respond_to?(:loaded_specs) && !Gem.loaded_specs['newrelic_rpm'].nil?
13
+ end
14
+
15
+ def required?
16
+ Sqreen::Dependency.const_exist?('NewRelic::Agent::Agent')
17
+ end
18
+
11
19
  def ignore_sqreen_exceptions
12
- return unless defined?(NewRelic::Agent::Agent)
20
+ return unless required?
21
+
13
22
  NewRelic::Agent::Agent.instance.error_collector.ignore(['Sqreen::AttackBlocked'])
14
23
  rescue ::Exception => e # rubocop:disable Lint/RescueException
15
24
  Sqreen.log.warn "Failed ignoring AttackBlocked on NewRelic: #{e.inspect}"
@@ -1,4 +1,4 @@
1
- # typed: strong
1
+ # typed: ignore
2
2
 
3
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'securerandom'
2
7
  require 'sqreen/ecosystem/module_registry'
3
8
  require 'sqreen/ecosystem/tracing/sampling_configuration'
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'sqreen/ecosystem/module_api/tracing/client_data'
2
7
 
3
8
  module Sqreen
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'sqreen/ecosystem/module_api'
2
7
  require 'sqreen/ecosystem/module_api/instrumentation'
3
8
  require 'sqreen/ecosystem/module_api/message_producer'
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'sqreen/ecosystem/module_api'
2
7
  require 'sqreen/ecosystem/module_api/instrumentation'
3
8
  require 'sqreen/ecosystem/module_api/message_producer'
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'sqreen/ecosystem/module_api'
2
7
  require 'sqreen/ecosystem/module_api/instrumentation'
3
8
  require 'sqreen/ecosystem/module_api/message_producer'
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'sqreen/ecosystem/module_api'
2
7
  require 'sqreen/ecosystem/module_api/instrumentation'
3
8
  require 'sqreen/ecosystem/module_api/message_producer'
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'logger'
2
7
 
3
8
  module Sqreen
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'sqreen/ecosystem/dispatch_table'
2
7
  require 'sqreen/ecosystem/loggable'
3
8
  require 'sqreen/kit/configuration'
@@ -1,3 +1,8 @@
1
+ # typed: ignore
2
+
3
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
4
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
+
1
6
  require 'sqreen/ecosystem/module_api'
2
7
  require 'sqreen/ecosystem/module_api/instrumentation'
3
8
  require 'sqreen/ecosystem/module_api/message_producer'