outpunch-ruby-rack 0.5.2 → 0.5.3

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: d3e1b01d86542ef52a14865e31cdbae58454d4a0065172f00fc92e1e0166d6e4
4
- data.tar.gz: 1da43098f918202a2fb5524f694eca038714ae90daa0206a31b4a5e514fde421
3
+ metadata.gz: cb2b9dfeba8c25542db1a3df0ae79e4840f9cc190c0deac826bbc48bc338c125
4
+ data.tar.gz: 8769eac933b3dc8b444e5ea862dee689c0872e8fb5bb5b7384fa402d65e6f182
5
5
  SHA512:
6
- metadata.gz: b5fb0cf93d9ad4d4506bb0b71ab129495d9d93e4836e388e420e8d4ed58f4048c08166acc4017ad0a4ce8c318a7efb1bb61104293fc70a52d05504a86aec9c0c
7
- data.tar.gz: eaa3559de7f8aa2623c4bae0098ebde5931f13d60ef5f2049284953049ac38c46d37d94131610442772f00cb64b738cf128e2958eadaee574ded5cec794a3fc3
6
+ metadata.gz: 0edbffb667ee2b8c8f811fa3d5752c693542e14f7236429d1c9a35b4347d3329d24eaa8947ca03806fc3037f827a12c3bc6fa1892003c915506bd83585f453b1
7
+ data.tar.gz: '0946c3a11e43bdc88da7b3434a0c54a80e58aba7497546b761d695d6a03834616fe185903c5bd84f3f59270eaf9b2716947e294306b0950bb3926109b8060b3c'
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Outpunch
4
+ # Raised by a tunnel hook (e.g. before_proxy) to short-circuit proxying with a
5
+ # deliberate HTTP status + body, instead of letting the request forward upstream.
6
+ #
7
+ # The tunnel controller rescues this *before* its catch-all, so the client gets the
8
+ # hook's chosen status (e.g. 402 for a billing gate) rather than a generic 502. This
9
+ # keeps the gem product-agnostic: the gem provides the halt mechanism; what a halt
10
+ # means (billing, quota, …) lives in the application's hook.
11
+ class HookHalt < StandardError
12
+ attr_reader :status, :body
13
+
14
+ def initialize(status, body)
15
+ @status = status
16
+ @body = body
17
+ super("HookHalt #{status}")
18
+ end
19
+ end
20
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Outpunch
4
4
  module Rack
5
- VERSION = "0.5.2"
5
+ VERSION = "0.5.3"
6
6
  end
7
7
  end
data/lib/outpunch/rack.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "rack/version"
4
+ require_relative "hook_halt"
4
5
  require_relative "rack/hooks"
5
6
  require_relative "rack/server"
6
7
  require_relative "rack/connection"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: outpunch-ruby-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - TechyCorp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-29 00:00:00.000000000 Z
11
+ date: 2026-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket-driver
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.5.2
33
+ version: 0.5.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.5.2
40
+ version: 0.5.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -101,6 +101,7 @@ extensions: []
101
101
  extra_rdoc_files: []
102
102
  files:
103
103
  - lib/outpunch-ruby-rack.rb
104
+ - lib/outpunch/hook_halt.rb
104
105
  - lib/outpunch/rack.rb
105
106
  - lib/outpunch/rack/connection.rb
106
107
  - lib/outpunch/rack/hooks.rb