jets 2.3.15 → 2.3.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4075836f430003ceb870fea1ea766e80b309721fcdf8094020e85c438366eab6
4
- data.tar.gz: ca1b516d29eb67b76bc54e4d18bc2ea60e20a046352f013285963705e2a1dc66
3
+ metadata.gz: 044aba70f94ce9b1894daf0a763d0a36bfa5687c79beed5acfebc3f1f0db6086
4
+ data.tar.gz: 28ce72323a8e5bb93db5598f2a2ba60b60921e3d969fb13f237384489902b734
5
5
  SHA512:
6
- metadata.gz: 8b794f90f2a2c6da415867f61cc5d6b60b65a29b62015a3f2dbeb39220e64059f0bb03835fee2bbd4db30a4e1130d53ff897baf0fa557aeec04501f5603dc360
7
- data.tar.gz: ec39e2b5519c7dc95bac0ecfd0f6e3cd4d235653372f0e6237bcbf3226bd2e90a4452f394de194014755eceade754fcbddf7d4a121e93a2a98f08c2583717768
6
+ metadata.gz: 17888c72f237bd56a10c61ecc783ba59ec2aa8ff5345750689ebc1fa7a6d0d221bf604c6879e71cf5787baa45c36cb0b9525a015e0b4159ad7e9a46b58f95d77
7
+ data.tar.gz: 106ca34b5c04e3c774a27ec9431c0c7cef7b5311ae624e975ee061b31aaa7b3f536c6267d67e34d26ed1504a289b7de46d0746e54cead594c9482b62ab2f8dd8
@@ -3,6 +3,14 @@
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
+ ## [2.3.16]
7
+ - #466 fix application_config typo
8
+ - #467 Handle forbidden error from s3
9
+ - #468 authorization_scopes
10
+ - #469 Fixed typo from STMP to SMTP
11
+ - #470 remove json dependency
12
+ - #471 use `Bundler.with_unbundled_env` remove bundler deprecation
13
+
6
14
  ## [2.3.15]
7
15
  - #461 fix guesser lookup for long function names
8
16
 
@@ -50,7 +50,6 @@ Gem::Specification.new do |spec|
50
50
  spec.add_dependency "hashie"
51
51
  spec.add_dependency "jets-gems"
52
52
  spec.add_dependency "jets-html-sanitizer"
53
- spec.add_dependency "json"
54
53
  spec.add_dependency "kramdown"
55
54
  spec.add_dependency "memoist"
56
55
  spec.add_dependency "mimemagic"
@@ -18,6 +18,8 @@ $:.unshift("#{gem_root}/lib")
18
18
  $:.unshift("#{gem_root}/vendor/cfn-status/lib")
19
19
  require "cfn_status"
20
20
 
21
+ require "jets/core_ext/bundler"
22
+
21
23
  require "jets/autoloaders"
22
24
  Jets::Autoloaders.log! if ENV["JETS_AUTOLOAD_LOG"]
23
25
  Jets::Autoloaders.once.setup
@@ -82,7 +82,7 @@ module Jets::Builders
82
82
  begin
83
83
  s3.head_object(bucket: s3_bucket, key: s3_key)
84
84
  true
85
- rescue Aws::S3::Errors::NotFound
85
+ rescue Aws::S3::Errors::NotFound, Aws::S3::Errors::Forbidden
86
86
  false
87
87
  end
88
88
  end
@@ -235,7 +235,7 @@ module Jets::Builders
235
235
 
236
236
  # Need to capture JETS_ROOT since can be changed by Turbo mode
237
237
  jets_root = Jets.root
238
- Bundler.with_clean_env do
238
+ Bundler.with_unbundled_env do
239
239
  # Switch gemfile for Afterburner mode
240
240
  gemfile = ENV['BUNDLE_GEMFILE']
241
241
  ENV['BUNDLE_GEMFILE'] = "#{jets_root}/rack/Gemfile"
@@ -59,7 +59,7 @@ module Jets::Builders
59
59
 
60
60
  FileUtils.rm_rf("#{cache_area}/.bundle")
61
61
  require "bundler" # dynamically require bundler so user can use any bundler
62
- Bundler.with_clean_env do
62
+ Bundler.with_unbundled_env do
63
63
  sh(
64
64
  "cd #{cache_area} && " \
65
65
  "env bundle install --path #{cache_area}/vendor/gems --without development test"
@@ -41,7 +41,7 @@ class Jets::Commands::Import
41
41
  end
42
42
 
43
43
  def bundle_install
44
- Bundler.with_clean_env do
44
+ Bundler.with_unbundled_env do
45
45
  run "cd rack && bundle install"
46
46
  end
47
47
  end
@@ -43,7 +43,7 @@ module Jets::Commands
43
43
  puts Jets::Booter.message
44
44
  Jets::Booter.check_config_ru!
45
45
  Jets::RackServer.start(options) unless ENV['JETS_RACK'] == '0' # rack server runs in background by default
46
- Bundler.with_clean_env do
46
+ Bundler.with_unbundled_env do
47
47
  system(command)
48
48
  end
49
49
  end
@@ -61,7 +61,7 @@ module Jets::Commands
61
61
  end
62
62
 
63
63
  def bundle_install
64
- Bundler.with_clean_env do
64
+ Bundler.with_unbundled_env do
65
65
  system("BUNDLE_IGNORE_CONFIG=1 bundle install")
66
66
  end
67
67
  end
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "jets", git: "https://github.com/tongueroo/jets.git", submodules: true, branch: "master"
3
+ gem "jets"
4
4
 
5
5
  <% if @webpacker -%>
6
6
  # Include jetpacker if you are you are building html pages
@@ -6,7 +6,8 @@ class Jets::Controller
6
6
  class_attribute :auth_type,
7
7
  :auth_to,
8
8
  :auth_options, # for only and except filters
9
- :api_key_needed
9
+ :api_key_needed,
10
+ :authorization_scopes_value
10
11
  end
11
12
 
12
13
  class_methods do
@@ -31,6 +32,14 @@ class Jets::Controller
31
32
  end
32
33
  end
33
34
 
35
+ def authorization_scopes(value=nil)
36
+ if !value.nil?
37
+ self.authorization_scopes_value = value
38
+ else
39
+ self.authorization_scopes_value
40
+ end
41
+ end
42
+
34
43
  def authorizer_metadata
35
44
  Jets::Router::Route::Authorizer.metadata(auth_to)
36
45
  end
@@ -0,0 +1,7 @@
1
+ # Bundler 2.0 does yet not have with_unbundled_env
2
+ # Bundler 2.1 deprecates with_unbundled_env for with_unbundled_env
3
+
4
+ require "bundler"
5
+ def Bundler.with_unbundled_env(&block)
6
+ with_clean_env(&block)
7
+ end unless Bundler.respond_to?(:with_unbundled_env)
@@ -34,7 +34,7 @@ module Jets
34
34
  def serve
35
35
  # Note, looks like stopping jets server with Ctrl-C sends the TERM signal
36
36
  # down to the sub bin/rackup command cleans up the child process fine.
37
- Bundler.with_clean_env do
37
+ Bundler.with_unbundled_env do
38
38
  args = ''
39
39
  # only forward the host option, port is always 9292 for simplicity
40
40
  if @options[:host]
@@ -36,6 +36,8 @@ module Jets::Resource::ApiGateway
36
36
  method_responses: []
37
37
  }
38
38
  props[:authorizer_id] = authorizer_id if authorizer_id
39
+ props[:authorization_scopes] = authorization_scopes if authorization_scopes
40
+
39
41
  props
40
42
  end
41
43
 
@@ -28,5 +28,14 @@ class Jets::Resource::ApiGateway::Method
28
28
  controller_klass.api_key_required ||
29
29
  Jets.config.api.api_key_required
30
30
  end
31
+
32
+ def authorization_scopes
33
+ if @route.authorization_scopes
34
+ authorization_scopes = @route.authorization_scopes
35
+ elsif controller_klass.authorization_scopes
36
+ authorization_scopes = controller_klass.authorization_scopes
37
+ end
38
+ authorization_scopes
39
+ end
31
40
  end
32
41
  end
@@ -52,8 +52,8 @@ module Jets::Resource::Lambda
52
52
  environment: { variables: environment },
53
53
  }
54
54
 
55
- appplication_config = Jets.application.config.function.to_h
56
- baseline.merge(appplication_config)
55
+ application_config = Jets.application.config.function.to_h
56
+ baseline.merge(application_config)
57
57
  end
58
58
 
59
59
  # Class properties example:
@@ -211,4 +211,4 @@ module Jets::Resource::Lambda
211
211
  "#{@app_class}##{@task.meth}"
212
212
  end
213
213
  end
214
- end
214
+ end
@@ -16,6 +16,10 @@ class Jets::Router::Route
16
16
  @options[:authorizer]
17
17
  end
18
18
 
19
+ def authorization_scopes
20
+ @options[:authorization_scopes]
21
+ end
22
+
19
23
  def authorization_type
20
24
  @options[:authorization_type] || inferred_authorization_type
21
25
  end
@@ -110,7 +110,7 @@ class Jets::Turbo
110
110
  # TODO: remove duplication, copied from jets/commands/import/base.rb
111
111
  # And modified it slightly
112
112
  def bundle_install
113
- Bundler.with_clean_env do
113
+ Bundler.with_unbundled_env do
114
114
  sh "cd #{build_area}/#{@project_folder}/rack && bundle install"
115
115
  end
116
116
  end
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "2.3.15"
2
+ VERSION = "2.3.16"
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: 2.3.15
4
+ version: 2.3.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-27 00:00:00.000000000 Z
11
+ date: 2020-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -332,20 +332,6 @@ dependencies:
332
332
  - - ">="
333
333
  - !ruby/object:Gem::Version
334
334
  version: '0'
335
- - !ruby/object:Gem::Dependency
336
- name: json
337
- requirement: !ruby/object:Gem::Requirement
338
- requirements:
339
- - - ">="
340
- - !ruby/object:Gem::Version
341
- version: '0'
342
- type: :runtime
343
- prerelease: false
344
- version_requirements: !ruby/object:Gem::Requirement
345
- requirements:
346
- - - ">="
347
- - !ruby/object:Gem::Version
348
- version: '0'
349
335
  - !ruby/object:Gem::Dependency
350
336
  name: kramdown
351
337
  requirement: !ruby/object:Gem::Requirement
@@ -797,6 +783,7 @@ files:
797
783
  - lib/jets/controller/response.rb
798
784
  - lib/jets/controller/stage.rb
799
785
  - lib/jets/core.rb
786
+ - lib/jets/core_ext/bundler.rb
800
787
  - lib/jets/core_ext/kernel.rb
801
788
  - lib/jets/db.rb
802
789
  - lib/jets/dotenv.rb