karafka 2.2.0 → 2.2.1

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: 6ca6426dc8527aac122a1d9ebcaccf33a4eff1608133b210e68e66d3a5f5c2c7
4
- data.tar.gz: 85233cc04e591e5a96d53b3b9d3fe203b4b56bbde24c564ffa3663daeb3673c6
3
+ metadata.gz: a96aaf1f1cc1fadbeb09477a107efc11319f288b0e5d94f959813d7f85d295bf
4
+ data.tar.gz: b0db0711ceb51856771ba6906c0868f51637d78bd785c25005408449d32a3302
5
5
  SHA512:
6
- metadata.gz: e89b72adccdb6a622d571ab9c580191e725cdb98d88f5d86f59d9e4a9900eff74fa438b3838cfe104f7259c0c4cee0dc60f7fb6d16cf14b59ff9229170bae504
7
- data.tar.gz: a8ba4b92e1002c6d1112837e1b96706208ba0d55fa39feaadaa4f04f4c616095eb406d72bffa50bd346fb1daff7ca45951efd2237a71c25a7539be5a4397a781
6
+ metadata.gz: 7c37db7c2de5b131f34c08fe73e4453ea81d0ec99b4a5764b41ca98c7c8ff064b1b9f8bfee5e26bbae267ca77b3b5e72d72d90c9b4e034c6ead0d90b931f1fa9
7
+ data.tar.gz: 55131983670c0454f3f5a23df2b0d90b8718455f8f331ee660cd20dd3f131540188149f36efbb7842fe1561de4cb7f85d8892477deefbd1eb0c071722f2ffa72
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Karafka framework changelog
2
2
 
3
+ ## 2.2.1 (2023-09-01)
4
+ - [Fix] Fix insufficient validation of named patterns
5
+ - [Maintenance] Rely on `2.2.x` `karafka-core`.
6
+
3
7
  ## 2.2.0 (2023-09-01)
4
8
  - **[Feature]** Introduce dynamic topic subscriptions based on patterns [Pro].
5
9
  - [Enhancement] Allow for `Karafka::Admin` setup reconfiguration via `config.admin` scope.
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka (2.2.0)
5
- karafka-core (>= 2.1.1, < 2.2.0)
4
+ karafka (2.2.1)
5
+ karafka-core (>= 2.2.0, < 2.3.0)
6
6
  thor (>= 0.20)
7
7
  waterdrop (>= 2.6.6, < 3.0.0)
8
8
  zeitwerk (~> 2.3)
@@ -23,14 +23,14 @@ GEM
23
23
  diff-lcs (1.5.0)
24
24
  docile (1.4.0)
25
25
  erubi (1.12.0)
26
- factory_bot (6.2.1)
26
+ factory_bot (6.3.0)
27
27
  activesupport (>= 5.0.0)
28
28
  ffi (1.15.5)
29
29
  globalid (1.1.0)
30
30
  activesupport (>= 5.0)
31
31
  i18n (1.14.1)
32
32
  concurrent-ruby (~> 1.0)
33
- karafka-core (2.1.1)
33
+ karafka-core (2.2.0)
34
34
  concurrent-ruby (>= 1.1)
35
35
  karafka-rdkafka (>= 0.13.1, < 0.14.0)
36
36
  karafka-rdkafka (0.13.4)
data/karafka.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  without having to focus on things that are not your business domain.
22
22
  DESC
23
23
 
24
- spec.add_dependency 'karafka-core', '>= 2.1.1', '< 2.2.0'
24
+ spec.add_dependency 'karafka-core', '>= 2.2.0', '< 2.3.0'
25
25
  spec.add_dependency 'thor', '>= 0.20'
26
26
  spec.add_dependency 'waterdrop', '>= 2.6.6', '< 3.0.0'
27
27
  spec.add_dependency 'zeitwerk', '~> 2.3'
@@ -53,7 +53,7 @@ module Karafka
53
53
  # topic but this minimizes simple mistakes
54
54
  #
55
55
  # This sub-part of sh1 should be unique enough and short-enough to use it here
56
- digest = Digest::SHA1.hexdigest(regexp.source)[8..16]
56
+ digest = Digest::SHA1.hexdigest(safe_regexp.source)[8..16]
57
57
  @name = name ? name.to_s : "karafka-pattern-#{digest}"
58
58
  @config = config
59
59
  end
@@ -62,7 +62,7 @@ module Karafka
62
62
  # librdkafka expectations. We use it as a subscription name for initial patterns
63
63
  # subscription start.
64
64
  def regexp_string
65
- "^#{regexp.source}"
65
+ "^#{safe_regexp.source}"
66
66
  end
67
67
 
68
68
  # @return [Hash] hash representation of this routing pattern
@@ -73,6 +73,20 @@ module Karafka
73
73
  regexp_string: regexp_string
74
74
  }.freeze
75
75
  end
76
+
77
+ private
78
+
79
+ # Since pattern building happens before validations and we rely internally on the fact
80
+ # that regexp is provided and nothing else, we here "sanitize" the regexp for our
81
+ # internal usage. Karafka will not run anyhow because our post-routing contracts will
82
+ # prevent it from running but internally in this component we need to ensure, that
83
+ # prior to the validations we operate on a regexp
84
+ #
85
+ # @return [Regexp] returns a regexp always even if what we've received was not a regexp
86
+ def safe_regexp
87
+ # This regexp will never match anything
88
+ regexp.is_a?(Regexp) ? regexp : /$a/
89
+ end
76
90
  end
77
91
  end
78
92
  end
@@ -3,5 +3,5 @@
3
3
  # Main module namespace
4
4
  module Karafka
5
5
  # Current Karafka version
6
- VERSION = '2.2.0'
6
+ VERSION = '2.2.1'
7
7
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -43,20 +43,20 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 2.1.1
46
+ version: 2.2.0
47
47
  - - "<"
48
48
  - !ruby/object:Gem::Version
49
- version: 2.2.0
49
+ version: 2.3.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 2.1.1
56
+ version: 2.2.0
57
57
  - - "<"
58
58
  - !ruby/object:Gem::Version
59
- version: 2.2.0
59
+ version: 2.3.0
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: thor
62
62
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file