jets 4.0.0 → 4.0.2

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: 557e01dec1b92f8a04213ef4b7f5ee9d8a35f25dd20231c96ba24b0d9890b7cd
4
- data.tar.gz: 5c8c12ae959d76dc9e5a681c8f18a40d5d60defcc4eead52ed9d9ad2571a3fe1
3
+ metadata.gz: 898dace94ebd7b32151b27fa45377e873facc028dfd8a70545f9dd85a3aebf2b
4
+ data.tar.gz: c91297479c8dd6dbe4a66edec38ff2fd3baefca8fc338300a349180935d1d8c3
5
5
  SHA512:
6
- metadata.gz: 944a1d09ba4da26110e292cdf42d73a240d283d066dbe1ca677787c20b03ee925cf12e3d92555bc16e6327c7096ce59782cd271ff802f5d8554819674f040020
7
- data.tar.gz: 987eac8ef96a9cc10b0ac071ff099c02245cf5143bb75d23622513aba73ba447414ab0c542f7a734c30ba6ce07f20cd479daecc030c02d9a5d3505c10c0a5c34
6
+ metadata.gz: a60f58645caf94956e029721d160954deadd0f6b826841f6178ba0d03b296ad8af13f6a88b376503e47a1e70c8486751d22cb432a03494ef03f9811176fbfc83
7
+ data.tar.gz: e83434bf93f3f7d139877f2969a5b31fa85e5a49254a42c145e6eec728f3c0a47faaf3c5fe2a2e2c229d55202a149eddf273e93b365c018677e1d8dc967d4db7
data/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
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.2] - 2023-08-03
7
+ - [#660](https://github.com/boltops-tools/jets/pull/660) Fix prewarming
8
+
9
+ ## [4.0.1] - 2023-06-06
10
+ - [#655](https://github.com/boltops-tools/jets/pull/655) fix cors when using authorizers
11
+ - [#656](https://github.com/boltops-tools/jets/pull/656) fix prewarming iam permission
12
+
6
13
  ## [4.0.0] - 2023-05-27
7
14
  - [#641](https://github.com/boltops-tools/jets/pull/641) bundle check and prevent error from getting to aws lambda
8
15
  - [#642](https://github.com/boltops-tools/jets/pull/642) Fix rack mounted apps: update interface with removed meth
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
@@ -17,11 +17,11 @@ class Jets::PreheatJob < ApplicationJob
17
17
  ]
18
18
  },
19
19
  {
20
- sid: "Statement2",
21
- action: ["lambda:InvokeFunction", "lambda:InvokeAsync"],
22
- effect: "Allow",
23
- resource: [
24
- sub("arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${WarmLambdaFunction}")
20
+ Sid: "Statement2",
21
+ Action: ["lambda:InvokeFunction", "lambda:InvokeAsync"],
22
+ Effect: "Allow",
23
+ Resource: [
24
+ sub("arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:#{Jets.project_namespace}-*")
25
25
  ]
26
26
  }
27
27
  )
@@ -234,11 +234,13 @@ module Jets::Lambda::Dsl
234
234
  end
235
235
 
236
236
  def ref(name)
237
- "!Ref #{name.to_s.camelize}"
237
+ name = name.is_a?(Symbol) ? name.to_s.camelize : name
238
+ "!Ref #{name}"
238
239
  end
239
240
 
240
241
  def sub(value)
241
- "!Sub #{value.to_s.camelize}"
242
+ value = value.is_a?(Symbol) ? value.to_s.camelize : value
243
+ "!Sub #{value}"
242
244
  end
243
245
 
244
246
  # meth is a Symbol
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
@@ -51,7 +51,7 @@ module Jets::Resource::ApiGateway
51
51
  end
52
52
 
53
53
  def cors_authorization_type
54
- Jets.config.api.cors_authorization_type || @route.authorization_type || "NONE"
54
+ Jets.config.api.cors_authorization_type || "NONE"
55
55
  end
56
56
 
57
57
  def cors_logical_id
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "4.0.0"
2
+ VERSION = "4.0.2"
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.0
4
+ version: 4.0.2
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-05-27 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