rack-request-tracker 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c26fe97fae42ee27e8ba04519475e0b2a6e6f7bde6e543dda4e29cf12b47da1e
4
- data.tar.gz: eeb5d4d28721899334493c1de863e768f988bd4999bc33805bfae21e32dca5ff
3
+ metadata.gz: d84dd1925da9acbe4403d97daedafc691e22261c58bdb92d0ad85097a9e23eb6
4
+ data.tar.gz: 0db9f1df0bbd03dda244e771cbaf0dacd309e1b2e5b87f5480b01f2bc4eba8e6
5
5
  SHA512:
6
- metadata.gz: 8c4f14fe1450d7f9c83c3caa534b55f46d8371d2f4143111c02d971557702b2cbbd848c2ab8e512828f0d3e716d5345999f46812d0e7b07210fa93f5f7d54661
7
- data.tar.gz: 7e0d4e70a0418058852b33be972fd29879fbde385490e24d2c331e9b523146ccc63383db646fe5fdf0791cd88df9ca9836ef5dc084438f23f546bc8a31a1e67c
6
+ metadata.gz: f1788c0fc6426b9f2c38e93ff2abdd7e95fe2a4f1a0b1f8ae0bcf13171c787057d09269edc5d6b7927b05d2e9e8e5e42ba68d600808767dd0f7b0244bddd609f
7
+ data.tar.gz: 79c91a1dab8e2a33f7a4175f2b9e546fa97e19f7a9e69368c989896225b9971c7f9b046c5b68090eac0dfb59de608311bd1174f2566e02657d4583fba06d55f3
@@ -2,7 +2,7 @@ require 'request_store'
2
2
  require 'mumukit/core'
3
3
 
4
4
  module Rack::RequestTracker
5
- LOG_TAGS = %i(request_id forwarded_for request_uid)
5
+ LOG_TAGS = %i(request_id forwarded_for request_uid organization)
6
6
 
7
7
  class << self
8
8
  def transaction_headers
@@ -16,8 +16,7 @@ module Rack::RequestTracker
16
16
 
17
17
  def compute_tags
18
18
  LOG_TAGS
19
- .map { |it| send it }
20
- .compact
19
+ .map { |it| send(it) || 'tracker-tag-absent' }
21
20
  .join(', ')
22
21
  end
23
22
 
@@ -6,9 +6,11 @@ module Rack::RequestTracker::Middleware
6
6
 
7
7
  def call(env)
8
8
  request = ActionDispatch::Request.new(env)
9
+
9
10
  Rack::RequestTracker.request_id = request.request_id
10
11
  Rack::RequestTracker.forwarded_for = first_forward(request.x_forwarded_for) || request.remote_ip
11
12
  Rack::RequestTracker.request_uid = request.headers['X-REQUEST-UID']
13
+ Rack::RequestTracker.organization = request.headers['X-ORGANIZATION']
12
14
 
13
15
  @app.call(env)
14
16
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module RequestTracker
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-request-tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julián Berbel Alt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-07-22 00:00:00.000000000 Z
12
+ date: 2020-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  requirements: []
132
- rubygems_version: 3.0.2
132
+ rubygems_version: 3.0.8
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Bunch of patches and rack middlewares to allow for transactional logs