delivery_boy 1.1.0 → 1.2.0

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: a12782da215edcc91544e184fd5804b2c21fb4a4be180f69addd0e2f7787884e
4
- data.tar.gz: 6de9279ba3441524aceef6091a4feaf57d67a8623499779877b39ed9a11edad9
3
+ metadata.gz: 68b4c9faf508180a345d2b9009b4ba48ba7892e71cb7c652931111a7fb35733d
4
+ data.tar.gz: 598ce8b8497f179daf5608fb16ae7f33c2c7fbd9bbe704f251f425c4f919d970
5
5
  SHA512:
6
- metadata.gz: 6787bea888f6a2db4bb0d66eaad3c2234c9b6e4482c81ec69e43c27960b4c4a191ec553c0a24c87a46c5067811e2b9eb85265b34fc9457692465dfa8d902c5af
7
- data.tar.gz: e10d3020dbaedfe5608fab51e6e1d343341919aab23b905766cdc386e2b844d5177d464fba93d69b79cc6d3704a5ad703ca97464f5754a363a9d362fecec2559
6
+ metadata.gz: d0502bffd4dd32445d92fc6f3899e6d1c1bd450ee93402202d0a0cb069be3f824c6dfb650c4d649fbc7ba79b616898e3ea4a9fe945df89fd495450d5b507b77b
7
+ data.tar.gz: 2156cc7f694f9b8e20683699bf12357504774e8e74b66dfe140ba8b692d322de55ab7bbdffa437705dff0e2a49fd6dcff7b2c3d44d2d2935ee2bc72696f85754
@@ -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']
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: zendesk/checkout@v3
34
+
35
+ - name: Set up Ruby
36
+ uses: zendesk/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,12 @@
1
+ name: Publish Gem
2
+
3
+ on:
4
+ push:
5
+ tags: v*
6
+
7
+ jobs:
8
+ call-workflow:
9
+ uses: zendesk/gw/.github/workflows/ruby-gem-publication.yml@main
10
+ secrets:
11
+ RUBY_GEMS_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }}
12
+ RUBY_GEMS_TOTP_DEVICE: ${{ secrets.RUBY_GEMS_TOTP_DEVICE }}
@@ -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,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v1.2.0
6
+
7
+ * Test with Ruby 3.1 & 3.2
8
+ * Add config support for AWS MSK IAM auth (#66)
9
+
5
10
  ## v1.1.0
6
11
 
7
12
  * Support for `ssl_client_cert_key_password` in the configuration (#52)
data/README.md CHANGED
@@ -267,7 +267,45 @@ DeliveryBoy.configure do |config|
267
267
  config.ssl_ca_certs_from_system = true
268
268
  end
269
269
  ```
270
+ #### AWS MSK IAM Authentication and Authorization
270
271
 
272
+ ##### sasl_aws_msk_iam_access_key_id
273
+
274
+ The AWS IAM access key. Required.
275
+
276
+ ##### sasl_aws_msk_iam_secret_key_id
277
+
278
+ The AWS IAM secret access key. Required.
279
+
280
+ ##### sasl_aws_msk_iam_aws_region
281
+
282
+ The AWS region. Required.
283
+
284
+ ##### sasl_aws_msk_iam_session_token
285
+
286
+ The session token. This value can be optional.
287
+
288
+ ###### Examples
289
+
290
+ Using a role arn and web identity token to generate temporary credentials:
291
+
292
+ ```ruby
293
+ require "aws-sdk-core"
294
+ require "delivery_boy"
295
+
296
+ role = Aws::AssumeRoleWebIdentityCredentials.new(
297
+ role_arn: ENV["AWS_ROLE_ARN"],
298
+ web_identity_token_file: ENV["AWS_WEB_IDENTITY_TOKEN_FILE"]
299
+ )
300
+
301
+ DeliveryBoy.configure do |c|
302
+ c.sasl_aws_msk_iam_access_key_id = role.credentials.access_key_id
303
+ c.sasl_aws_msk_iam_secret_key_id = role.credentials.secret_access_key
304
+ c.sasl_aws_msk_iam_session_token = role.credentials.session_token
305
+ c.sasl_aws_msk_iam_aws_region = ENV["AWS_REGION"]
306
+ c.ssl_ca_certs_from_system = true
307
+ end
308
+ ```
271
309
 
272
310
  ### Testing
273
311
 
data/delivery_boy.gemspec CHANGED
@@ -20,10 +20,9 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_runtime_dependency "ruby-kafka", "~> 1.0"
23
+ spec.add_runtime_dependency "ruby-kafka", "~> 1.5"
24
24
  spec.add_runtime_dependency "king_konf", "~> 1.0"
25
25
 
26
- spec.add_development_dependency "bundler", "~> 1.15"
27
- spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "rake", "~> 13.0"
28
27
  spec.add_development_dependency "rspec", "~> 3.0"
29
28
  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.2.0"
3
3
  end
data/lib/delivery_boy.rb CHANGED
@@ -122,6 +122,10 @@ module DeliveryBoy
122
122
  raise ConfigError, e.message
123
123
  end
124
124
 
125
+ def clear_config!
126
+ @config = nil
127
+ end
128
+
125
129
  # Configure DeliveryBoy in a block.
126
130
  #
127
131
  # DeliveryBoy.configure do |config|
metadata CHANGED
@@ -1,14 +1,14 @@
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.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-21 00:00:00.000000000 Z
11
+ date: 2024-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-kafka
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '1.5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: king_konf
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,34 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  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
41
  - !ruby/object:Gem::Dependency
56
42
  name: rake
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '10.0'
47
+ version: '13.0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: '10.0'
54
+ version: '13.0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rspec
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -87,10 +73,11 @@ executables: []
87
73
  extensions: []
88
74
  extra_rdoc_files: []
89
75
  files:
90
- - ".circleci/config.yml"
76
+ - ".github/workflows/ci.yml"
77
+ - ".github/workflows/publish.yml"
78
+ - ".github/workflows/stale.yml"
91
79
  - ".gitignore"
92
80
  - ".rspec"
93
- - ".travis.yml"
94
81
  - CHANGELOG
95
82
  - Gemfile
96
83
  - LICENSE.txt
@@ -130,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
117
  - !ruby/object:Gem::Version
131
118
  version: '0'
132
119
  requirements: []
133
- rubygems_version: 3.1.2
120
+ rubygems_version: 3.5.3
134
121
  signing_key:
135
122
  specification_version: 4
136
123
  summary: A simple way to produce messages to Kafka from Ruby applications
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