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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d2c1ea90ede4e54c5a5489a0851427ad9b09d6413793cbc3af0be433fd04ccf
4
- data.tar.gz: f7ba119713fd428a0f38acd2d1d62d197f03d74179e4e7e8cb2f29d5735c106f
3
+ metadata.gz: a0f357c7f34664d705a55ffa4b90709ce68971d6e7d400a6dc8d1ce30d7e46b9
4
+ data.tar.gz: 53ff62e96f121b0f1cf1100464c8304fcc66721796edafcf5e0835321a02c82a
5
5
  SHA512:
6
- metadata.gz: 677849f32a33ee3b09fe3bbb43df14b5c5f838995401696a80870b590e02d51c2e9040eee1d0c3ede91915db1fe72723ffef89a23a888134ec1e1c5e59cf757d
7
- data.tar.gz: 1bb0f2c112fe088d46be05d4d8b766917e239f8924aa8b1a3b81f8f213e2340772f669413245b313590f68c5fae373a0105325b30d908d93edc25bfe3173c858
6
+ metadata.gz: 200a45fa61a54367725c2da022d75c5527ff5a4e6b188a5d79f060e7e17e365a35fde87c73590d1f6d19272f694b32cd3a70e45bb3dfe7a87bbbeadbc0675cd2
7
+ data.tar.gz: 90fc7cfc3f0f7e135b9d4d6a4858dbddd294a13570666b8caebe64c41d01f0f91aa8281c96b5f807a8e3a285ceb1e874a8e7e44da8aa9957a1eaa5bf0b46a938
data/.bundler-version CHANGED
@@ -1 +1,2 @@
1
- 2.5.23
1
+ 2.6.9
2
+
@@ -2,5 +2,5 @@
2
2
  <!--- Describe your changes in detail -->
3
3
  <!--- Why is this change required? What problem does it solve? -->
4
4
 
5
- ## Related issue(s) or PR(s)
6
- <!--- GH issue number -->
5
+ ## Related tickets(s), PR(s) or slack message:
6
+ <!--- Ticket/Issue/PR number or URL -->
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- ruby-version: [3.2, 3.3]
14
+ ruby-version: [3.3, 3.4]
15
15
 
16
16
  steps:
17
17
  - uses: actions/checkout@v3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.9.0 - 2025-05-29
4
+ - Ability to provide secret scrubber, so sensitive values are not logged
5
+
6
+ ## 3.8.0 - 2025-02-05
7
+ - Ruby 3.4 support. Drop ruby 3.2 support.
8
+
3
9
  ## 3.7.0 - 2024-11-08
4
10
  - use json gem 2.8+ instead of oj
5
11
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-graphql (3.7.0)
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.2)
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.5.1)
17
- fiber-storage (1.0.0)
18
- graphql (2.4.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
- json (2.8.1)
22
- language_server-protocol (3.17.0.3)
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.26.3)
25
- parser (3.3.6.0)
27
+ parallel (1.27.0)
28
+ parser (3.3.8.0)
26
29
  ast (~> 2.4.1)
27
30
  racc
28
- pry (0.14.2)
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.8)
33
- rack-test (2.1.0)
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.9.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.2)
46
+ rspec-core (3.13.3)
43
47
  rspec-support (~> 3.13.0)
44
- rspec-expectations (3.13.3)
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.2)
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.1)
51
- rubocop (1.68.0)
54
+ rspec-support (3.13.3)
55
+ rubocop (1.75.6)
52
56
  json (~> 2.3)
53
- language_server-protocol (>= 3.17.0)
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.4, < 3.0)
58
- rubocop-ast (>= 1.32.2, < 2.0)
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, < 3.0)
61
- rubocop-ast (1.34.1)
62
- parser (>= 3.3.1.0)
63
- rubocop-rake (0.6.0)
64
- rubocop (~> 1.0)
65
- rubocop-rspec (3.2.0)
66
- rubocop (~> 1.61)
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 (2.6.0)
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.5.23
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.inspect}, operationName: #{operation_name}, variables: #{variables.inspect}")
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
- log(exception_string)
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
- log(exception_string)
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
- return unless logger
192
+ logger&.info("[rack-graphql] #{message}")
193
+ end
192
194
 
193
- logger.info("[rack-graphql] #{message}")
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
@@ -1,3 +1,3 @@
1
1
  module RackGraphql
2
- VERSION = '3.7.0'.freeze
2
+ VERSION = '3.9.0'.freeze
3
3
  end
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.2.0')
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.7.0
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: 2024-11-08 00:00:00.000000000 Z
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.2.0
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.5.23
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: []