sentry-ruby 4.1.0 → 4.1.5.pre.beta.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -7
- metadata +31 -59
- data/.craft.yml +0 -19
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.travis.yml +0 -6
- data/CHANGELOG.md +0 -89
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -16
- data/Rakefile +0 -8
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/sentry-ruby.rb +0 -141
- data/lib/sentry/background_worker.rb +0 -37
- data/lib/sentry/backtrace.rb +0 -128
- data/lib/sentry/benchmarks/benchmark_transport.rb +0 -14
- data/lib/sentry/breadcrumb.rb +0 -25
- data/lib/sentry/breadcrumb/sentry_logger.rb +0 -87
- data/lib/sentry/breadcrumb_buffer.rb +0 -47
- data/lib/sentry/client.rb +0 -86
- data/lib/sentry/configuration.rb +0 -399
- data/lib/sentry/core_ext/object/deep_dup.rb +0 -57
- data/lib/sentry/core_ext/object/duplicable.rb +0 -153
- data/lib/sentry/dsn.rb +0 -48
- data/lib/sentry/event.rb +0 -177
- data/lib/sentry/hub.rb +0 -137
- data/lib/sentry/interface.rb +0 -22
- data/lib/sentry/interfaces/exception.rb +0 -11
- data/lib/sentry/interfaces/request.rb +0 -74
- data/lib/sentry/interfaces/single_exception.rb +0 -14
- data/lib/sentry/interfaces/stacktrace.rb +0 -57
- data/lib/sentry/linecache.rb +0 -44
- data/lib/sentry/logger.rb +0 -20
- data/lib/sentry/rack.rb +0 -4
- data/lib/sentry/rack/capture_exceptions.rb +0 -54
- data/lib/sentry/rack/interface.rb +0 -22
- data/lib/sentry/rake.rb +0 -17
- data/lib/sentry/scope.rb +0 -214
- data/lib/sentry/span.rb +0 -132
- data/lib/sentry/transaction.rb +0 -157
- data/lib/sentry/transaction_event.rb +0 -29
- data/lib/sentry/transport.rb +0 -87
- data/lib/sentry/transport/configuration.rb +0 -21
- data/lib/sentry/transport/dummy_transport.rb +0 -14
- data/lib/sentry/transport/http_transport.rb +0 -62
- data/lib/sentry/utils/exception_cause_chain.rb +0 -20
- data/lib/sentry/utils/real_ip.rb +0 -70
- data/lib/sentry/utils/request_id.rb +0 -16
- data/lib/sentry/version.rb +0 -3
- data/sentry-ruby.gemspec +0 -27
@@ -1,20 +0,0 @@
|
|
1
|
-
module Sentry
|
2
|
-
module Utils
|
3
|
-
module ExceptionCauseChain
|
4
|
-
def self.exception_to_array(exception)
|
5
|
-
if exception.respond_to?(:cause) && exception.cause
|
6
|
-
exceptions = [exception]
|
7
|
-
while exception.cause
|
8
|
-
exception = exception.cause
|
9
|
-
break if exceptions.any? { |e| e.object_id == exception.object_id }
|
10
|
-
|
11
|
-
exceptions << exception
|
12
|
-
end
|
13
|
-
exceptions
|
14
|
-
else
|
15
|
-
[exception]
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
data/lib/sentry/utils/real_ip.rb
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
require 'ipaddr'
|
2
|
-
|
3
|
-
# Based on ActionDispatch::RemoteIp. All security-related precautions from that
|
4
|
-
# middleware have been removed, because the Event IP just needs to be accurate,
|
5
|
-
# and spoofing an IP here only makes data inaccurate, not insecure. Don't re-use
|
6
|
-
# this module if you have to *trust* the IP address.
|
7
|
-
module Sentry
|
8
|
-
module Utils
|
9
|
-
class RealIp
|
10
|
-
LOCAL_ADDRESSES = [
|
11
|
-
"127.0.0.1", # localhost IPv4
|
12
|
-
"::1", # localhost IPv6
|
13
|
-
"fc00::/7", # private IPv6 range fc00::/7
|
14
|
-
"10.0.0.0/8", # private IPv4 range 10.x.x.x
|
15
|
-
"172.16.0.0/12", # private IPv4 range 172.16.0.0 .. 172.31.255.255
|
16
|
-
"192.168.0.0/16" # private IPv4 range 192.168.x.x
|
17
|
-
].map { |proxy| IPAddr.new(proxy) }
|
18
|
-
|
19
|
-
attr_reader :ip
|
20
|
-
|
21
|
-
def initialize(
|
22
|
-
remote_addr: nil,
|
23
|
-
client_ip: nil,
|
24
|
-
real_ip: nil,
|
25
|
-
forwarded_for: nil
|
26
|
-
)
|
27
|
-
@remote_addr = remote_addr
|
28
|
-
@client_ip = client_ip
|
29
|
-
@real_ip = real_ip
|
30
|
-
@forwarded_for = forwarded_for
|
31
|
-
end
|
32
|
-
|
33
|
-
def calculate_ip
|
34
|
-
# CGI environment variable set by Rack
|
35
|
-
remote_addr = ips_from(@remote_addr).last
|
36
|
-
|
37
|
-
# Could be a CSV list and/or repeated headers that were concatenated.
|
38
|
-
client_ips = ips_from(@client_ip)
|
39
|
-
real_ips = ips_from(@real_ip)
|
40
|
-
forwarded_ips = ips_from(@forwarded_for)
|
41
|
-
|
42
|
-
ips = [client_ips, real_ips, forwarded_ips, remote_addr].flatten.compact
|
43
|
-
|
44
|
-
# If every single IP option is in the trusted list, just return REMOTE_ADDR
|
45
|
-
@ip = filter_local_addresses(ips).first || remote_addr
|
46
|
-
end
|
47
|
-
|
48
|
-
protected
|
49
|
-
|
50
|
-
def ips_from(header)
|
51
|
-
# Split the comma-separated list into an array of strings
|
52
|
-
ips = header ? header.strip.split(/[,\s]+/) : []
|
53
|
-
ips.select do |ip|
|
54
|
-
begin
|
55
|
-
# Only return IPs that are valid according to the IPAddr#new method
|
56
|
-
range = IPAddr.new(ip).to_range
|
57
|
-
# we want to make sure nobody is sneaking a netmask in
|
58
|
-
range.begin == range.end
|
59
|
-
rescue ArgumentError
|
60
|
-
nil
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def filter_local_addresses(ips)
|
66
|
-
ips.reject { |ip| LOCAL_ADDRESSES.any? { |proxy| proxy === ip } }
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Sentry
|
2
|
-
module Utils
|
3
|
-
module RequestId
|
4
|
-
REQUEST_ID_HEADERS = %w(action_dispatch.request_id HTTP_X_REQUEST_ID).freeze
|
5
|
-
|
6
|
-
# Request ID based on ActionDispatch::RequestId
|
7
|
-
def self.read_from(env_hash)
|
8
|
-
REQUEST_ID_HEADERS.each do |key|
|
9
|
-
request_id = env_hash[key]
|
10
|
-
return request_id if request_id
|
11
|
-
end
|
12
|
-
nil
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/lib/sentry/version.rb
DELETED
data/sentry-ruby.gemspec
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
require_relative "lib/sentry/version"
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = "sentry-ruby"
|
5
|
-
spec.version = Sentry::VERSION
|
6
|
-
spec.authors = ["Sentry Team"]
|
7
|
-
spec.description = spec.summary = "A gem that provides a client interface for the Sentry error logger"
|
8
|
-
spec.email = "accounts@sentry.io"
|
9
|
-
spec.license = 'Apache-2.0'
|
10
|
-
spec.homepage = "https://github.com/getsentry/raven-ruby"
|
11
|
-
|
12
|
-
spec.platform = Gem::Platform::RUBY
|
13
|
-
spec.required_ruby_version = '>= 2.4'
|
14
|
-
spec.extra_rdoc_files = ["README.md", "LICENSE.txt"]
|
15
|
-
spec.files = `git ls-files | grep -Ev '^(spec|benchmarks|examples)'`.split("\n")
|
16
|
-
|
17
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
-
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
-
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
20
|
-
|
21
|
-
spec.bindir = "exe"
|
22
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
-
spec.require_paths = ["lib"]
|
24
|
-
|
25
|
-
spec.add_dependency "faraday", ">= 1.0"
|
26
|
-
spec.add_dependency "concurrent-ruby"
|
27
|
-
end
|