patchwork-rb 0.1.2 → 0.1.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/patchwork/gateway.rb +5 -2
- data/lib/patchwork/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 242267fcd3ddc369be17e976228f9106b9d1ecbc9b5a2e6d1c7848b3e021667a
|
|
4
|
+
data.tar.gz: '0396a4b146c596df95003bc844c96092c69daf6b0fa8535ee4259a9b0dd7efed'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dada508727728393bce618506e53dbe5dd88b100a3c7bf83e1a09c6a641d4c84a3fea5c8301261b0fe0dc6ccfb92cf669389bf8024ee74d9d399441368f6aae0
|
|
7
|
+
data.tar.gz: 879dd1640710686be7ff031d2576b8b312f57cbbe019f636446f0328caff46c7e9b9774ad4fcd055ee6a0c2a8af4c2ff634d58734d17bcb98c4b21c1a5bd13f8
|
data/lib/patchwork/gateway.rb
CHANGED
|
@@ -32,17 +32,20 @@ module Patchwork
|
|
|
32
32
|
TooLarge = Class.new(Error)
|
|
33
33
|
|
|
34
34
|
def initialize(app, resolve:, subject: nil, mint_path: nil, health_check: true,
|
|
35
|
-
|
|
35
|
+
health_path: HealthCheck::PATH, max_body_bytes: MAX_BODY_BYTES,
|
|
36
|
+
replay_guard: nil)
|
|
36
37
|
raise ArgumentError, "resolve must respond to #call" unless resolve.respond_to?(:call)
|
|
37
38
|
raise ArgumentError, "subject must respond to #decode" if subject && !subject.respond_to?(:decode)
|
|
38
39
|
raise ArgumentError, "replay_guard must respond to #call" if replay_guard && !replay_guard.respond_to?(:call)
|
|
39
40
|
raise ArgumentError, "mint_path must be an absolute path" if mint_path && !mint_path.to_s.start_with?("/")
|
|
41
|
+
raise ArgumentError, "health_path must be an absolute path" unless health_path.to_s.start_with?("/")
|
|
40
42
|
|
|
41
43
|
@app = app
|
|
42
44
|
@resolve = resolve
|
|
43
45
|
@subject = subject
|
|
44
46
|
@mint_path = mint_path&.to_s
|
|
45
47
|
@health_check = health_check
|
|
48
|
+
@health_path = health_path.to_s
|
|
46
49
|
@max_body_bytes = Integer(max_body_bytes)
|
|
47
50
|
@replay_guard = replay_guard
|
|
48
51
|
end
|
|
@@ -55,7 +58,7 @@ module Patchwork
|
|
|
55
58
|
request = Rack::Request.new(env)
|
|
56
59
|
signature = env[SIGNATURE_HEADER].to_s
|
|
57
60
|
|
|
58
|
-
return health(request, signature) if @health_check && at?(request,
|
|
61
|
+
return health(request, signature) if @health_check && at?(request, @health_path) && request.post?
|
|
59
62
|
return @app.call(env) if signature.empty?
|
|
60
63
|
return relay_mint(request, signature) if @mint_path && at?(request, @mint_path) && request.post?
|
|
61
64
|
|
data/lib/patchwork/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: patchwork-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chromablue Labs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jwt
|