jetstream_bridge 7.1.0 → 7.1.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: 290f604d47d1605f6c2b2abcde100159327a7418b103c0c054b0b92f5e7fbf56
4
- data.tar.gz: 485e9cf4070d9671a1994ffbde32ab8ca6e41fbfb7d94d8cf571e2e8ec04cd3b
3
+ metadata.gz: 65a794cf3e9a17511c64f2ef29edc70d56214f4cfc1c63eed8148afb65e05505
4
+ data.tar.gz: 44dea5d3d1900999fc788aad9e9d676a02315c18678256f4ce14d5443cb0b816
5
5
  SHA512:
6
- metadata.gz: a1a17ed6a75d8f9b32de3efbe23da1797824c4e846c0d4d73ee1014d9ea20048367088cfaabd3f9a02179314090741237d21dffc0c618a429a47510597bb1ed8
7
- data.tar.gz: f3ae4a9e9b256f4dfa1d1e84a32d66140ae01c52d07f21b8fac7976c61bb76a81cb83a53aae6631af9c0affa81eb24d81b7167ebb18875489e398f7869ebd2d6
6
+ metadata.gz: 360c547ece5e7443487c3796d18139843ea86a2ce7f29a775fd1245d6e084d76bec11df72cdafef78ac9fa383ad99eae680f9220dc9eef451f62ba012fe20de9
7
+ data.tar.gz: 62e2100993ba1defc32df1ad744392148f4600527c5fab80db6cce2d211b80c79d6228c64497e61106ba13fdef9579300df1455d5caf3d4e75a83ccd896a5051
data/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [7.1.1] - 2026-02-02
9
+
10
+ ### Changed
11
+
12
+ - Fail-fast consumer provisioning: when running in push mode with `auto_provision=false`, the bridge now raises `ConsumerProvisioningError` instead of silently skipping consumer setup, preventing idle workers when the durable is missing.
13
+ - Permission-aware creation: consumer creation now surfaces `ConsumerProvisioningError` on permissions violations (pull or push mode), guiding operators to grant the minimal `$JS.API` rights or pre-provision the durable.
14
+
15
+ ### Added
16
+
17
+ - New `ConsumerProvisioningError` topology error for clearer operator feedback when consumer setup cannot proceed.
18
+
8
19
  ## [7.1.0] - 2026-02-01
9
20
 
10
21
  ### Added
@@ -79,6 +79,15 @@ module JetstreamBridge
79
79
  #
80
80
  # @raise [StreamNotFoundError] if the stream doesn't exist
81
81
  def create_consumer_if_missing!
82
+ # In restricted environments (push + auto_provision=false), we still want fail-fast semantics.
83
+ # Attempt creation and raise a clear error so operators know the consumer must be pre-provisioned
84
+ # or the account must allow the minimal $JS.API consumer permissions.
85
+ if skip_consumer_management?
86
+ raise JetstreamBridge::ConsumerProvisioningError,
87
+ "Consumer '#{@durable}' not ensured because auto_provision=false and push mode is enabled. " \
88
+ 'Provision the consumer with admin credentials or grant minimal consumer create/info permissions.'
89
+ end
90
+
82
91
  # First, verify stream exists - fail fast with clear error if not
83
92
  unless stream_exists?
84
93
  raise StreamNotFoundError,
@@ -103,6 +112,8 @@ module JetstreamBridge
103
112
  rescue StreamNotFoundError
104
113
  raise
105
114
  rescue StandardError => e
115
+ raise ConsumerProvisioningError, permission_error_message(e) if permission_denied?(e)
116
+
106
117
  # If creation fails due to consumer already existing (race condition), that's OK
107
118
  msg = e.message.to_s.downcase
108
119
  if msg.include?('already') || msg.include?('exists')
@@ -210,6 +221,21 @@ module JetstreamBridge
210
221
  config
211
222
  end
212
223
 
224
+ def skip_consumer_management?
225
+ @cfg.push_consumer? && !@cfg.auto_provision
226
+ end
227
+
228
+ def permission_denied?(error)
229
+ msg = error.message.to_s.downcase
230
+ msg.include?('permission') || msg.include?('permissions violation')
231
+ end
232
+
233
+ def permission_error_message(error)
234
+ "Consumer '#{@durable}' could not be ensured due to permissions: #{error.message}. " \
235
+ 'Grant $JS.API.STREAM.INFO/$JS.API.CONSUMER.INFO/$JS.API.CONSUMER.CREATE for the stream, ' \
236
+ 'or pre-provision the consumer with an admin account.'
237
+ end
238
+
213
239
  def create_consumer!
214
240
  @jts.add_consumer(stream_name, **desired_consumer_cfg)
215
241
  Logging.info(
@@ -67,6 +67,7 @@ module JetstreamBridge
67
67
 
68
68
  # Topology errors
69
69
  class TopologyError < Error; end
70
+ class ConsumerProvisioningError < TopologyError; end
70
71
  class StreamNotFoundError < TopologyError; end
71
72
  class SubjectOverlapError < TopologyError; end
72
73
  class StreamCreationFailedError < TopologyError; end
@@ -4,5 +4,5 @@
4
4
  #
5
5
  # Version constant for the gem.
6
6
  module JetstreamBridge
7
- VERSION = '7.1.0'
7
+ VERSION = '7.1.1'
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jetstream_bridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.0
4
+ version: 7.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Attara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-01 00:00:00.000000000 Z
11
+ date: 2026-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord