sqreen 1.1.51482852304-java → 1.2.01484936161-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sqreen/frameworks/generic.rb +9 -2
- data/lib/sqreen/remote_command.rb +1 -0
- data/lib/sqreen/runner.rb +9 -3
- data/lib/sqreen/sdk.rb +3 -0
- data/lib/sqreen/session.rb +1 -1
- data/lib/sqreen/version.rb +1 -1
- data/lib/sqreen.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8559930eac7fb625c2b63984d509da6c3446b0f9
|
4
|
+
data.tar.gz: 12a76e3a8d5b276d735fe3eb0aee2dcf7cd73302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2f1839f881a0245846c553266e5fe7507252c6fdeb3392bcb23ba89a9fe6b40858b8baa81b5e7bc24b184579669f92365f1b1f9ac8c0244786b4a35c5e94786
|
7
|
+
data.tar.gz: 4989ab7ada1beeceba50adbb8ce9e91dc258263e6b39cc1edba3d752da32f75136184af9c0be11ccc25b41d8465db3df40dedaaad7b5592781477ed4f39e9f0a
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# Copyright (c) 2015 Sqreen. All Rights Reserved.
|
2
2
|
# Please refer to our terms for more information: https://www.sqreen.io/terms.html
|
3
|
+
require 'ipaddr'
|
3
4
|
|
4
5
|
require 'sqreen/events/remote_exception'
|
5
6
|
require 'sqreen/callbacks'
|
@@ -20,7 +21,6 @@ module Sqreen
|
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
23
|
-
|
24
24
|
# What kind of database is this
|
25
25
|
def db_settings(_options = {})
|
26
26
|
raise Sqreen::NotImplementedYet
|
@@ -67,7 +67,7 @@ module Sqreen
|
|
67
67
|
return nil unless req
|
68
68
|
forwarded = req.env['HTTP_X_FORWARDED_FOR']
|
69
69
|
ips = split_ip_addresses(forwarded)
|
70
|
-
last = ips.
|
70
|
+
last = ips.find { |ip| (ip !~ TRUSTED_PROXIES) && valid_ip?(ip) }
|
71
71
|
return last unless last.nil?
|
72
72
|
req.env['REMOTE_ADDR']
|
73
73
|
end
|
@@ -321,6 +321,13 @@ module Sqreen
|
|
321
321
|
def split_ip_addresses(ip_addresses)
|
322
322
|
ip_addresses ? ip_addresses.strip.split(/[,\s]+/) : []
|
323
323
|
end
|
324
|
+
|
325
|
+
def valid_ip?(ip)
|
326
|
+
IPAddr.new(ip)
|
327
|
+
true
|
328
|
+
rescue
|
329
|
+
false
|
330
|
+
end
|
324
331
|
end
|
325
332
|
end
|
326
333
|
end
|
data/lib/sqreen/runner.rb
CHANGED
@@ -62,6 +62,7 @@ module Sqreen
|
|
62
62
|
attr_reader :deliverer
|
63
63
|
attr_reader :session
|
64
64
|
attr_reader :instrumenter
|
65
|
+
attr_accessor :running
|
65
66
|
attr_accessor :next_command_results
|
66
67
|
attr_accessor :next_metrics
|
67
68
|
|
@@ -76,6 +77,7 @@ module Sqreen
|
|
76
77
|
@last_heartbeat_request = Time.now
|
77
78
|
@next_command_results = {}
|
78
79
|
@next_metrics = []
|
80
|
+
@running = true
|
79
81
|
|
80
82
|
@token = @configuration.get(:token)
|
81
83
|
@url = @configuration.get(:url)
|
@@ -285,9 +287,7 @@ module Sqreen
|
|
285
287
|
end
|
286
288
|
|
287
289
|
def run_watcher
|
288
|
-
|
289
|
-
run_watcher_once
|
290
|
-
end
|
290
|
+
run_watcher_once while running
|
291
291
|
end
|
292
292
|
|
293
293
|
# Sinatra is using at_exit to run the application, see:
|
@@ -298,6 +298,11 @@ module Sqreen
|
|
298
298
|
!Sinatra::Application.run?
|
299
299
|
end
|
300
300
|
|
301
|
+
def shutdown(_context_infos={})
|
302
|
+
remove_instrumentation
|
303
|
+
logout
|
304
|
+
end
|
305
|
+
|
301
306
|
def logout(retrying = true)
|
302
307
|
return unless session
|
303
308
|
if @logged_out_tried
|
@@ -309,6 +314,7 @@ module Sqreen
|
|
309
314
|
aggregate_observations
|
310
315
|
session.post_metrics(metrics_engine.publish) if metrics_engine
|
311
316
|
session.logout(retrying)
|
317
|
+
@running = false
|
312
318
|
end
|
313
319
|
|
314
320
|
def register_exit_cb(try_again = true)
|
data/lib/sqreen/sdk.rb
CHANGED
data/lib/sqreen/session.rb
CHANGED
data/lib/sqreen/version.rb
CHANGED
data/lib/sqreen.rb
CHANGED
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.
|
4
|
+
version: 1.2.01484936161
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Sqreen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|