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 +4 -4
- data/.github/workflows/bundler_audit.yml +2 -2
- data/.github/workflows/rspec.yml +2 -2
- data/.gitignore +1 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +27 -27
- data/eventboss.gemspec +1 -1
- data/lib/eventboss/cli.rb +5 -3
- data/lib/eventboss/configuration.rb +15 -4
- data/lib/eventboss/launcher.rb +5 -2
- data/lib/eventboss/sns_client.rb +14 -4
- data/lib/eventboss/version.rb +1 -1
- metadata +10 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b1f420f839811acce009c9e21966d74629313ab8a72cd05b40f3cd404534cfd
|
4
|
+
data.tar.gz: 566b513304186deeeba8afae2d5efed84926b2caa879fcaff67b6381dd4512d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6debb38be48b97c0261c0b5569d4bf7c3b5cfac5cc843e93155c83656eb531be6687e4a8c9f1e6325c2a6fa60cdde34b80d231424ef11a5272df5d127d8edb9e
|
7
|
+
data.tar.gz: 110fad36d51db6f7456fe3a2005adec5f111c59c8df4ad6593a737f5906db93ddfe5d63cb512c26eda9497b85c0641e77eefe2efc9d4202306b66ad76e02effa
|
data/.github/workflows/rspec.yml
CHANGED
@@ -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@
|
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
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.
|
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.
|
15
|
-
aws-sdk-core (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.
|
18
|
-
aws-sigv4 (~> 1.
|
16
|
+
aws-partitions (~> 1, >= 1.992.0)
|
17
|
+
aws-sigv4 (~> 1.9)
|
19
18
|
jmespath (~> 1, >= 1.6.1)
|
20
|
-
aws-sdk-sns (1.
|
21
|
-
aws-sdk-core (~> 3, >= 3.
|
22
|
-
aws-sigv4 (~> 1.
|
23
|
-
aws-sdk-sqs (1.
|
24
|
-
aws-sdk-core (~> 3, >= 3.
|
25
|
-
aws-sigv4 (~> 1.
|
26
|
-
aws-sigv4 (1.
|
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.
|
29
|
-
dotenv (
|
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.
|
33
|
-
rspec (3.
|
34
|
-
rspec-core (~> 3.
|
35
|
-
rspec-expectations (~> 3.
|
36
|
-
rspec-mocks (~> 3.
|
37
|
-
rspec-core (3.
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-expectations (3.
|
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.
|
42
|
-
rspec-mocks (3.
|
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.
|
45
|
-
rspec-support (3.
|
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
|
-
|
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:
|
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
|
data/lib/eventboss/launcher.rb
CHANGED
@@ -29,7 +29,7 @@ module Eventboss
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def stop
|
32
|
-
logger.info('launcher') { '
|
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
|
-
|
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)
|
data/lib/eventboss/sns_client.rb
CHANGED
@@ -42,10 +42,7 @@ module Eventboss
|
|
42
42
|
if configured?
|
43
43
|
options = {
|
44
44
|
region: configuration.eventboss_region,
|
45
|
-
credentials:
|
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 &&
|
data/lib/eventboss/version.rb
CHANGED
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.
|
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:
|
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:
|
42
|
+
name: rexml
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
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: '
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 2.1.1
|
54
|
+
version: '3.0'
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
56
|
+
name: dotenv
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
64
58
|
requirements:
|
65
59
|
- - "~>"
|
66
60
|
- !ruby/object:Gem::Version
|
67
|
-
version: '3.
|
68
|
-
type: :
|
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.
|
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.
|
188
|
+
rubygems_version: 3.5.22
|
195
189
|
signing_key:
|
196
190
|
specification_version: 4
|
197
191
|
summary: Eventboss Ruby Client.
|