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
@@ -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/weave.rb CHANGED
@@ -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: 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: 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: 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
@@ -96,25 +96,97 @@ class Sqreen::Weave::Legacy::Instrumentation
96
96
  def instrument!(rules, framework)
97
97
  Sqreen::Weave.logger.debug { "#{rules.count} rules, #{framework}" }
98
98
 
99
+ # TODO: make config able to see if value was user-set or default
99
100
  strategy = Sqreen.config_get(:weave_strategy)
101
+ # TODO: factor generic hint system out
102
+ # TODO: factor those hint definitions to dependency
103
+ strategy_hints = []
100
104
  if strategy == :prepend && !Module.respond_to?(:prepend)
101
- Sqreen::Weave.logger.warn { "strategy: #{strategy.inspect} unavailable, falling back to :chain" }
102
- strategy = :chain
103
- elsif strategy == :chain && Gem::Specification.select { |s| s.name == 'scout_apm' && Gem::Requirement.new('>= 2.5.2').satisfied_by?(Gem::Version.new(s.version)) }.any?
104
- Sqreen::Weave.logger.warn { "strategy: #{strategy.inspect} unavailable with scout_apm >= 2.5.2, switching to :prepend" }
105
- strategy = :prepend
105
+ Sqreen::Weave.logger.debug { "strategy: #{strategy.inspect} unavailable, falling back to :chain" }
106
+ strategy_hints << [:chain, 'Module.respond_to?(:prepend)', 'false']
107
+ end
108
+ if Gem::Specification.select { |s| s.name == 'scout_apm' && Gem::Requirement.new('< 2.5.2').satisfied_by?(Gem::Version.new(s.version)) }.any?
109
+ Sqreen::Weave.logger.debug { "strategy: :prepend unavailable with scout_apm < 2.5.2, hinting at :chain" }
110
+ strategy_hints << [:chain, 'scout_apm', '< 2.5.2']
111
+ end
112
+ if Gem::Specification.select { |s| s.name == 'scout_apm' && Gem::Requirement.new('>= 2.5.2').satisfied_by?(Gem::Version.new(s.version)) }.any?
113
+ Sqreen::Weave.logger.debug { "strategy: :chain unavailable with scout_apm >= 2.5.2, hinting at :prepend" }
114
+ strategy_hints << [:prepend, 'scout_apm', '>= 2.5.2']
115
+ end
116
+ if Gem::Specification.select { |s| s.name == 'ddtrace' && Gem::Requirement.new('< 0.27').satisfied_by?(Gem::Version.new(s.version)) }.any?
117
+ Sqreen::Weave.logger.debug { "strategy: :prepend unavailable with ddtrace < 0.27, hinting at :chain" }
118
+ strategy_hints << [:chain, 'ddtrace', '< 0.27']
119
+ end
120
+ if Gem::Specification.select { |s| s.name == 'ddtrace' && Gem::Requirement.new('>= 0.27').satisfied_by?(Gem::Version.new(s.version)) }.any?
121
+ Sqreen::Weave.logger.debug { "strategy: :chain unavailable with ddtrace >= 0.27, hinting at :prepend" }
122
+ strategy_hints << [:prepend, 'ddtrace', '>= 0.27']
123
+ end
124
+ if Gem::Specification.select { |s| s.name == 'skylight' && Gem::Requirement.new('< 5.0.0.beta').satisfied_by?(Gem::Version.new(s.version)) }.any?
125
+ Sqreen::Weave.logger.debug { "strategy: :prepend unavailable with skylight < 5.0.0.beta, hinting at :chain" }
126
+ strategy_hints << [:chain, 'skylight', '< 5.0.0.beta']
127
+ end
128
+ if Gem::Specification.select { |s| s.name == 'skylight' && Gem::Requirement.new('>= 5.0.0.beta').satisfied_by?(Gem::Version.new(s.version)) }.any?
129
+ Sqreen::Weave.logger.debug { "strategy: :chain unavailable with skylight >= 5.0.0.beta, hinting at :prepend" }
130
+ strategy_hints << [:prepend, 'skylight', '>= 5.0.0.beta']
131
+ end
132
+ if Gem::Specification.select { |s| s.name == 'elastic-apm' && Gem::Requirement.new('< 4.0.a').satisfied_by?(Gem::Version.new(s.version)) }.any?
133
+ Sqreen::Weave.logger.debug { "strategy: :prepend unavailable with elastic-apm < 4.0, hinting at :chain" }
134
+ strategy_hints << [:chain, 'elastic-apm', '< 4.0.a']
135
+ end
136
+ if Gem::Specification.select { |s| s.name == 'elastic-apm' && Gem::Requirement.new('>= 4.0').satisfied_by?(Gem::Version.new(s.version)) }.any?
137
+ Sqreen::Weave.logger.debug { "strategy: :chain unavailable with elastic-apm >= 4.0, hinting at :prepend" }
138
+ strategy_hints << [:prepend, 'elastic-apm', '>= 4.0.a']
139
+ end
140
+ if Gem::Specification.select { |s| s.name == 'airbrake' && Gem::Requirement.new('>= 11.0.2').satisfied_by?(Gem::Version.new(s.version)) }.any?
141
+ Sqreen::Weave.logger.debug { "strategy: :chain unavailable with airbrake >= 11.0.2, hinting at :prepend" }
142
+ strategy_hints << [:prepend, 'airbrake', '>= 11.0.2']
143
+ end
144
+ if Gem::Specification.select { |s| s.name == 'newrelic_rpm' && Gem::Requirement.new('>= 6.14').satisfied_by?(Gem::Version.new(s.version)) }.any?
145
+ Sqreen::Weave.logger.debug { "strategy: :chain unavailable with newrelic_rpm >= 6.14, hinting at :prepend" }
146
+ strategy_hints << [:prepend, 'newrelic_rpm', '>= 6.14']
147
+ end
148
+ if Gem::Specification.select { |s| s.name =~ /^opentelemetry/ }.any?
149
+ Sqreen::Weave.logger.debug { "strategy: :chain unavailable with opentelemetry, hinting at :prepend" }
150
+ strategy_hints << [:prepend, 'opentelemetry']
151
+ end
152
+ if strategy_hints.map(&:first).uniq.count > 1
153
+ raise Sqreen::Exception, "conflicting instrumentation strategies: #{strategy_hints.inspect}"
154
+ end
155
+ if strategy_hints.map(&:first).uniq.count == 1 && strategy != strategy_hints.first.first
156
+ was = strategy
157
+ strategy = strategy_hints.first.first
158
+ Sqreen::Weave.logger.warn { "strategy: #{strategy.inspect} was: #{was.inspect} hints: #{strategy_hints.inspect}" }
159
+ else
160
+ Sqreen::Weave.logger.info { "strategy: #{strategy.inspect}" }
106
161
  end
107
- Sqreen::Weave.logger.debug { "strategy: #{strategy.inspect}" }
108
162
 
109
163
  ### set up rule signature verifier
110
164
  verifier = nil
111
- if Sqreen.features['rules_signature'] &&
112
- Sqreen.config_get(:rules_verify_signature) == true &&
113
- !defined?(::JRUBY_VERSION)
165
+ # TODO: check for JRuby via dependency
166
+ # TODO: reinstate signatures for JRuby
167
+ if Sqreen.config_get(:rules_verify_signature) == true && !defined?(::JRUBY_VERSION)
114
168
  verifier = Sqreen::SqreenSignedVerifier.new
115
- Sqreen::Weave.logger.debug('Rules signature enabled')
169
+ Sqreen::Weave.logger.debug('rules: signature status: enabled')
116
170
  else
117
- Sqreen::Weave.logger.debug('Rules signature disabled')
171
+ Sqreen::Weave.logger.debug('rules: signature status: disabled')
172
+ end
173
+
174
+ if verifier
175
+ invalid_rules = rules.reject do |rule|
176
+ valid = verifier.verify(rule)
177
+
178
+ if valid
179
+ Sqreen::Weave.logger.debug { "rule: #{rule['name']} signed: true result: ok" }
180
+ else
181
+ Sqreen::Weave.logger.error { "rule: #{rule['name']} singed: true result: fail" }
182
+ end
183
+ end
184
+ if invalid_rules.any?
185
+ Sqreen::Weave.logger.error { "weave: instrument status: abort reason: signature result: fail" }
186
+ raise Sqreen::Exception, "Signature error: rules: #{invalid_rules.map { |r| r['name'] }.inspect}"
187
+ else
188
+ Sqreen::Weave.logger.info { "weave: instrument rules: signed result: ok" }
189
+ end
118
190
  end
119
191
 
120
192
  ### force clean instrumentation callback list
@@ -158,6 +230,8 @@ class Sqreen::Weave::Legacy::Instrumentation
158
230
  @hooks << add_callback('weave,hardcoded', hard_callback, strategy)
159
231
  end
160
232
 
233
+ @hooks << install_graphql_hook
234
+
161
235
  metrics_engine = self.metrics_engine
162
236
 
163
237
  request_hook = Sqreen::Graft::Hook['Sqreen::ShrinkWrap#call', strategy]
@@ -494,4 +568,30 @@ class Sqreen::Weave::Legacy::Instrumentation
494
568
  Sqreen::Rules::RunUserActions.new(Sqreen, :auth_track, 1),
495
569
  ]
496
570
  end
571
+
572
+ def install_graphql_hook
573
+ hook = Sqreen::Graft::Hook['GraphQL::Execution::Multiplex.run_queries']
574
+
575
+ hook.add do
576
+ before('weave,test,graphql', mandatory: true) do |call|
577
+ find_args = proc do |*items|
578
+ args = []
579
+ items.each do |e|
580
+ args << e if e.is_a?(GraphQL::Language::Nodes::Argument)
581
+ args += find_args.call(*e.children)
582
+ end
583
+ args
584
+ end
585
+ queries = call.args[1]
586
+ qdocs = queries.map { |q| [q.query_string, q.document] }
587
+ qargs = qdocs.map do |q, doc|
588
+ next if doc.nil?
589
+ [q, find_args.call(*doc.children).map { |arg| { arg.name => arg.value } }.reduce(&:merge)]
590
+ end
591
+ Sqreen.framework.graphql_args = Hash[*qargs.flatten(1)]
592
+ end
593
+ end.install
594
+
595
+ hook
596
+ end
497
597
  end
@@ -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
data/lib/sqreen/worker.rb CHANGED
@@ -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
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqreen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.21.0
4
+ version: 1.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sqreen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-25 00:00:00.000000000 Z
11
+ date: 2021-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqreen-backport
@@ -44,28 +44,34 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.2.4.sqreen2
47
+ version: '0.2'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: 0.4.a
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - "~>"
53
56
  - !ruby/object:Gem::Version
54
- version: 0.2.4.sqreen2
57
+ version: '0.2'
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: 0.4.a
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: libsqreen
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: 0.6.1.0.0
67
+ version: '1.0'
62
68
  type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: 0.6.1.0.0
74
+ version: '1.0'
69
75
  description: Sqreen is a SaaS based Application protection and monitoring platform
70
76
  that integrates directly into your Ruby applications. Learn more at https://sqreen.com.
71
77
  email: contact@sqreen.com
@@ -192,7 +198,11 @@ files:
192
198
  - lib/sqreen/graft/call.rb
193
199
  - lib/sqreen/graft/callback.rb
194
200
  - lib/sqreen/graft/hook.rb
201
+ - lib/sqreen/graft/hook.ruby_2.rb
202
+ - lib/sqreen/graft/hook.ruby_3.rb
195
203
  - lib/sqreen/graft/hook_point.rb
204
+ - lib/sqreen/graft/hook_point.ruby_2.rb
205
+ - lib/sqreen/graft/hook_point.ruby_3.rb
196
206
  - lib/sqreen/graft/hook_point_error.rb
197
207
  - lib/sqreen/invalid_signature_exception.rb
198
208
  - lib/sqreen/js.rb
@@ -327,7 +337,7 @@ metadata:
327
337
  changelog_uri: https://docs.sqreen.com/ruby/release-notes/
328
338
  source_code_uri: https://github.com/sqreen/ruby-agent
329
339
  bug_tracker_uri: https://github.com/sqreen/ruby-agent/issues
330
- post_install_message:
340
+ post_install_message:
331
341
  rdoc_options: []
332
342
  require_paths:
333
343
  - lib
@@ -335,15 +345,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
335
345
  requirements:
336
346
  - - ">="
337
347
  - !ruby/object:Gem::Version
338
- version: 1.9.3
348
+ version: '2.0'
339
349
  required_rubygems_version: !ruby/object:Gem::Requirement
340
350
  requirements:
341
351
  - - ">="
342
352
  - !ruby/object:Gem::Version
343
353
  version: '0'
344
354
  requirements: []
345
- rubygems_version: 3.1.4
346
- signing_key:
355
+ rubygems_version: 3.2.3
356
+ signing_key:
347
357
  specification_version: 4
348
358
  summary: Sqreen Ruby agent
349
359
  test_files: []