lamby 3.0.0 → 3.1.0
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 +4 -0
- data/Gemfile.lock +10 -1
- data/bin/bootstrap +0 -1
- data/lib/lamby/handler.rb +1 -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: dda7dd95836f667a326e727ba2ff18e97f96a080b8ff2be212c7102f8ee61441
|
4
|
+
data.tar.gz: 82ede794cb05a15feef3b64073ef3f9b642ce9a3aa6a8ab1508326902907c818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42c3b2f302aad502ff382d19e663fb34092ff51890bd19d6b25504b55ebae3383b79814b2bcf9786eeb6f56225ea93aaeca142090f8ad97c472c6f96a59b7a72
|
7
|
+
data.tar.gz: 4257da43dbdbcbc48f8572b28a62820fca73bb80d2228ac7c06aa1e95032ab57e3a2710169a179d8c00225111810d5a61ed8720c19c43e005f824537c67d11a0
|
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.0
|
8
|
+
|
9
|
+
#### Added
|
10
|
+
|
11
|
+
- Add X-Request-Start header for New Relic with API Gateway.
|
12
|
+
|
13
|
+
## v3.0.3
|
14
|
+
|
15
|
+
#### Fixed
|
16
|
+
|
17
|
+
- Ruby 2.7 Warnings | Logger. Thanks @jessedoyle
|
18
|
+
|
19
|
+
## v3.0.2
|
20
|
+
|
21
|
+
#### Added
|
22
|
+
|
23
|
+
- Runner now returns STDOUT/STDERR as body.
|
24
|
+
|
25
|
+
## v3.0.1
|
26
|
+
|
27
|
+
#### Fixed
|
28
|
+
|
29
|
+
- Fix Lambdakiq integration. Thanks #97.
|
30
|
+
|
7
31
|
## v3.0.0
|
8
32
|
|
9
33
|
#### Added
|
data/Dockerfile
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lamby (3.
|
4
|
+
lamby (3.1.0)
|
5
5
|
rack
|
6
6
|
|
7
7
|
GEM
|
@@ -73,6 +73,9 @@ GEM
|
|
73
73
|
aws-partitions (~> 1, >= 1.239.0)
|
74
74
|
aws-sigv4 (~> 1.1)
|
75
75
|
jmespath (~> 1.0)
|
76
|
+
aws-sdk-sqs (1.38.0)
|
77
|
+
aws-sdk-core (~> 3, >= 3.112.0)
|
78
|
+
aws-sigv4 (~> 1.1)
|
76
79
|
aws-sdk-ssm (1.108.0)
|
77
80
|
aws-sdk-core (~> 3, >= 3.112.0)
|
78
81
|
aws-sigv4 (~> 1.1)
|
@@ -88,6 +91,11 @@ GEM
|
|
88
91
|
i18n (1.8.10)
|
89
92
|
concurrent-ruby (~> 1.0)
|
90
93
|
jmespath (1.4.0)
|
94
|
+
lambdakiq (1.0.1)
|
95
|
+
activejob
|
96
|
+
aws-sdk-sqs
|
97
|
+
concurrent-ruby
|
98
|
+
railties
|
91
99
|
loofah (2.9.1)
|
92
100
|
crass (~> 1.0.2)
|
93
101
|
nokogiri (>= 1.5.9)
|
@@ -160,6 +168,7 @@ PLATFORMS
|
|
160
168
|
DEPENDENCIES
|
161
169
|
aws-sdk-ssm
|
162
170
|
bundler
|
171
|
+
lambdakiq
|
163
172
|
lamby!
|
164
173
|
minitest
|
165
174
|
minitest-focus
|
data/bin/bootstrap
CHANGED
data/lib/lamby/handler.rb
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] = 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.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-
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|