lamby 3.0.1 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/Dockerfile +1 -1
- data/Gemfile.lock +1 -1
- data/bin/bootstrap +0 -1
- data/lib/lamby/logger.rb +2 -2
- data/lib/lamby/rack.rb +7 -0
- data/lib/lamby/runner.rb +5 -3
- data/lib/lamby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ce831b5763fdf703c2dee815561117aaa3f437655f6633de363f4464f123fd4
|
4
|
+
data.tar.gz: ea61014f1f2ce8ce009f2a1818578bb012309f568b5e3443cc1bbc6bf5b50ab6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0a13fbb2a30b8970900275554df0b915a32f93352e4596df9c202dcb307bcbb1a45fc5afe7cc755306003e7e5633fcb38de119a7a35355f20a3db05adc90e5d
|
7
|
+
data.tar.gz: 1455fbdcddc869a920f2f65a3a0d6df5c536d2fa4e1136cb8cf0e46733b33b35012b01dc93c5c15b026d5ad1fee59c0a9e4bacb08673e1f7338044542432a580
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,30 @@
|
|
4
4
|
|
5
5
|
See this http://keepachangelog.com link for information on how we want this documented formatted.
|
6
6
|
|
7
|
+
## v3.1.1
|
8
|
+
|
9
|
+
#### Fixed
|
10
|
+
|
11
|
+
- X-Request-Start header value for New Relic with API Gateway.
|
12
|
+
|
13
|
+
## v3.1.0
|
14
|
+
|
15
|
+
#### Added
|
16
|
+
|
17
|
+
- Add X-Request-Start header for New Relic with API Gateway.
|
18
|
+
|
19
|
+
## v3.0.3
|
20
|
+
|
21
|
+
#### Fixed
|
22
|
+
|
23
|
+
- Ruby 2.7 Warnings | Logger. Thanks @jessedoyle
|
24
|
+
|
25
|
+
## v3.0.2
|
26
|
+
|
27
|
+
#### Added
|
28
|
+
|
29
|
+
- Runner now returns STDOUT/STDERR as body.
|
30
|
+
|
7
31
|
## v3.0.1
|
8
32
|
|
9
33
|
#### Fixed
|
data/Dockerfile
CHANGED
data/Gemfile.lock
CHANGED
data/bin/bootstrap
CHANGED
data/lib/lamby/logger.rb
CHANGED
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] = "t=#{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/runner.rb
CHANGED
@@ -23,16 +23,18 @@ module Lamby
|
|
23
23
|
|
24
24
|
def initialize(event)
|
25
25
|
@event = event
|
26
|
+
@body = ''
|
26
27
|
end
|
27
28
|
|
28
29
|
def call
|
29
30
|
validate!
|
30
31
|
status = Open3.popen3(command, chdir: chdir) do |_stdin, stdout, stderr, thread|
|
31
|
-
|
32
|
-
|
32
|
+
@body << stdout.read
|
33
|
+
@body << stderr.read
|
34
|
+
puts @body
|
33
35
|
thread.value.exitstatus
|
34
36
|
end
|
35
|
-
[status, {}, StringIO.new(
|
37
|
+
[status, {}, StringIO.new(@body)]
|
36
38
|
end
|
37
39
|
|
38
40
|
def command
|
data/lib/lamby/version.rb
CHANGED
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.
|
4
|
+
version: 3.1.1
|
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-
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|