apigatewayv2_rack 0.2.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 073c851f0cb75caa64728eededbf267f5ff59562b4d90367e6e4dc2a082abd47
4
- data.tar.gz: 0efeee0de9853cd1d68e4d12cb4ee4a7ebae88ab5524dfc8a4a939899bad1a06
3
+ metadata.gz: 140ca2ab90e7020ac9f5bae379743ee7e2c34288b542b4f0c71ed7455197740a
4
+ data.tar.gz: 1f8d4544c34cfb50f378a0a183e8bca7b40ff5b374a3aa6d934db156b7c74e31
5
5
  SHA512:
6
- metadata.gz: 2670cb580d821371de7ee4e7bded98a6b981656c736b0608afb50776c57a0894311369fd74a143137a9182a25f665f64ac912805bed5ccdace279be12881acbc
7
- data.tar.gz: 3df8e78bd30efc4ed3c5bdff9c789050c5d104ca7b93b2a3f500230e4fe9c8ad1d357267b629f743c03d8315655547f6921d9c13b3d3b23520f6b16612a7f46e
6
+ metadata.gz: 72a7f719b034b4804e6fe68452c0313f22dad4314f6b612ee47a545effd3386ccf93a77dc23de2e6029e8a95a76aba0033c0504d3e5bc9c04fbc2c5084c673b6
7
+ data.tar.gz: 0bf4cf7f42a369d56c2ff0cb3319744b3a8dcdcddc8c2254af13fa8e49b983212cc0b0cd06d6286fd835d77fed556fb9e55ec10ffd6ed86c9b82af46fe6f86ac
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
- ## [Unreleased]
1
+ ## [0.4.0] - 2025-11-10
2
+
3
+ - Exclude integration test, GitHub workflows and Gemfile to be included in a released gem package. https://github.com/sorah/apigatewayv2_rack/pull/6
4
+
5
+ ## [0.3.0] - 2025-04-24
6
+
7
+ - Stop defaulting CONTENT_TYPE to an empty String (`""`), which can cause Rails to complain as a unknown MIME type https://github.com/sorah/apigatewayv2_rack/pull/4
2
8
 
3
9
  ## [0.2.2] - 2025-03-07
4
10
 
@@ -93,7 +93,7 @@ module Apigatewayv2Rack
93
93
  'SERVER_NAME' => headers['host'] || 'unknown',
94
94
  'SERVER_PORT' => (use_x_forwarded_host && ['x-forwarded-port']&.to_i&.to_s) || '80',
95
95
  'CONTENT_LENGTH' => body.bytesize.to_s,
96
- 'CONTENT_TYPE' => headers['content-type'] || '',
96
+ 'CONTENT_TYPE' => headers['content-type'],
97
97
  'REMOTE_ADDR' => source_ip,
98
98
  'rack.version' => RACK_VERSION,
99
99
  'rack.url_scheme' => (use_x_forwarded_host && headers['x-forwarded-proto']) || 'https',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Apigatewayv2Rack
4
- VERSION = "0.2.2"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apigatewayv2_rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sorah Fukumori
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-03-06 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rack
@@ -52,30 +51,16 @@ dependencies:
52
51
  - - ">="
53
52
  - !ruby/object:Gem::Version
54
53
  version: '0'
55
- description:
56
54
  email:
57
55
  - her@sorah.jp
58
56
  executables: []
59
57
  extensions: []
60
58
  extra_rdoc_files: []
61
59
  files:
62
- - ".rspec"
63
60
  - CHANGELOG.md
64
- - Dockerfile.integration
65
- - Gemfile
66
- - Gemfile.lock
67
61
  - LICENSE.txt
68
62
  - README.md
69
63
  - Rakefile
70
- - apigatewayv2_rack.gemspec
71
- - integration/Gemfile
72
- - integration/Gemfile.lock
73
- - integration/Makefile
74
- - integration/README.md
75
- - integration/app.rb
76
- - integration/config.ru
77
- - integration/main.rb
78
- - integration/template.jsonnet
79
64
  - lib/apigatewayv2_rack.rb
80
65
  - lib/apigatewayv2_rack/error.rb
81
66
  - lib/apigatewayv2_rack/middlewares/cloudfront_verify.rb
@@ -91,7 +76,6 @@ metadata:
91
76
  homepage_uri: https://github.com/sorah/apigatewayv2_rack
92
77
  source_code_uri: https://github.com/sorah/apigatewayv2_rack
93
78
  changelog_uri: https://github.com/sorah/apigatewayv2_rack/blob/main/CHANGELOG.md
94
- post_install_message:
95
79
  rdoc_options: []
96
80
  require_paths:
97
81
  - lib
@@ -106,8 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
90
  - !ruby/object:Gem::Version
107
91
  version: '0'
108
92
  requirements: []
109
- rubygems_version: 3.4.6
110
- signing_key:
93
+ rubygems_version: 3.6.9
111
94
  specification_version: 4
112
95
  summary: handle AWS Lambda API Gateway V2 or ALB (ELBv2) lambda request event with
113
96
  Rack application
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
@@ -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
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in apigatewayv2_rack.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rspec", "~> 3.0"
data/Gemfile.lock DELETED
@@ -1,40 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- apigatewayv2_rack (0.2.2)
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.11)
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.5)
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
@@ -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
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
- gem 'sinatra'
3
- gem 'rack', '<3'
4
- gem 'webrick'
5
- #gem 'rackup'
6
- #gem 'rack-session'
@@ -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
@@ -1,9 +0,0 @@
1
- build:
2
- jsonnet template.jsonnet > template.json
3
- sam build
4
-
5
- setup: build
6
- sam deploy --guided
7
-
8
- deploy: build
9
- sam deploy
@@ -1,6 +0,0 @@
1
- # sinatra app for integration test
2
-
3
- ```
4
- make setup
5
- make deploy
6
- ```
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
@@ -1,7 +0,0 @@
1
- require_relative './app'
2
- require 'rack'
3
- require 'logger'
4
-
5
- use(Rack::CommonLogger, Logger.new($stdout))
6
- use(Rack::Session::Cookie, key: 'sess', expire_after: 3600, secret: 'insecure-secret')
7
- run App
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
- }