circuitry 3.3.0 → 3.5.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: d200bb856db00d87237c6425d03a31ab5953ac4962f7af81e9797b85f94ee921
4
- data.tar.gz: 1bc9b5eac4c058f5f30ad035ae8f10dabf4921d0f3b35781a528856ba75459c0
3
+ metadata.gz: 97df62f8343b6567a34117f0689cd76347bfcc10df90bd4d16dc21b6b2a8725d
4
+ data.tar.gz: 1f0ad6c207c527eb49c2693afd40d8ca47c911ff8cec739e40d7299744e873a5
5
5
  SHA512:
6
- metadata.gz: be4a3411b0e5a4535049dda1343e901a4abcb2ec81d2b76762dfe75460b1b5941031c0e50d5d3c1bca0b23700350497dfd40e5243b90e449b93ef36b76ab14d2
7
- data.tar.gz: 245564d9b1d16e53b9086acc44446967705dcef54062f0747ae6b8cb50a601fb8822c3ef7444c09bb2e7355519667bb8c1cbfd45e16da29ea018f11d04cc7602
6
+ metadata.gz: e5414b437a23afe45f35ec2f9102a391af8e3f3e6bfec3b585a485891972ed84fe26822f530c0018af82d24da92034ec8c026b4b45295afa580b87b72a478741
7
+ data.tar.gz: 8331142f98db79ef0a72e72fc5075d783ca7b520dd678b0e4a5d6efaa8bfd5140fa603af4cb02c61402cf0d0e6995804936f9441faeb4ddfc484205d5e42bea2
data/.circleci/config.yml CHANGED
@@ -3,7 +3,7 @@ jobs:
3
3
  build:
4
4
  working_directory: ~/circuitry
5
5
  docker:
6
- - image: kapost/ruby:2.4.3-node-6.11.5
6
+ - image: kapost/ruby:2.6.3-node-6.11.5
7
7
  steps:
8
8
  - checkout
9
9
  - run: bundle install
data/CHANGELOG.md CHANGED
@@ -1,7 +1,18 @@
1
+ ## Circuitry 3.5.0 (Jan 27, 2023)
2
+
3
+ * Changes the way SQL Policy statements are generated to avoid triggering an error when more a
4
+ queue subscribes to more than 20 SNS topics.
5
+
6
+ ## Circuitry 3.4.0 (Sep 16, 2020)
7
+
8
+ * Adds an option for publisher and subscriber configs to override the AWS client options. *wahlg*
9
+ See: https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SQS/Client.html
10
+ See: https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SNS/Client.html
11
+
1
12
  ## Circuitry 3.3.0 (June 23, 2020)
2
13
 
3
14
  * Update AWS SDK to version 3 and use module sdk gems. *thogg4*
4
- See https://github.com/aws/aws-sdk-ruby
15
+ See https://github.com/aws/aws-sdk-ruby
5
16
  Version 3 is backwards compatible with version 2.
6
17
  * Catch `Aws::SNS::Errors::InvalidParameter` and rethrow with the topic
7
18
  and message that caused the problem for improved debugging.
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in circuitry.gemspec
4
4
  gemspec
5
5
 
6
- gem 'memcache_mock', '0.0.14', github: 'mhuggins/MemcacheMock', branch: 'expiry-and-add'
6
+ gem 'memcache_mock', '0.0.14', git: 'https://github.com/mhuggins/MemcacheMock', branch: 'expiry-and-add'
data/README.md CHANGED
@@ -150,6 +150,8 @@ Available configuration options for *both* subscriber and publisher applications
150
150
  * `middleware`: A chain of middleware that messages must go through when sent or received.
151
151
  Please refer to the [Middleware](#middleware) section for more details regarding this
152
152
  option.
153
+ * `aws_options_overrides`: A key/value hash of option overrides and additions passed through to the
154
+ [`AWS::SQS::Client`](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SQS/Client.html)(for subscriber config) or [`AWS::SNS::Client`](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SNS/Client.html)(for publisher config)
153
155
 
154
156
  Available configuration options for subscriber applications include:
155
157
 
data/circuitry.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'virtus', '~> 1.0'
27
27
  spec.add_dependency 'thor'
28
28
 
29
- spec.add_development_dependency 'bundler', '~> 1.8'
29
+ spec.add_development_dependency 'bundler', '~> 1.17.0'
30
30
  spec.add_development_dependency 'simplecov'
31
31
  spec.add_development_dependency 'connection_pool'
32
32
  spec.add_development_dependency 'dalli'
@@ -15,6 +15,7 @@ module Circuitry
15
15
  base.attribute :topic_names, Array[String], default: []
16
16
  base.attribute :on_async_exit
17
17
  base.attribute :async_strategy, Symbol, default: ->(_page, _att) { :fork }
18
+ base.attribute :aws_options_overrides, Hash, default: {}
18
19
  end
19
20
 
20
21
  def middleware
@@ -27,7 +28,8 @@ module Circuitry
27
28
  {
28
29
  access_key_id: access_key,
29
30
  secret_access_key: secret_key,
30
- region: region
31
+ region: region,
32
+ **aws_options_overrides
31
33
  }
32
34
  end
33
35
 
@@ -43,20 +43,20 @@ module Circuitry
43
43
  'Policy' => {
44
44
  'Version' => '2012-10-17',
45
45
  'Id' => "#{queue.arn}/SNSPolicy",
46
- 'Statement' => topics.map { |t| build_policy_statement(t) }
46
+ 'Statement' => [build_policy_statement]
47
47
  }.to_json
48
48
  }
49
49
  end
50
50
 
51
- def build_policy_statement(topic)
51
+ def build_policy_statement
52
52
  {
53
- 'Sid' => "Sid#{topic.name}",
53
+ 'Sid' => "Sid-#{queue.name}-subscriptions",
54
54
  'Effect' => 'Allow',
55
55
  'Principal' => { 'AWS' => '*' },
56
56
  'Action' => 'SQS:SendMessage',
57
57
  'Resource' => queue.arn,
58
58
  'Condition' => {
59
- 'ArnEquals' => { 'aws:SourceArn' => topic.arn }
59
+ 'ForAnyValue:ArnEquals' => { 'aws:SourceArn' => topics.map(&:arn) }
60
60
  }
61
61
  }
62
62
  end
@@ -1,3 +1,3 @@
1
1
  module Circuitry
2
- VERSION = '3.3.0'
2
+ VERSION = '3.5.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circuitry
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Huggins
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-06-26 00:00:00.000000000 Z
12
+ date: 2023-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-sqs
@@ -87,14 +87,14 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '1.8'
90
+ version: 1.17.0
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '1.8'
97
+ version: 1.17.0
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: simplecov
100
100
  requirement: !ruby/object:Gem::Requirement