Benign ruby 1,365 installs Download

apirelio-rails 0.1.1

“Automatic, fail-safe Apirelio request instrumentation for Rails API applications.”

Ruby Net::HTTP POST constructorReferences HTTP Content-Type application/json
SHA-2560d395676abf9201504d23522b1aa836e91987b6f03b83778f49581a4595f86d6
MaleculeH₂(CmOs)

Evidence

HTTP Bearer authorization header prefix http_batch_transport.rb · lines 25–43
25:5… def send(events)
26 return if events.empty?
27
28 request = Net::HTTP::Post.new(@uri)
29 request["Accept"] = "application/json"
30 request["Authorization"] = "Bearer #{@api_key}"
31 request["Content-Type"] = "application/json"
32 request["User-Agent"] = "apirelio-ruby/#{VERSION}"
33 request.body = JSON.generate(events: events)
34
35 attempts = 0
36 begin
37 response = Net::HTTP.start(@uri.host, @uri.port, use_ssl: @uri.scheme == "https", open_timeout: @timeout, read_timeout: @timeout) do |http|
38 http.request(request)
39 end
40 status = response.code.to_i
41 return if status.between?(200, 299)
42
43 error = IngestionE …
Source checks for HTTP 429 rate-limit response http_batch_transport.rb · lines 43–47
43:66… TTP #{status}.", status)
44 raise error if status < 500 && status != 429
45 raise error
46 rescue StandardError => error
47 if error.is_a?(IngestionError) && error.status < 500 && error.s …
HTTP URL string literal client.rb · lines 5–8
5:20… opped_count
6
7 def initialize(api_key:, service:, endpoint: "https://apirelio.com", environment: "production", release: nil,
8 enabled: true, batch_size: 100, f …
Creates a Ruby background thread client.rb · lines 26–34
26:41…
27 @closed = false
28 @dropped_count = 0
29 @worker = Thread.new { worker_loop }
30 @worker.name = "apirelio" if @worker.respond_to?(:name=)
31 end
32
33 def capture(context)
34 return f …
Ruby dynamically invokes a method with send client.rb · lines 65–72
65:4… return true if batch.empty?
66
67 begin
68 @transport.send(batch)
69 rescue StandardError
70 dropped_events = []
71 @mutex.synchronize do
72 …

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.