lamby 3.0.3 → 3.1.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: 3f07a6126778a111a18346115f2084c62e44e4911317f7dca5c5facd7f7939dc
4
- data.tar.gz: e5490dcec93e2994f1334164bcde3b27b90d486879cf8e222a9ec4697df881d5
3
+ metadata.gz: dda7dd95836f667a326e727ba2ff18e97f96a080b8ff2be212c7102f8ee61441
4
+ data.tar.gz: 82ede794cb05a15feef3b64073ef3f9b642ce9a3aa6a8ab1508326902907c818
5
5
  SHA512:
6
- metadata.gz: 43c26ff51d13c5451f1e2db53f501f8ea8622894b93d6755fcca20a7cca037f65b23dc8bba19f7b85f34785a87b627090f394ac621d71ee57d6dbca9f79962ca
7
- data.tar.gz: 03f578c7b381bd91ff52ecca6ce17f65523a899c8333372cd6c32f937f23cafc12acb841de153c4eabc755c4babbd53aa09e832aa957698141401bcc39d4aaa3
6
+ metadata.gz: 42c3b2f302aad502ff382d19e663fb34092ff51890bd19d6b25504b55ebae3383b79814b2bcf9786eeb6f56225ea93aaeca142090f8ad97c472c6f96a59b7a72
7
+ data.tar.gz: 4257da43dbdbcbc48f8572b28a62820fca73bb80d2228ac7c06aa1e95032ab57e3a2710169a179d8c00225111810d5a61ed8720c19c43e005f824537c67d11a0
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  See this http://keepachangelog.com link for information on how we want this documented formatted.
6
6
 
7
+ ## v3.1.0
8
+
9
+ #### Added
10
+
11
+ - Add X-Request-Start header for New Relic with API Gateway.
12
+
7
13
  ## v3.0.3
8
14
 
9
15
  #### Fixed
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM lambci/lambda:build-ruby2.7
1
+ FROM public.ecr.aws/sam/build-ruby2.7:1.26.0
2
2
 
3
3
  # Asset Pipeline
4
4
  RUN curl -sL https://rpm.nodesource.com/setup_12.x | bash - && \
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lamby (3.0.3)
4
+ lamby (3.1.0)
5
5
  rack
6
6
 
7
7
  GEM
data/bin/bootstrap CHANGED
@@ -2,5 +2,4 @@
2
2
  set -e
3
3
 
4
4
  echo '== Building containers =='
5
- docker pull lambci/lambda:build-ruby2.7
6
5
  docker-compose build
data/lib/lamby/rack.rb CHANGED
@@ -6,6 +6,7 @@ module Lamby
6
6
  LAMBDA_EVENT = 'lambda.event'.freeze
7
7
  LAMBDA_CONTEXT = 'lambda.context'.freeze
8
8
  HTTP_X_REQUESTID = 'HTTP_X_REQUEST_ID'.freeze
9
+ HTTP_X_REQUEST_START = 'HTTP_X_REQUEST_START'.freeze
9
10
  HTTP_COOKIE = 'HTTP_COOKIE'.freeze
10
11
 
11
12
  class << self
@@ -54,6 +55,7 @@ module Lamby
54
55
  "HTTP_#{key.to_s.upcase.tr '-', '_'}"
55
56
  end.tap do |hdrs|
56
57
  hdrs[HTTP_X_REQUESTID] = request_id
58
+ hdrs[HTTP_X_REQUEST_START] = request_start if request_start
57
59
  end
58
60
  end
59
61
 
@@ -109,5 +111,10 @@ module Lamby
109
111
  context.aws_request_id
110
112
  end
111
113
 
114
+ def request_start
115
+ event.dig('requestContext', 'timeEpoch') ||
116
+ event.dig('requestContext', 'requestTimeEpoch')
117
+ end
118
+
112
119
  end
113
120
  end
data/lib/lamby/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lamby
2
- VERSION = '3.0.3'
2
+ VERSION = '3.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lamby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-30 00:00:00.000000000 Z
11
+ date: 2021-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack