rack-graphql 3.7.0 → 3.9.0
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/.bundler-version +2 -1
- data/.github/PULL_REQUEST_TEMPLATE.md +2 -2
- data/.github/workflows/ci.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +40 -30
- data/lib/rack_graphql/application.rb +3 -2
- data/lib/rack_graphql/middleware.rb +11 -8
- data/lib/rack_graphql/version.rb +1 -1
- data/rack-graphql.gemspec +1 -1
- metadata +4 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0f357c7f34664d705a55ffa4b90709ce68971d6e7d400a6dc8d1ce30d7e46b9
|
4
|
+
data.tar.gz: 53ff62e96f121b0f1cf1100464c8304fcc66721796edafcf5e0835321a02c82a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 200a45fa61a54367725c2da022d75c5527ff5a4e6b188a5d79f060e7e17e365a35fde87c73590d1f6d19272f694b32cd3a70e45bb3dfe7a87bbbeadbc0675cd2
|
7
|
+
data.tar.gz: 90fc7cfc3f0f7e135b9d4d6a4858dbddd294a13570666b8caebe64c41d01f0f91aa8281c96b5f807a8e3a285ceb1e874a8e7e44da8aa9957a1eaa5bf0b46a938
|
data/.bundler-version
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
2.
|
1
|
+
2.6.9
|
2
|
+
|
data/.github/workflows/ci.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rack-graphql (3.
|
4
|
+
rack-graphql (3.9.0)
|
5
5
|
graphql (~> 2.0)
|
6
6
|
json (>= 2.8.0)
|
7
7
|
rack (>= 2.2.6)
|
@@ -9,63 +9,73 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
ast (2.4.
|
12
|
+
ast (2.4.3)
|
13
13
|
awesome_print (1.9.2)
|
14
14
|
base64 (0.2.0)
|
15
15
|
coderay (1.1.3)
|
16
|
-
diff-lcs (1.
|
17
|
-
fiber-storage (1.0.
|
18
|
-
graphql (2.
|
16
|
+
diff-lcs (1.6.2)
|
17
|
+
fiber-storage (1.0.1)
|
18
|
+
graphql (2.5.7)
|
19
19
|
base64
|
20
20
|
fiber-storage
|
21
|
-
|
22
|
-
|
21
|
+
logger
|
22
|
+
json (2.12.0)
|
23
|
+
language_server-protocol (3.17.0.5)
|
24
|
+
lint_roller (1.1.0)
|
25
|
+
logger (1.7.0)
|
23
26
|
method_source (1.1.0)
|
24
|
-
parallel (1.
|
25
|
-
parser (3.3.
|
27
|
+
parallel (1.27.0)
|
28
|
+
parser (3.3.8.0)
|
26
29
|
ast (~> 2.4.1)
|
27
30
|
racc
|
28
|
-
|
31
|
+
prism (1.4.0)
|
32
|
+
pry (0.15.2)
|
29
33
|
coderay (~> 1.1)
|
30
34
|
method_source (~> 1.0)
|
31
35
|
racc (1.8.1)
|
32
|
-
rack (3.1.
|
33
|
-
rack-test (2.
|
36
|
+
rack (3.1.15)
|
37
|
+
rack-test (2.2.0)
|
34
38
|
rack (>= 1.3)
|
35
39
|
rainbow (3.1.1)
|
36
40
|
rake (13.2.1)
|
37
|
-
regexp_parser (2.
|
41
|
+
regexp_parser (2.10.0)
|
38
42
|
rspec (3.13.0)
|
39
43
|
rspec-core (~> 3.13.0)
|
40
44
|
rspec-expectations (~> 3.13.0)
|
41
45
|
rspec-mocks (~> 3.13.0)
|
42
|
-
rspec-core (3.13.
|
46
|
+
rspec-core (3.13.3)
|
43
47
|
rspec-support (~> 3.13.0)
|
44
|
-
rspec-expectations (3.13.
|
48
|
+
rspec-expectations (3.13.4)
|
45
49
|
diff-lcs (>= 1.2.0, < 2.0)
|
46
50
|
rspec-support (~> 3.13.0)
|
47
|
-
rspec-mocks (3.13.
|
51
|
+
rspec-mocks (3.13.4)
|
48
52
|
diff-lcs (>= 1.2.0, < 2.0)
|
49
53
|
rspec-support (~> 3.13.0)
|
50
|
-
rspec-support (3.13.
|
51
|
-
rubocop (1.
|
54
|
+
rspec-support (3.13.3)
|
55
|
+
rubocop (1.75.6)
|
52
56
|
json (~> 2.3)
|
53
|
-
language_server-protocol (
|
57
|
+
language_server-protocol (~> 3.17.0.2)
|
58
|
+
lint_roller (~> 1.1.0)
|
54
59
|
parallel (~> 1.10)
|
55
60
|
parser (>= 3.3.0.2)
|
56
61
|
rainbow (>= 2.2.2, < 4.0)
|
57
|
-
regexp_parser (>= 2.
|
58
|
-
rubocop-ast (>= 1.
|
62
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
63
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
59
64
|
ruby-progressbar (~> 1.7)
|
60
|
-
unicode-display_width (>= 2.4.0, <
|
61
|
-
rubocop-ast (1.
|
62
|
-
parser (>= 3.3.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
rubocop (
|
65
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
66
|
+
rubocop-ast (1.44.1)
|
67
|
+
parser (>= 3.3.7.2)
|
68
|
+
prism (~> 1.4)
|
69
|
+
rubocop-rake (0.7.1)
|
70
|
+
lint_roller (~> 1.1)
|
71
|
+
rubocop (>= 1.72.1)
|
72
|
+
rubocop-rspec (3.6.0)
|
73
|
+
lint_roller (~> 1.1)
|
74
|
+
rubocop (~> 1.72, >= 1.72.1)
|
67
75
|
ruby-progressbar (1.13.0)
|
68
|
-
unicode-display_width (
|
76
|
+
unicode-display_width (3.1.4)
|
77
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
78
|
+
unicode-emoji (4.0.4)
|
69
79
|
|
70
80
|
PLATFORMS
|
71
81
|
aarch64-linux-musl
|
@@ -89,4 +99,4 @@ DEPENDENCIES
|
|
89
99
|
rubocop-rspec
|
90
100
|
|
91
101
|
BUNDLED WITH
|
92
|
-
2.
|
102
|
+
2.6.3
|
@@ -12,9 +12,9 @@ module RackGraphql
|
|
12
12
|
health_on_root_path: health_route,
|
13
13
|
root_path_app: nil,
|
14
14
|
error_status_code_map: {},
|
15
|
-
request_epilogue: -> {}
|
15
|
+
request_epilogue: -> {},
|
16
|
+
secret_scrubber: nil
|
16
17
|
)
|
17
|
-
|
18
18
|
::Rack::Builder.new do
|
19
19
|
map '/graphql' do
|
20
20
|
run RackGraphql::Middleware.new(
|
@@ -26,6 +26,7 @@ module RackGraphql
|
|
26
26
|
log_exception_backtrace:,
|
27
27
|
error_status_code_map:,
|
28
28
|
request_epilogue:,
|
29
|
+
secret_scrubber:
|
29
30
|
)
|
30
31
|
end
|
31
32
|
|
@@ -14,9 +14,9 @@ module RackGraphql
|
|
14
14
|
log_exception_backtrace: RackGraphql.log_exception_backtrace,
|
15
15
|
re_raise_exceptions: false,
|
16
16
|
error_status_code_map: {},
|
17
|
-
request_epilogue: -> {}
|
17
|
+
request_epilogue: -> {},
|
18
|
+
secret_scrubber: nil
|
18
19
|
)
|
19
|
-
|
20
20
|
@schema = schema
|
21
21
|
@app_name = app_name
|
22
22
|
@context_handler = context_handler || ->(_) {}
|
@@ -25,6 +25,7 @@ module RackGraphql
|
|
25
25
|
@re_raise_exceptions = re_raise_exceptions
|
26
26
|
@error_status_code_map = error_status_code_map
|
27
27
|
@request_epilogue = request_epilogue || -> {}
|
28
|
+
@secret_scrubber = secret_scrubber || ->(value) { value }
|
28
29
|
end
|
29
30
|
|
30
31
|
def call(env)
|
@@ -38,7 +39,7 @@ module RackGraphql
|
|
38
39
|
operation_name = params['operationName']
|
39
40
|
context = context_handler.call(env)
|
40
41
|
|
41
|
-
log("Executing with params: #{params
|
42
|
+
log("Executing with params: #{secret_scrubber.call(params)}, operationName: #{operation_name}, variables: #{secret_scrubber.call(variables)}")
|
42
43
|
result = execute(params:, operation_name:, variables:, context:)
|
43
44
|
status_code = response_status(result)
|
44
45
|
|
@@ -49,7 +50,7 @@ module RackGraphql
|
|
49
50
|
]
|
50
51
|
rescue AmbiguousParamError => e
|
51
52
|
exception_string = dump_exception(e)
|
52
|
-
|
53
|
+
log_error(exception_string)
|
53
54
|
env[Rack::RACK_ERRORS].puts(exception_string)
|
54
55
|
env[Rack::RACK_ERRORS].flush
|
55
56
|
[
|
@@ -63,7 +64,7 @@ module RackGraphql
|
|
63
64
|
# so they cannot be caught by error tracking rack middlewares.
|
64
65
|
# You can change this behavior via `re_raise_exceptions` argument.
|
65
66
|
exception_string = dump_exception(e)
|
66
|
-
|
67
|
+
log_error(exception_string)
|
67
68
|
|
68
69
|
raise e if re_raise_exceptions
|
69
70
|
|
@@ -84,7 +85,7 @@ module RackGraphql
|
|
84
85
|
|
85
86
|
attr_reader :schema, :app_name, :logger, :context_handler,
|
86
87
|
:log_exception_backtrace, :error_status_code_map,
|
87
|
-
:re_raise_exceptions, :request_epilogue
|
88
|
+
:re_raise_exceptions, :request_epilogue, :secret_scrubber
|
88
89
|
|
89
90
|
def post_request?(env)
|
90
91
|
env['REQUEST_METHOD'] == 'POST'
|
@@ -188,9 +189,11 @@ module RackGraphql
|
|
188
189
|
end
|
189
190
|
|
190
191
|
def log(message)
|
191
|
-
|
192
|
+
logger&.info("[rack-graphql] #{message}")
|
193
|
+
end
|
192
194
|
|
193
|
-
|
195
|
+
def log_error(message)
|
196
|
+
logger&.error("[rack-graphql] #{message}")
|
194
197
|
end
|
195
198
|
|
196
199
|
# Based on https://github.com/rack/rack/blob/master/lib/rack/show_exceptions.rb
|
data/lib/rack_graphql/version.rb
CHANGED
data/rack-graphql.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 3.
|
27
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.3.0')
|
28
28
|
|
29
29
|
spec.add_dependency 'graphql', '~> 2.0'
|
30
30
|
spec.add_dependency 'json', '>= 2.8.0'
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krzysztof Knapik
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: graphql
|
@@ -52,7 +51,6 @@ dependencies:
|
|
52
51
|
- - ">="
|
53
52
|
- !ruby/object:Gem::Version
|
54
53
|
version: 2.2.6
|
55
|
-
description:
|
56
54
|
email:
|
57
55
|
- knapo@knapo.net
|
58
56
|
executables: []
|
@@ -93,7 +91,6 @@ metadata:
|
|
93
91
|
source_code_uri: https://github.com/RenoFi/rack-graphql
|
94
92
|
changelog_uri: https://github.com/RenoFi/rack-graphql/blob/master/CHANGELOG.md
|
95
93
|
rubygems_mfa_required: 'true'
|
96
|
-
post_install_message:
|
97
94
|
rdoc_options: []
|
98
95
|
require_paths:
|
99
96
|
- lib
|
@@ -101,15 +98,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
98
|
requirements:
|
102
99
|
- - ">="
|
103
100
|
- !ruby/object:Gem::Version
|
104
|
-
version: 3.
|
101
|
+
version: 3.3.0
|
105
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
103
|
requirements:
|
107
104
|
- - ">="
|
108
105
|
- !ruby/object:Gem::Version
|
109
106
|
version: '0'
|
110
107
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
112
|
-
signing_key:
|
108
|
+
rubygems_version: 3.6.9
|
113
109
|
specification_version: 4
|
114
110
|
summary: Rack middleware implementing graphql endpoint.
|
115
111
|
test_files: []
|