apigatewayv2_rack 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -1
- data/lib/apigatewayv2_rack/version.rb +1 -1
- metadata +3 -16
- data/.rspec +0 -3
- data/Dockerfile.integration +0 -13
- data/Gemfile +0 -10
- data/Gemfile.lock +0 -40
- data/apigatewayv2_rack.gemspec +0 -39
- data/integration/Gemfile +0 -6
- data/integration/Gemfile.lock +0 -27
- data/integration/Makefile +0 -9
- data/integration/README.md +0 -6
- data/integration/app.rb +0 -19
- data/integration/config.ru +0 -7
- data/integration/main.rb +0 -21
- data/integration/template.jsonnet +0 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 140ca2ab90e7020ac9f5bae379743ee7e2c34288b542b4f0c71ed7455197740a
|
|
4
|
+
data.tar.gz: 1f8d4544c34cfb50f378a0a183e8bca7b40ff5b374a3aa6d934db156b7c74e31
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72a7f719b034b4804e6fe68452c0313f22dad4314f6b612ee47a545effd3386ccf93a77dc23de2e6029e8a95a76aba0033c0504d3e5bc9c04fbc2c5084c673b6
|
|
7
|
+
data.tar.gz: 0bf4cf7f42a369d56c2ff0cb3319744b3a8dcdcddc8c2254af13fa8e49b983212cc0b0cd06d6286fd835d77fed556fb9e55ec10ffd6ed86c9b82af46fe6f86ac
|
data/CHANGELOG.md
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apigatewayv2_rack
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sorah Fukumori
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rack
|
|
@@ -57,23 +57,10 @@ executables: []
|
|
|
57
57
|
extensions: []
|
|
58
58
|
extra_rdoc_files: []
|
|
59
59
|
files:
|
|
60
|
-
- ".rspec"
|
|
61
60
|
- CHANGELOG.md
|
|
62
|
-
- Dockerfile.integration
|
|
63
|
-
- Gemfile
|
|
64
|
-
- Gemfile.lock
|
|
65
61
|
- LICENSE.txt
|
|
66
62
|
- README.md
|
|
67
63
|
- Rakefile
|
|
68
|
-
- apigatewayv2_rack.gemspec
|
|
69
|
-
- integration/Gemfile
|
|
70
|
-
- integration/Gemfile.lock
|
|
71
|
-
- integration/Makefile
|
|
72
|
-
- integration/README.md
|
|
73
|
-
- integration/app.rb
|
|
74
|
-
- integration/config.ru
|
|
75
|
-
- integration/main.rb
|
|
76
|
-
- integration/template.jsonnet
|
|
77
64
|
- lib/apigatewayv2_rack.rb
|
|
78
65
|
- lib/apigatewayv2_rack/error.rb
|
|
79
66
|
- lib/apigatewayv2_rack/middlewares/cloudfront_verify.rb
|
|
@@ -103,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
103
90
|
- !ruby/object:Gem::Version
|
|
104
91
|
version: '0'
|
|
105
92
|
requirements: []
|
|
106
|
-
rubygems_version: 3.6.
|
|
93
|
+
rubygems_version: 3.6.9
|
|
107
94
|
specification_version: 4
|
|
108
95
|
summary: handle AWS Lambda API Gateway V2 or ALB (ELBv2) lambda request event with
|
|
109
96
|
Rack application
|
data/.rspec
DELETED
data/Dockerfile.integration
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
FROM public.ecr.aws/lambda/ruby:2.7
|
|
2
|
-
|
|
3
|
-
ENV GEM_HOME=${LAMBDA_TASK_ROOT}
|
|
4
|
-
ENV BUNDLE_PATH=${LAMBDA_TASK_ROOT}/vendor/bundle
|
|
5
|
-
COPY integration/Gemfile* ${LAMBDA_TASK_ROOT}/
|
|
6
|
-
RUN bundle install
|
|
7
|
-
|
|
8
|
-
COPY lib ${LAMBDA_TASK_ROOT}/lib
|
|
9
|
-
COPY integration/* ${LAMBDA_TASK_ROOT}/
|
|
10
|
-
|
|
11
|
-
#RUN find ${LAMBDA_TASK_ROOT}
|
|
12
|
-
|
|
13
|
-
CMD ["main.Main.handle"]
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
apigatewayv2_rack (0.3.0)
|
|
5
|
-
base64
|
|
6
|
-
rack
|
|
7
|
-
stringio
|
|
8
|
-
|
|
9
|
-
GEM
|
|
10
|
-
remote: https://rubygems.org/
|
|
11
|
-
specs:
|
|
12
|
-
base64 (0.2.0)
|
|
13
|
-
diff-lcs (1.6.0)
|
|
14
|
-
rack (3.1.13)
|
|
15
|
-
rake (13.2.1)
|
|
16
|
-
rspec (3.13.0)
|
|
17
|
-
rspec-core (~> 3.13.0)
|
|
18
|
-
rspec-expectations (~> 3.13.0)
|
|
19
|
-
rspec-mocks (~> 3.13.0)
|
|
20
|
-
rspec-core (3.13.3)
|
|
21
|
-
rspec-support (~> 3.13.0)
|
|
22
|
-
rspec-expectations (3.13.3)
|
|
23
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
24
|
-
rspec-support (~> 3.13.0)
|
|
25
|
-
rspec-mocks (3.13.2)
|
|
26
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
27
|
-
rspec-support (~> 3.13.0)
|
|
28
|
-
rspec-support (3.13.2)
|
|
29
|
-
stringio (3.1.7)
|
|
30
|
-
|
|
31
|
-
PLATFORMS
|
|
32
|
-
ruby
|
|
33
|
-
|
|
34
|
-
DEPENDENCIES
|
|
35
|
-
apigatewayv2_rack!
|
|
36
|
-
rake (~> 13.0)
|
|
37
|
-
rspec (~> 3.0)
|
|
38
|
-
|
|
39
|
-
BUNDLED WITH
|
|
40
|
-
2.3.21
|
data/apigatewayv2_rack.gemspec
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "lib/apigatewayv2_rack/version"
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name = "apigatewayv2_rack"
|
|
7
|
-
spec.version = Apigatewayv2Rack::VERSION
|
|
8
|
-
spec.authors = ["Sorah Fukumori"]
|
|
9
|
-
spec.email = ["her@sorah.jp"]
|
|
10
|
-
|
|
11
|
-
spec.summary = "handle AWS Lambda API Gateway V2 or ALB (ELBv2) lambda request event with Rack application"
|
|
12
|
-
spec.homepage = "https://github.com/sorah/apigatewayv2_rack"
|
|
13
|
-
spec.license = "MIT"
|
|
14
|
-
spec.required_ruby_version = ">= 2.7.0"
|
|
15
|
-
|
|
16
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
|
17
|
-
spec.metadata["source_code_uri"] = "https://github.com/sorah/apigatewayv2_rack"
|
|
18
|
-
spec.metadata["changelog_uri"] = "https://github.com/sorah/apigatewayv2_rack/blob/main/CHANGELOG.md"
|
|
19
|
-
|
|
20
|
-
# Specify which files should be added to the gem when it is released.
|
|
21
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
22
|
-
spec.files = Dir.chdir(__dir__) do
|
|
23
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
|
24
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
spec.bindir = "exe"
|
|
28
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
29
|
-
spec.require_paths = ["lib"]
|
|
30
|
-
|
|
31
|
-
# Uncomment to register a new dependency of your gem
|
|
32
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
|
33
|
-
spec.add_dependency 'rack'
|
|
34
|
-
spec.add_dependency 'base64'
|
|
35
|
-
spec.add_dependency 'stringio'
|
|
36
|
-
|
|
37
|
-
# For more information and examples about making a new gem, check out our
|
|
38
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
|
39
|
-
end
|
data/integration/Gemfile
DELETED
data/integration/Gemfile.lock
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
GEM
|
|
2
|
-
remote: https://rubygems.org/
|
|
3
|
-
specs:
|
|
4
|
-
mustermann (3.0.0)
|
|
5
|
-
ruby2_keywords (~> 0.0.1)
|
|
6
|
-
rack (2.2.4)
|
|
7
|
-
rack-protection (3.0.2)
|
|
8
|
-
rack
|
|
9
|
-
ruby2_keywords (0.0.5)
|
|
10
|
-
sinatra (3.0.2)
|
|
11
|
-
mustermann (~> 3.0)
|
|
12
|
-
rack (~> 2.2, >= 2.2.4)
|
|
13
|
-
rack-protection (= 3.0.2)
|
|
14
|
-
tilt (~> 2.0)
|
|
15
|
-
tilt (2.0.11)
|
|
16
|
-
webrick (1.7.0)
|
|
17
|
-
|
|
18
|
-
PLATFORMS
|
|
19
|
-
ruby
|
|
20
|
-
|
|
21
|
-
DEPENDENCIES
|
|
22
|
-
rack (< 3)
|
|
23
|
-
sinatra
|
|
24
|
-
webrick
|
|
25
|
-
|
|
26
|
-
BUNDLED WITH
|
|
27
|
-
2.3.16
|
data/integration/Makefile
DELETED
data/integration/README.md
DELETED
data/integration/app.rb
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
require 'sinatra/base'
|
|
2
|
-
|
|
3
|
-
class App < Sinatra::Base
|
|
4
|
-
get '/' do
|
|
5
|
-
cnt = session[:cnt] || 0
|
|
6
|
-
content_type :html
|
|
7
|
-
"<!DOCTYPE html><html><head><meta charset='utf-8'><title>apigatewayv2_rack test</title><body><p>Hello from Lambda!</p><form method='post'><p><button type='submit'>+</button> #{cnt}</p></form>"
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
post '/' do
|
|
11
|
-
session[:cnt] ||= 0
|
|
12
|
-
session[:cnt] += 1
|
|
13
|
-
redirect '/'
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
get '/errortown' do
|
|
17
|
-
raise RuntimeError, 'errortown...'
|
|
18
|
-
end
|
|
19
|
-
end
|
data/integration/config.ru
DELETED
data/integration/main.rb
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
$:.unshift(File.join(__dir__, 'lib'))
|
|
2
|
-
require 'rack'
|
|
3
|
-
require 'rack/builder'
|
|
4
|
-
require 'apigatewayv2_rack'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
#module Main
|
|
8
|
-
# @app = Rack::Builder.load_file(File.join(__dir__, 'config.ru'), {})[0]
|
|
9
|
-
# def self.handle(event:, context:)
|
|
10
|
-
# puts(JSON.generate(event: event, context: context))
|
|
11
|
-
# retval = Apigatewayv2Rack.handle_request(event: event, context: context, app: @app)
|
|
12
|
-
# puts(JSON.generate(retval))
|
|
13
|
-
# retval
|
|
14
|
-
# end
|
|
15
|
-
#end
|
|
16
|
-
#def handler(event:, context:)
|
|
17
|
-
# Main.handle(event: event, context: context)
|
|
18
|
-
#end
|
|
19
|
-
|
|
20
|
-
$stdout.sync = true
|
|
21
|
-
Main = Apigatewayv2Rack.handler_from_rack_config_file(File.join(__dir__, 'config.ru'))
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// SAM template
|
|
2
|
-
{
|
|
3
|
-
AWSTemplateFormatVersion: '2010-09-09',
|
|
4
|
-
Transform: 'AWS::Serverless-2016-10-31',
|
|
5
|
-
Description: '',
|
|
6
|
-
|
|
7
|
-
Resources: {
|
|
8
|
-
AppFunction: {
|
|
9
|
-
Type: 'AWS::Serverless::Function', // https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
|
|
10
|
-
Properties: {
|
|
11
|
-
PackageType: 'Image',
|
|
12
|
-
FunctionUrlConfig: { AuthType: 'NONE' },
|
|
13
|
-
},
|
|
14
|
-
Metadata: {
|
|
15
|
-
DockerContext: '..',
|
|
16
|
-
Dockerfile: 'Dockerfile.integration',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
Outputs: {
|
|
21
|
-
AppUrl: {
|
|
22
|
-
Description: 'app endpoint',
|
|
23
|
-
Value: { 'Fn::GetAtt': ['AppFunctionUrl', 'FunctionUrl'] },
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
}
|