delivery_boy 1.1.0 → 1.3.0

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: a12782da215edcc91544e184fd5804b2c21fb4a4be180f69addd0e2f7787884e
4
- data.tar.gz: 6de9279ba3441524aceef6091a4feaf57d67a8623499779877b39ed9a11edad9
3
+ metadata.gz: e863dcfb898dcf7fe8dd0c612a62ebf2500973f3bb27a44995b97da2c654a22f
4
+ data.tar.gz: 4066557f80b51864858c92379d7db945734f32b001a0ba8dc153b8f5a637b54a
5
5
  SHA512:
6
- metadata.gz: 6787bea888f6a2db4bb0d66eaad3c2234c9b6e4482c81ec69e43c27960b4c4a191ec553c0a24c87a46c5067811e2b9eb85265b34fc9457692465dfa8d902c5af
7
- data.tar.gz: e10d3020dbaedfe5608fab51e6e1d343341919aab23b905766cdc386e2b844d5177d464fba93d69b79cc6d3704a5ad703ca97464f5754a363a9d362fecec2559
6
+ metadata.gz: 600f533b94ff8268e5d5dea5a02b63e3642646837b3d0ec97a1b77ae28c9e9ec7dd1e7b6bb71410762f47c1da567e1a2004c0bc1b1af2a4ca0d67db847843213
7
+ data.tar.gz: 48838d583b5b6e0636b1d92262a22279627ba60a027c86615ec4dfae5d9df15f8de92243c026beaefb2506b6ab4cc49623b3eb5363cac186bf5788c308d32192
@@ -0,0 +1,47 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: CI
9
+
10
+ on:
11
+ push:
12
+ branches: [ "main" ]
13
+ pull_request:
14
+ branches: [ "main" ]
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ test:
21
+
22
+ runs-on: ubuntu-latest
23
+ strategy:
24
+ matrix:
25
+ ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
26
+
27
+ steps:
28
+ - name: Run Confluent Platform (Confluent Server)
29
+ uses: zendesk/cp-all-in-one-action@v0.2.1
30
+ with:
31
+ service: broker
32
+
33
+ - uses: actions/checkout@v4
34
+
35
+ - name: Set up Ruby
36
+ uses: ruby/setup-ruby@v1
37
+ with:
38
+ ruby-version: ${{ matrix.ruby-version }}
39
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
40
+
41
+ - name: Wait for broker to boot
42
+ run: 'while ! nc -z localhost 9092; do echo -n "."; sleep 0.1; done'
43
+
44
+ - name: Run tests
45
+ run: bundle exec rake
46
+ env:
47
+ DELIVERY_BOY_BROKERS: localhost:9092
@@ -0,0 +1,26 @@
1
+ name: Publish to RubyGems.org
2
+
3
+ on:
4
+ push:
5
+ branches: main
6
+ paths: lib/delivery_boy/version.rb
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ publish:
11
+ runs-on: ubuntu-latest
12
+ environment: rubygems-publish
13
+ if: github.repository_owner == 'zendesk'
14
+ permissions:
15
+ id-token: write
16
+ contents: write
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ bundler-cache: false
23
+ ruby-version: "3.4"
24
+ - name: Install dependencies
25
+ run: bundle install
26
+ - uses: rubygems/release-gem@v1
@@ -0,0 +1,27 @@
1
+ # This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
2
+ #
3
+ # You can adjust the behavior by modifying this file.
4
+ # For more information, see:
5
+ # https://github.com/actions/stale
6
+ name: Mark stale issues and pull requests
7
+
8
+ on:
9
+ schedule:
10
+ - cron: '40 6 * * *'
11
+
12
+ jobs:
13
+ stale:
14
+
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ issues: write
18
+ pull-requests: write
19
+
20
+ steps:
21
+ - uses: actions/stale@v5
22
+ with:
23
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
24
+ stale-issue-message: 'This issue has been marked as stale due to a lack of activity. It will be closed in 7 days unless there is new activity.'
25
+ stale-pr-message: 'This PR has been marked as stale due to a lack of activity. It will be closed in 7 days unless there is new activity.'
26
+ stale-issue-label: 'no-issue-activity'
27
+ stale-pr-label: 'no-pr-activity'
data/CHANGELOG CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v1.3.0
6
+
7
+ * Remove the `DeliveryBoy::Instance` instance when calling
8
+ `DeliveryBoy.shutdown`. (#82)
9
+ * Test with Ruby 3.3 & 3.4.
10
+
11
+ ## v1.2.0
12
+
13
+ * Test with Ruby 3.1 & 3.2.
14
+ * Add config support for AWS MSK IAM auth (#66)
15
+
5
16
  ## v1.1.0
6
17
 
7
18
  * Support for `ssl_client_cert_key_password` in the configuration (#52)
data/Gemfile CHANGED
@@ -1,6 +1,8 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in delivery_boy.gemspec
6
3
  gemspec
4
+
5
+ gem "base64"
6
+ gem "bigdecimal"
7
+ gem "rake", "~> 13.0"
8
+ gem "rspec", "~> 3.0"
data/README.md CHANGED
@@ -70,7 +70,7 @@ A third method is to produce messages first (without delivering the messages to
70
70
  event = {
71
71
  name: "comment_created",
72
72
  data: {
73
- comment_id: @comment.id
73
+ comment_id: @comment.id,
74
74
  user_id: current_user.id
75
75
  }
76
76
  }
@@ -268,6 +268,45 @@ DeliveryBoy.configure do |config|
268
268
  end
269
269
  ```
270
270
 
271
+ #### AWS MSK IAM Authentication and Authorization
272
+
273
+ ##### sasl_aws_msk_iam_access_key_id
274
+
275
+ The AWS IAM access key. Required.
276
+
277
+ ##### sasl_aws_msk_iam_secret_key_id
278
+
279
+ The AWS IAM secret access key. Required.
280
+
281
+ ##### sasl_aws_msk_iam_aws_region
282
+
283
+ The AWS region. Required.
284
+
285
+ ##### sasl_aws_msk_iam_session_token
286
+
287
+ The session token. This value can be optional.
288
+
289
+ ###### Examples
290
+
291
+ Using a role arn and web identity token to generate temporary credentials:
292
+
293
+ ```ruby
294
+ require "aws-sdk-core"
295
+ require "delivery_boy"
296
+
297
+ role = Aws::AssumeRoleWebIdentityCredentials.new(
298
+ role_arn: ENV["AWS_ROLE_ARN"],
299
+ web_identity_token_file: ENV["AWS_WEB_IDENTITY_TOKEN_FILE"]
300
+ )
301
+
302
+ DeliveryBoy.configure do |c|
303
+ c.sasl_aws_msk_iam_access_key_id = role.credentials.access_key_id
304
+ c.sasl_aws_msk_iam_secret_key_id = role.credentials.secret_access_key
305
+ c.sasl_aws_msk_iam_session_token = role.credentials.session_token
306
+ c.sasl_aws_msk_iam_aws_region = ENV["AWS_REGION"]
307
+ c.ssl_ca_certs_from_system = true
308
+ end
309
+ ```
271
310
 
272
311
  ### Testing
273
312
 
@@ -314,6 +353,20 @@ Since DeliveryBoy is just an opinionated API on top of ruby-kafka, you can use a
314
353
 
315
354
  Bug reports and pull requests are welcome on [GitHub](https://github.com/zendesk/delivery_boy). Feel free to [join our Slack team](https://ruby-kafka-slack.herokuapp.com/) and ask how best to contribute!
316
355
 
356
+ ### Releasing a new version
357
+ A new version is published to RubyGems.org every time a change to `version.rb` is pushed to the `main` branch.
358
+ In short, follow these steps:
359
+ 1. Update `version.rb`,
360
+ 2. merge this change into `main`, and
361
+ 3. look at [the action](https://github.com/zendesk/delivery_boy/actions/workflows/publish.yml) for output.
362
+
363
+ To create a pre-release from a non-main branch:
364
+ 1. change the version in `version.rb` to something like `1.2.0.pre.1` or `2.0.0.beta.2`,
365
+ 2. push this change to your branch,
366
+ 3. go to [Actions → “Publish to RubyGems.org” on GitHub](https://github.com/zendesk/delivery_boy/actions/workflows/publish.yml),
367
+ 4. click the “Run workflow” button,
368
+ 5. pick your branch from a dropdown.
369
+
317
370
  ## Support and Discussion
318
371
 
319
372
  If you've discovered a bug, please file a [Github issue](https://github.com/zendesk/delivery_boy/issues/new), and make sure to include all the relevant information, including the version of DeliveryBoy, ruby-kafka, and Kafka that you're using.
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require "bundler/setup"
1
2
  require "bundler/gem_tasks"
2
3
  require "rspec/core/rake_task"
3
4
 
data/delivery_boy.gemspec CHANGED
@@ -20,10 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_runtime_dependency "ruby-kafka", "~> 1.0"
24
- spec.add_runtime_dependency "king_konf", "~> 1.0"
25
-
26
- spec.add_development_dependency "bundler", "~> 1.15"
27
- spec.add_development_dependency "rake", "~> 10.0"
28
- spec.add_development_dependency "rspec", "~> 3.0"
23
+ spec.add_dependency "ruby-kafka", "~> 1.5"
24
+ spec.add_dependency "king_konf", "~> 1.0"
29
25
  end
@@ -20,7 +20,7 @@ module DeliveryBoy
20
20
 
21
21
  # Delivery
22
22
  integer :ack_timeout, default: 5
23
- integer :delivery_interval, default: 10
23
+ float :delivery_interval, default: 10
24
24
  integer :delivery_threshold, default: 100
25
25
  integer :max_retries, default: 2
26
26
  integer :required_acks, default: -1
@@ -56,6 +56,12 @@ module DeliveryBoy
56
56
  # SASL OAUTHBEARER
57
57
  attr_accessor :sasl_oauth_token_provider
58
58
 
59
+ # AWS IAM authentication
60
+ string :sasl_aws_msk_iam_access_key_id
61
+ string :sasl_aws_msk_iam_secret_key_id
62
+ string :sasl_aws_msk_iam_aws_region
63
+ string :sasl_aws_msk_iam_session_token, default: nil
64
+
59
65
  # Datadog monitoring
60
66
  boolean :datadog_enabled
61
67
  string :datadog_host
@@ -96,7 +96,11 @@ module DeliveryBoy
96
96
  sasl_scram_password: config.sasl_scram_password,
97
97
  sasl_scram_mechanism: config.sasl_scram_mechanism,
98
98
  sasl_over_ssl: config.sasl_over_ssl,
99
- sasl_oauth_token_provider: config.sasl_oauth_token_provider
99
+ sasl_oauth_token_provider: config.sasl_oauth_token_provider,
100
+ sasl_aws_msk_iam_access_key_id: config.sasl_aws_msk_iam_access_key_id,
101
+ sasl_aws_msk_iam_secret_key_id: config.sasl_aws_msk_iam_secret_key_id,
102
+ sasl_aws_msk_iam_session_token: config.sasl_aws_msk_iam_session_token,
103
+ sasl_aws_msk_iam_aws_region: config.sasl_aws_msk_iam_aws_region
100
104
  )
101
105
  end
102
106
 
@@ -1,3 +1,3 @@
1
1
  module DeliveryBoy
2
- VERSION = "1.1.0"
2
+ VERSION = "1.3.0"
3
3
  end
data/lib/delivery_boy.rb CHANGED
@@ -98,6 +98,7 @@ module DeliveryBoy
98
98
  # @return [nil]
99
99
  def shutdown
100
100
  instance.shutdown
101
+ @instance = nil
101
102
  end
102
103
 
103
104
  # The logger used by DeliveryBoy.
@@ -122,6 +123,10 @@ module DeliveryBoy
122
123
  raise ConfigError, e.message
123
124
  end
124
125
 
126
+ def clear_config!
127
+ @config = nil
128
+ end
129
+
125
130
  # Configure DeliveryBoy in a block.
126
131
  #
127
132
  # DeliveryBoy.configure do |config|
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delivery_boy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-01-21 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: ruby-kafka
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '1.0'
18
+ version: '1.5'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '1.0'
25
+ version: '1.5'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: king_konf
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -38,48 +37,6 @@ dependencies:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
39
  version: '1.0'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.15'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.15'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '10.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '10.0'
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '3.0'
83
40
  description: A simple way to produce messages to Kafka from Ruby applications
84
41
  email:
85
42
  - daniel.schierbeck@gmail.com
@@ -87,10 +44,11 @@ executables: []
87
44
  extensions: []
88
45
  extra_rdoc_files: []
89
46
  files:
90
- - ".circleci/config.yml"
47
+ - ".github/workflows/ci.yml"
48
+ - ".github/workflows/publish.yml"
49
+ - ".github/workflows/stale.yml"
91
50
  - ".gitignore"
92
51
  - ".rspec"
93
- - ".travis.yml"
94
52
  - CHANGELOG
95
53
  - Gemfile
96
54
  - LICENSE.txt
@@ -115,7 +73,6 @@ homepage: https://github.com/zendesk/delivery_boy
115
73
  licenses:
116
74
  - Apache License Version 2.0
117
75
  metadata: {}
118
- post_install_message:
119
76
  rdoc_options: []
120
77
  require_paths:
121
78
  - lib
@@ -130,8 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
87
  - !ruby/object:Gem::Version
131
88
  version: '0'
132
89
  requirements: []
133
- rubygems_version: 3.1.2
134
- signing_key:
90
+ rubygems_version: 3.6.7
135
91
  specification_version: 4
136
92
  summary: A simple way to produce messages to Kafka from Ruby applications
137
93
  test_files: []
data/.circleci/config.yml DELETED
@@ -1,33 +0,0 @@
1
- version: 2
2
- jobs:
3
- build:
4
- docker:
5
- - image: circleci/ruby:2.5.1-node
6
- environment:
7
- LOG_LEVEL: DEBUG
8
- - image: wurstmeister/zookeeper
9
- - image: wurstmeister/kafka:2.11-2.0.0
10
- environment:
11
- KAFKA_ADVERTISED_HOST_NAME: localhost
12
- KAFKA_ADVERTISED_PORT: 9092
13
- KAFKA_PORT: 9092
14
- KAFKA_ZOOKEEPER_CONNECT: localhost:2181
15
- KAFKA_DELETE_TOPIC_ENABLE: true
16
- - image: wurstmeister/kafka:2.11-2.0.0
17
- environment:
18
- KAFKA_ADVERTISED_HOST_NAME: localhost
19
- KAFKA_ADVERTISED_PORT: 9093
20
- KAFKA_PORT: 9093
21
- KAFKA_ZOOKEEPER_CONNECT: localhost:2181
22
- KAFKA_DELETE_TOPIC_ENABLE: true
23
- - image: wurstmeister/kafka:2.11-2.0.0
24
- environment:
25
- KAFKA_ADVERTISED_HOST_NAME: localhost
26
- KAFKA_ADVERTISED_PORT: 9094
27
- KAFKA_PORT: 9094
28
- KAFKA_ZOOKEEPER_CONNECT: localhost:2181
29
- KAFKA_DELETE_TOPIC_ENABLE: true
30
- steps:
31
- - checkout
32
- - run: bundle install --path vendor/bundle
33
- - run: bundle exec rspec
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.2.3
5
- before_install: gem install bundler -v 1.15.3