eventboss 1.8.1 → 1.9.1

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: e4628ccf4b64bbc755253aedf850c096998ed965231ac1464de4384872d2d1f1
4
- data.tar.gz: cc0661659e16a84c8e5073fba547ca934038c8e769bdd5a06ad4c126511a4f4a
3
+ metadata.gz: 5b1f420f839811acce009c9e21966d74629313ab8a72cd05b40f3cd404534cfd
4
+ data.tar.gz: 566b513304186deeeba8afae2d5efed84926b2caa879fcaff67b6381dd4512d7
5
5
  SHA512:
6
- metadata.gz: a4e2ea1c6484a55a08b6a4067e94cd3171c4bc165930ec5475077263ccc7a898a96d5cef6917daf680483f61841d597b7c77019d783fcf11bf5a39b020dd5d29
7
- data.tar.gz: 2198208804156ab4a6a99e2624a970c9d494c325e4648b3c53eec207f8ecbf2b0ce5cc5e5d932ca0531bb58410d2d595fa1b7250a39b48749085e8bdfcbf610b
6
+ metadata.gz: 6debb38be48b97c0261c0b5569d4bf7c3b5cfac5cc843e93155c83656eb531be6687e4a8c9f1e6325c2a6fa60cdde34b80d231424ef11a5272df5d127d8edb9e
7
+ data.tar.gz: 110fad36d51db6f7456fe3a2005adec5f111c59c8df4ad6593a737f5906db93ddfe5d63cb512c26eda9497b85c0641e77eefe2efc9d4202306b66ad76e02effa
@@ -9,9 +9,9 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  strategy:
11
11
  matrix:
12
- ruby-version: ["3.0"]
12
+ ruby-version: ["3.0", "3.1", "3.2"]
13
13
  steps:
14
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v4
15
15
  - name: Set up Ruby
16
16
  uses: ruby/setup-ruby@v1
17
17
  with:
@@ -14,9 +14,9 @@ jobs:
14
14
  runs-on: ubuntu-latest
15
15
  strategy:
16
16
  matrix:
17
- ruby-version: ["3.0"]
17
+ ruby-version: ["3.0", "3.1", "3.2"]
18
18
  steps:
19
- - uses: actions/checkout@v2
19
+ - uses: actions/checkout@v4
20
20
  - name: Set up Ruby
21
21
  # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby
22
22
  uses: ruby/setup-ruby@v1
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ .ruby-version
data/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.9.1] - 2024-12-30
8
+
9
+ - Add support for AWS Session Token in development mode
10
+
11
+ ## [1.9.0] - 2024-03-12
12
+
13
+ - Eliminate the dependency on `dotenv`. However, the application will still load `dotenv` if it is available.
14
+
7
15
  ## [1.4.0] - 2020-04-18
8
16
 
9
17
  - Introduce server middlewares (#31)
data/Gemfile.lock CHANGED
@@ -1,54 +1,54 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eventboss (1.8.1)
4
+ eventboss (1.9.1)
5
5
  aws-sdk-sns (>= 1.1.0)
6
6
  aws-sdk-sqs (>= 1.3.0)
7
- dotenv (~> 2.1, >= 2.1.1)
8
7
  rexml (~> 3.0)
9
8
 
10
9
  GEM
11
10
  remote: https://rubygems.org/
12
11
  specs:
13
12
  aws-eventstream (1.3.0)
14
- aws-partitions (1.894.0)
15
- aws-sdk-core (3.191.3)
13
+ aws-partitions (1.1029.0)
14
+ aws-sdk-core (3.214.1)
16
15
  aws-eventstream (~> 1, >= 1.3.0)
17
- aws-partitions (~> 1, >= 1.651.0)
18
- aws-sigv4 (~> 1.8)
16
+ aws-partitions (~> 1, >= 1.992.0)
17
+ aws-sigv4 (~> 1.9)
19
18
  jmespath (~> 1, >= 1.6.1)
20
- aws-sdk-sns (1.72.0)
21
- aws-sdk-core (~> 3, >= 3.191.0)
22
- aws-sigv4 (~> 1.1)
23
- aws-sdk-sqs (1.70.0)
24
- aws-sdk-core (~> 3, >= 3.191.0)
25
- aws-sigv4 (~> 1.1)
26
- aws-sigv4 (1.8.0)
19
+ aws-sdk-sns (1.92.0)
20
+ aws-sdk-core (~> 3, >= 3.210.0)
21
+ aws-sigv4 (~> 1.5)
22
+ aws-sdk-sqs (1.89.0)
23
+ aws-sdk-core (~> 3, >= 3.210.0)
24
+ aws-sigv4 (~> 1.5)
25
+ aws-sigv4 (1.10.1)
27
26
  aws-eventstream (~> 1, >= 1.0.2)
28
- diff-lcs (1.5.0)
29
- dotenv (2.8.1)
27
+ diff-lcs (1.5.1)
28
+ dotenv (3.1.0)
30
29
  jmespath (1.6.2)
31
30
  rake (13.0.6)
32
- rexml (3.2.6)
33
- rspec (3.11.0)
34
- rspec-core (~> 3.11.0)
35
- rspec-expectations (~> 3.11.0)
36
- rspec-mocks (~> 3.11.0)
37
- rspec-core (3.11.0)
38
- rspec-support (~> 3.11.0)
39
- rspec-expectations (3.11.0)
31
+ rexml (3.4.0)
32
+ rspec (3.13.0)
33
+ rspec-core (~> 3.13.0)
34
+ rspec-expectations (~> 3.13.0)
35
+ rspec-mocks (~> 3.13.0)
36
+ rspec-core (3.13.0)
37
+ rspec-support (~> 3.13.0)
38
+ rspec-expectations (3.13.1)
40
39
  diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.11.0)
42
- rspec-mocks (3.11.0)
40
+ rspec-support (~> 3.13.0)
41
+ rspec-mocks (3.13.1)
43
42
  diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.11.0)
45
- rspec-support (3.11.0)
43
+ rspec-support (~> 3.13.0)
44
+ rspec-support (3.13.1)
46
45
 
47
46
  PLATFORMS
48
47
  ruby
49
48
 
50
49
  DEPENDENCIES
51
50
  bundler (>= 1)
51
+ dotenv (~> 3.1)
52
52
  eventboss!
53
53
  rake (>= 10.0)
54
54
  rspec (~> 3.0)
data/eventboss.gemspec CHANGED
@@ -22,9 +22,9 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_dependency "aws-sdk-sqs", ">= 1.3.0"
24
24
  spec.add_dependency "aws-sdk-sns", ">= 1.1.0"
25
- spec.add_dependency "dotenv", "~> 2.1", ">= 2.1.1"
26
25
  spec.add_dependency "rexml", "~> 3.0"
27
26
 
27
+ spec.add_development_dependency "dotenv", "~> 3.1"
28
28
  spec.add_development_dependency "bundler", ">= 1"
29
29
  spec.add_development_dependency 'rake', '>= 10.0'
30
30
  spec.add_development_dependency "rspec", "~> 3.0"
data/lib/eventboss/cli.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  require 'rubygems'
2
- require 'dotenv'
2
+ begin
3
+ require 'dotenv'
4
+ Dotenv.load
5
+ rescue LoadError
6
+ end
3
7
  require 'optparse'
4
8
  require 'yaml'
5
9
  require 'erb'
@@ -36,8 +40,6 @@ module Eventboss
36
40
  private
37
41
 
38
42
  def boot_system
39
- Dotenv.load
40
-
41
43
  require 'rails'
42
44
  if ::Rails::VERSION::MAJOR < 4
43
45
  require File.expand_path('config/environment.rb')
@@ -20,6 +20,7 @@ module Eventboss
20
20
  :eventboss_account_id,
21
21
  :aws_access_key_id,
22
22
  :aws_secret_access_key,
23
+ :aws_session_token,
23
24
  :aws_sns_endpoint,
24
25
  :aws_sqs_endpoint,
25
26
  :sns_sqs_name_infix,
@@ -63,10 +64,7 @@ module Eventboss
63
64
  defined_or_default('sqs_client') do
64
65
  options = {
65
66
  region: eventboss_region,
66
- credentials: Aws::Credentials.new(
67
- aws_access_key_id,
68
- aws_secret_access_key
69
- )
67
+ credentials: credentials
70
68
  }
71
69
  if aws_sqs_endpoint
72
70
  options[:endpoint] = aws_sqs_endpoint
@@ -76,6 +74,15 @@ module Eventboss
76
74
  end
77
75
  end
78
76
 
77
+ def credentials
78
+ return Aws::Credentials.new(aws_access_key_id, aws_secret_access_key, aws_session_token) if development_mode?
79
+
80
+ Aws::Credentials.new(
81
+ aws_access_key_id,
82
+ aws_secret_access_key
83
+ )
84
+ end
85
+
79
86
  def eventboss_region
80
87
  defined_or_default('eventboss_region') { ENV['EVENTBOSS_REGION'] || ENV['EVENTBUS_REGION'] }
81
88
  end
@@ -96,6 +103,10 @@ module Eventboss
96
103
  defined_or_default('aws_secret_access_key') { ENV['AWS_SECRET_ACCESS_KEY'] }
97
104
  end
98
105
 
106
+ def aws_session_token
107
+ defined_or_default('aws_session_token') { ENV['AWS_SESSION_TOKEN'] }
108
+ end
109
+
99
110
  def aws_sqs_endpoint
100
111
  defined_or_default('aws_sqs_endpoint') { ENV['AWS_SQS_ENDPOINT'] }
101
112
  end
@@ -29,7 +29,7 @@ module Eventboss
29
29
  end
30
30
 
31
31
  def stop
32
- logger.info('launcher') { 'Gracefully shutdown' }
32
+ logger.info('launcher') { 'Starting shutdown' }
33
33
 
34
34
  @bus.clear
35
35
  @pollers.each(&:terminate)
@@ -41,7 +41,10 @@ module Eventboss
41
41
  end
42
42
 
43
43
  def hard_shutdown
44
- return if @pollers.empty? && @workers.empty?
44
+ if @poolers.empty? && @workers.empty?
45
+ logger.info('launcher') { 'Gracefully shutdown' }
46
+ return
47
+ end
45
48
 
46
49
  logger.info('launcher') { "Killing remaining #{@pollers.size} pollers, #{@workers.size} workers" }
47
50
  @pollers.each(&:kill)
@@ -42,10 +42,7 @@ module Eventboss
42
42
  if configured?
43
43
  options = {
44
44
  region: configuration.eventboss_region,
45
- credentials: ::Aws::Credentials.new(
46
- configuration.aws_access_key_id,
47
- configuration.aws_secret_access_key
48
- )
45
+ credentials: credentials
49
46
  }
50
47
  if configuration.aws_sns_endpoint
51
48
  options[:endpoint] = configuration.aws_sns_endpoint
@@ -59,6 +56,19 @@ module Eventboss
59
56
  end
60
57
  end
61
58
 
59
+ def credentials
60
+ return ::Aws::Credentials.new(
61
+ configuration.aws_access_key_id,
62
+ configuration.aws_secret_access_key,
63
+ configuration.aws_session_token
64
+ ) if configuration.development_mode?
65
+
66
+ ::Aws::Credentials.new(
67
+ configuration.aws_access_key_id,
68
+ configuration.aws_secret_access_key
69
+ )
70
+ end
71
+
62
72
  def configured?
63
73
  !!(
64
74
  configuration.eventboss_region &&
@@ -1,3 +1,3 @@
1
1
  module Eventboss
2
- VERSION = "1.8.1"
2
+ VERSION = "1.9.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventboss
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AirHelp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-28 00:00:00.000000000 Z
11
+ date: 2025-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sqs
@@ -39,39 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.1.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: dotenv
42
+ name: rexml
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.1'
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: 2.1.1
47
+ version: '3.0'
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
54
51
  requirements:
55
52
  - - "~>"
56
53
  - !ruby/object:Gem::Version
57
- version: '2.1'
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 2.1.1
54
+ version: '3.0'
61
55
  - !ruby/object:Gem::Dependency
62
- name: rexml
56
+ name: dotenv
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
59
  - - "~>"
66
60
  - !ruby/object:Gem::Version
67
- version: '3.0'
68
- type: :runtime
61
+ version: '3.1'
62
+ type: :development
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
66
  - - "~>"
73
67
  - !ruby/object:Gem::Version
74
- version: '3.0'
68
+ version: '3.1'
75
69
  - !ruby/object:Gem::Dependency
76
70
  name: bundler
77
71
  requirement: !ruby/object:Gem::Requirement
@@ -191,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
185
  - !ruby/object:Gem::Version
192
186
  version: '0'
193
187
  requirements: []
194
- rubygems_version: 3.5.5
188
+ rubygems_version: 3.5.22
195
189
  signing_key:
196
190
  specification_version: 4
197
191
  summary: Eventboss Ruby Client.