eventboss 1.9.3 → 1.9.5
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 +4 -4
- data/.github/workflows/publish_gem.yml +51 -0
- data/.gitignore +1 -0
- data/README.md +6 -0
- data/lib/eventboss/configuration.rb +6 -1
- data/lib/eventboss/error_handlers/db_connection_drop_handler.rb +7 -1
- data/lib/eventboss/runner.rb +13 -0
- data/lib/eventboss/version.rb +1 -1
- metadata +4 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00edb1f9a676e16224c4914f8411c073bd9f29658d1b878b4b6bb5e4639d8126
|
4
|
+
data.tar.gz: 42f8f5f0d71c515203e9601ec327717b026d43855cea1d0915901f8de38aafd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83eb1f2faa512f4147e4a3b4f523b3a0d60f4429bd27932da4f811ab8c7a006457abc15b7f5ef4f7fea734dd4c736d6e35e5d598c292097020156ca94cde42ac
|
7
|
+
data.tar.gz: e623aa96514dd1c4be6c97c64d24c4b3a5d0fe54740636437b02bbd31d821cae1fd607b28009b6fb6337819cdb0f992464860c39a5336dcd8ac650e1daaa3df5
|
@@ -0,0 +1,51 @@
|
|
1
|
+
name: Publish Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
publish:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
permissions:
|
10
|
+
contents: read
|
11
|
+
packages: write
|
12
|
+
steps:
|
13
|
+
- name: Check out repository
|
14
|
+
uses: actions/checkout@v4
|
15
|
+
|
16
|
+
- name: Set up Ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: ruby
|
20
|
+
# runs 'bundle install' and caches installed gems automatically
|
21
|
+
bundler-cache: true
|
22
|
+
|
23
|
+
- name: "Publish gem eventboss"
|
24
|
+
shell: bash
|
25
|
+
env:
|
26
|
+
GEM_HOST_API_KEY: ${{ secrets.EVENTBOSS_RUBYGEMS_TOKEN }}
|
27
|
+
|
28
|
+
run: |
|
29
|
+
set -euo pipefail
|
30
|
+
# make this path safe so git commands work on a root-owned mount
|
31
|
+
git config --global --add safe.directory /usr/src/app
|
32
|
+
|
33
|
+
echo "📦 Building & publishing eventboss"
|
34
|
+
# Build the gem
|
35
|
+
gem build eventboss.gemspec
|
36
|
+
|
37
|
+
set +e
|
38
|
+
push_output=$(gem push *.gem 2>&1)
|
39
|
+
push_exit_code=$?
|
40
|
+
set -e
|
41
|
+
|
42
|
+
if [[ $push_exit_code -eq 0 ]]; then
|
43
|
+
echo "✅ Successfully published eventboss!"
|
44
|
+
elif grep -q "already been pushed" <<< "$push_output"; then
|
45
|
+
echo "::warning title=Gem already pushed::Gem eventboss version already published. Skipping this step."
|
46
|
+
echo "::notice title=Skipped publishing::Gem eventboss version already exists."
|
47
|
+
exit 0
|
48
|
+
else
|
49
|
+
echo "::error title=Gem Push Failed::$push_output"
|
50
|
+
exit 1
|
51
|
+
fi
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -108,6 +108,12 @@ Use fixed account ID for localstack setup:
|
|
108
108
|
EVENTBUS_ACCOUNT_ID=000000000000
|
109
109
|
```
|
110
110
|
|
111
|
+
### AWS Credentials Validation
|
112
|
+
|
113
|
+
When running in container environments with IAM roles (indicated by the presence of `AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE`, which is set automatically by AWS when IAM role is used), Eventboss validates that the AWS client is using the correct credentials provider (`Aws::ECSCredentials`). If the wrong credentials provider is detected, Eventboss will log an error and exit with code 1 to prevent running with invalid credentials.
|
114
|
+
|
115
|
+
This feature is particularly useful in Kubernetes environments where pods should be using ECS credentials for IAM role authentication.
|
116
|
+
|
111
117
|
Be aware that `eventbus:deadletter:reload` rake task won't load your configuration if you are not using ENVs
|
112
118
|
in non Rails app, although to make it work you can extend your `Rakefile` with:
|
113
119
|
|
@@ -20,6 +20,7 @@ module Eventboss
|
|
20
20
|
:eventboss_account_id,
|
21
21
|
:eventboss_use_default_credentials,
|
22
22
|
:aws_access_key_id,
|
23
|
+
:aws_container_authorization_token_file,
|
23
24
|
:aws_secret_access_key,
|
24
25
|
:aws_session_token,
|
25
26
|
:aws_sns_endpoint,
|
@@ -81,7 +82,7 @@ module Eventboss
|
|
81
82
|
|
82
83
|
def credentials
|
83
84
|
return Aws::Credentials.new(aws_access_key_id, aws_secret_access_key, aws_session_token) if development_mode?
|
84
|
-
|
85
|
+
|
85
86
|
Aws::Credentials.new(
|
86
87
|
aws_access_key_id,
|
87
88
|
aws_secret_access_key
|
@@ -104,6 +105,10 @@ module Eventboss
|
|
104
105
|
defined_or_default('eventboss_use_default_credentials') { ENV['EVENTBOSS_USE_DEFAULT_CREDENTIALS'] == 'true' }
|
105
106
|
end
|
106
107
|
|
108
|
+
def aws_container_authorization_token_file
|
109
|
+
defined_or_default('aws_container_authorization_token_file') { ENV['AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE'] }
|
110
|
+
end
|
111
|
+
|
107
112
|
def aws_access_key_id
|
108
113
|
defined_or_default('aws_access_key_id') { ENV['AWS_ACCESS_KEY_ID'] }
|
109
114
|
end
|
@@ -1,9 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Eventboss
|
2
4
|
module ErrorHandlers
|
3
5
|
class DbConnectionDropHandler
|
4
6
|
def call(exception, _context = {})
|
5
|
-
|
7
|
+
return unless exception.is_a?(::ActiveRecord::StatementInvalid)
|
8
|
+
|
9
|
+
if Gem::Version.new(ActiveRecord::VERSION::STRING) < Gem::Version.new('8.0.0')
|
6
10
|
::ActiveRecord::Base.clear_active_connections!
|
11
|
+
else
|
12
|
+
::ActiveRecord::Base.connection_handler.clear_active_connections!
|
7
13
|
end
|
8
14
|
end
|
9
15
|
end
|
data/lib/eventboss/runner.rb
CHANGED
@@ -25,6 +25,7 @@ module Eventboss
|
|
25
25
|
Eventboss::DevelopmentMode.setup_infrastructure(queues) if config.development_mode?
|
26
26
|
|
27
27
|
begin
|
28
|
+
validate_client!(client, config)
|
28
29
|
launcher.start
|
29
30
|
handle_signals(self_read, launcher)
|
30
31
|
rescue Interrupt
|
@@ -35,6 +36,18 @@ module Eventboss
|
|
35
36
|
|
36
37
|
private
|
37
38
|
|
39
|
+
def validate_client!(client, config)
|
40
|
+
provider = client.config.credentials.class
|
41
|
+
|
42
|
+
if config.aws_container_authorization_token_file && provider != Aws::ECSCredentials
|
43
|
+
logger.error('runner') do
|
44
|
+
"AWS client was initiated with wrong credentials provider: #{provider}. " \
|
45
|
+
"Expected: Aws::ECSCredentials. Shutting down."
|
46
|
+
end
|
47
|
+
exit 1
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
38
51
|
def setup_signals(signals)
|
39
52
|
self_read, self_write = IO.pipe
|
40
53
|
|
data/lib/eventboss/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventboss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AirHelp
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: aws-sdk-sqs
|
@@ -117,6 +116,7 @@ extensions: []
|
|
117
116
|
extra_rdoc_files: []
|
118
117
|
files:
|
119
118
|
- ".github/workflows/bundler_audit.yml"
|
119
|
+
- ".github/workflows/publish_gem.yml"
|
120
120
|
- ".github/workflows/rspec.yml"
|
121
121
|
- ".gitignore"
|
122
122
|
- ".rspec"
|
@@ -169,7 +169,6 @@ homepage: https://github.com/AirHelp/eventboss
|
|
169
169
|
licenses:
|
170
170
|
- MIT
|
171
171
|
metadata: {}
|
172
|
-
post_install_message:
|
173
172
|
rdoc_options: []
|
174
173
|
require_paths:
|
175
174
|
- lib
|
@@ -184,8 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
183
|
- !ruby/object:Gem::Version
|
185
184
|
version: '0'
|
186
185
|
requirements: []
|
187
|
-
rubygems_version: 3.
|
188
|
-
signing_key:
|
186
|
+
rubygems_version: 3.6.9
|
189
187
|
specification_version: 4
|
190
188
|
summary: Eventboss Ruby Client.
|
191
189
|
test_files: []
|