jets 4.0.1 → 4.0.3

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: 822ebcd3afbcb8bc1f98310e874f0637bf6be2e8eac8ffa88047eabe37aa3b89
4
- data.tar.gz: 7f7fef65966114c720ca1baf04b2ec9766a9f2c2f8a0052be0f5014d9dc08e46
3
+ metadata.gz: 2656b9ad4b3542399efbba9eadb992532d2ebed430315280d3e1524a376b3674
4
+ data.tar.gz: bcd37a34c13c7027b99854129cf537369dd357ba39edc7481416315d20137602
5
5
  SHA512:
6
- metadata.gz: 5ea8e9c62cd4a340d860f3da2c2849dc2c7a7472ffea80c7794002718eb139996fdf6d75cdbefaedde150d314b9e2bb6968afdccec5c585ba45e90ec78e959fe
7
- data.tar.gz: dd5ae3f105882cd8fe057e3fcece81b5197e0c04bd0700384427c61ac6554a777d191d6682d3d2549a72905e7d9a8e1bcd36a4e726c53c7c776bde99c9cbd240
6
+ metadata.gz: 4b16ac3cc3899c989c2de4670fbc6be7c2f9dc07b39869404ebbbc0689f458fc4befc699ccff3c14001946716288792077a006c97f9541f842040fa656e10a4b
7
+ data.tar.gz: d6f6f26ea83268b6ca877cfe8f49660e15b0e6709cfb7e498bbdf9b87cccf81b4c7cd86f2e707dd4ba0adbed0a8e70ccf0bd06cef80b15fb60e5b689b739dcbf
data/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## [4.0.3] - 2023-08-03
7
+ - [#657](https://github.com/boltops-tools/jets/pull/657) [Fix] ApiGateway for local Middleware: fix query_string_parameters
8
+
9
+ ## [4.0.2] - 2023-08-03
10
+ - [#660](https://github.com/boltops-tools/jets/pull/660) Fix prewarming
11
+
6
12
  ## [4.0.1] - 2023-06-06
7
13
  - [#655](https://github.com/boltops-tools/jets/pull/655) fix cors when using authorizers
8
14
  - [#656](https://github.com/boltops-tools/jets/pull/656) fix prewarming iam permission
data/README.md CHANGED
@@ -5,10 +5,8 @@
5
5
  Ruby and Lambda had a baby and that child's name is [Jets](http://rubyonjets.com/).
6
6
 
7
7
  ![Build Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiZ08vK2hjOHczQUVoUDhSYnBNNUU4T0gxQWJuOTlLaXpwVGQ1NjJ3NnVDY1dSdFVXQ3d2VXVSQzRFcU1qd1JPMndFZlByRktIcTUrZm5GWlM5dHpjM1ZrPSIsIml2UGFyYW1ldGVyU3BlYyI6Imluc1Qrd25GanhUdHlidjUiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)
8
- [![CircleCI](https://circleci.com/gh/boltops-tools/jets.svg?style=svg)](https://circleci.com/gh/boltops-tools/jets)
9
8
  [![Gem Version](https://badge.fury.io/rb/jets.svg)](https://badge.fury.io/rb/jets)
10
9
  [![Support](https://img.shields.io/badge/Support-Help-blue.svg)](http://rubyonjets.com/support/)
11
- [![Gitter Chat](https://badges.gitter.im/boltops-tools/jets.png)](https://gitter.im/boltops-tools/jets)
12
10
 
13
11
  [![BoltOps Badge](https://img.boltops.com/boltops/badges/boltops-badge.png)](https://www.boltops.com)
14
12
 
@@ -17,7 +17,9 @@ class Jets::Commands::Call
17
17
  end
18
18
 
19
19
  def function_name
20
- if @guess
20
+ if @provided_function_name.starts_with?(Jets.config.project_namespace)
21
+ @provided_function_name # fully qualified function name
22
+ elsif @guess
21
23
  ensure_guesses_found! # possibly exits here
22
24
  guesser.function_name # guesser adds namespace already
23
25
  else
@@ -16,6 +16,7 @@ class Jets::Controller::Middleware::Local
16
16
  "httpMethod" => @env['REQUEST_METHOD'], # GET
17
17
  "headers" => request_headers,
18
18
  "queryStringParameters" => query_string_parameters,
19
+ "multiValueQueryStringParameters" => multi_value_query_string_parameters,
19
20
  "pathParameters" => @route.extract_parameters(path),
20
21
  "stageVariables" => nil,
21
22
  "requestContext" => {},
@@ -77,7 +78,18 @@ class Jets::Controller::Middleware::Local
77
78
  end
78
79
 
79
80
  def query_string_parameters
80
- Rack::Utils.parse_nested_query(@env['QUERY_STRING'])
81
+ @env['QUERY_STRING']&.split('&')&.each_with_object({}) do |parameter, hash|
82
+ key, value = parameter.split('=')
83
+ hash[key] = value
84
+ end || {}
85
+ end
86
+
87
+ def multi_value_query_string_parameters
88
+ @env['QUERY_STRING']&.split('&')&.each_with_object({}) do |parameter, hash|
89
+ key, value = parameter.split('=')
90
+ hash[key] = [] if hash[key].nil?
91
+ hash[key] << value
92
+ end || {}
81
93
  end
82
94
 
83
95
  # To get the post body:
@@ -112,9 +112,15 @@ module Jets::Controller::Rack
112
112
  end
113
113
 
114
114
  def query_string
115
- qs_params = @event["queryStringParameters"] || {} # always set with API Gateway but when testing node shim might not be
116
- hash = Jets::Mega::HashConverter.encode(qs_params)
117
- hash.to_query
115
+ qs_params = @event["multiValueQueryStringParameters"] || {} # always set with API Gateway but when testing node shim might not be
116
+
117
+ array = qs_params.each_with_object([]) do |(key, value), arr|
118
+ arr << value.map do |v|
119
+ v.to_query(key)
120
+ end
121
+ end
122
+
123
+ array.join("&")
118
124
  end
119
125
 
120
126
  def headers
@@ -7,7 +7,7 @@ module Jets::Mega
7
7
  value.each { |k,v| encode(v, append_key(key,k), out_hash) }
8
8
  out_hash
9
9
  when Array then
10
- value.each { |v| encode(v, "#{key}[]", out_hash) }
10
+ value.each { |v| encode(v, "#{key}", out_hash) }
11
11
  out_hash
12
12
  when nil then ''
13
13
  else
@@ -22,4 +22,4 @@ module Jets::Mega
22
22
  root_key.nil? ? :"#{key}" : :"#{root_key}[#{key.to_s}]"
23
23
  end
24
24
  end
25
- end
25
+ end
data/lib/jets/preheat.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  module Jets
2
2
  class Preheat
3
3
  extend Memoist
4
+ include Jets::AwsServices
4
5
 
5
6
  # Examples:
6
7
  #
@@ -101,7 +102,9 @@ module Jets
101
102
  stack_resources.each do |stack_resource|
102
103
  acc << stack_resource if stack_resource.logical_resource_id.ends_with?('LambdaFunction') # only functions
103
104
  end
104
- end.flatten.uniq.compact
105
+ acc
106
+ end
107
+ resources.map(&:physical_resource_id) # function names
105
108
  end
106
109
  memoize :all_functions
107
110
 
@@ -117,4 +120,4 @@ module Jets
117
120
  end.compact
118
121
  end
119
122
  end
120
- end
123
+ end
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "4.0.1"
2
+ VERSION = "4.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-06 00:00:00.000000000 Z
11
+ date: 2023-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -1101,7 +1101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1101
1101
  - !ruby/object:Gem::Version
1102
1102
  version: '0'
1103
1103
  requirements: []
1104
- rubygems_version: 3.4.10
1104
+ rubygems_version: 3.4.17
1105
1105
  signing_key:
1106
1106
  specification_version: 4
1107
1107
  summary: Ruby Serverless Framework