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 +4 -4
- data/lib/outpunch/hook_halt.rb +20 -0
- data/lib/outpunch/rack/version.rb +1 -1
- data/lib/outpunch/rack.rb +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb2b9dfeba8c25542db1a3df0ae79e4840f9cc190c0deac826bbc48bc338c125
|
|
4
|
+
data.tar.gz: 8769eac933b3dc8b444e5ea862dee689c0872e8fb5bb5b7384fa402d65e6f182
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/outpunch/rack.rb
CHANGED
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.
|
|
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-
|
|
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.
|
|
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.
|
|
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
|