hephaestus 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ee150804d80090a603c52698b45937f96bbd8bf52d13f295f68471831b2e69b
4
- data.tar.gz: de6060aa80ddfd82cc2d122cb8c0b941c1fd6fa70fce4d44190aec6ff91ad779
3
+ metadata.gz: 44ea48d1eb2074031506e9029eb3650657c2af45a4a0dc69d64297bcb3d1ce46
4
+ data.tar.gz: 83098f6cc522540642f8607ddfc98816d47a1f68981a5414572800a3151ecaff
5
5
  SHA512:
6
- metadata.gz: 8b022f681eccc353d032f1f5799b8412d13d69dbcfdbc080d526d2f8f40817c44653f77ef9f901449c1b6fcd658f187bf6092fb54e32e3df8b60ad8b321e7720
7
- data.tar.gz: 8c95113092f22e23f201c17d0bef1ff71cfb7ad10f5ef44acd6370f847f69970e980ceae58e8f697bbd9427fdc5bd9196b68d68b5c84885987701520275baf7a
6
+ metadata.gz: 7ff481188d3525a3b232099cd902db74cf2fa29bb368dc4e62fc6b4525bdbe9b978e08666a490fca443bbc76e7cbe73af65894e50d85e51f3ef9d4d3c144c66d
7
+ data.tar.gz: 4fdc8e71109d913965923239ff10b00b185ee1289b34f503c196f25308b7aef8a5bf385b064c6931403b7bbcb1144057a297c0f4573c184fe7dcd200118bef34
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # [v0.6.3] - 05-07-2024
2
+ ## What's Changed
3
+ * Changes to support Rack 3 param parsing by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/21
4
+
5
+
6
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.6.2...v0.6.3
1
7
  # [v0.6.2] - 19-06-2024
2
8
  ## What's Changed
3
9
  * Use Ruby test suite by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/18
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Hephaestus
5
- VERSION = "0.6.2"
5
+ VERSION = "0.6.3"
6
6
  RAILS_VERSION = "~> 7.0"
7
7
  RUBY_VERSION = File
8
8
  .read("#{File.dirname(__FILE__)}/../../.ruby-version")
@@ -14,6 +14,7 @@ module PlugApp
14
14
 
15
15
  HTTP_REQUEST_BODY = "http.request.body"
16
16
  PLUG_APP_PATH_PREFIX = "/app/"
17
+ RACK_REQUEST_BODY = "rack.input"
17
18
 
18
19
  sig { params(app: T.untyped).void }
19
20
  def initialize(app)
@@ -23,24 +24,22 @@ module PlugApp
23
24
 
24
25
  sig { params(env: T.untyped).returns(T.untyped) }
25
26
  def call(env)
26
- request = ActionDispatch::Request.new(env.dup)
27
-
28
27
  OpenTelemetry::Trace.current_span.add_attributes({
29
28
  OpenTelemetry::VERSION => PlugApp::Application::GIT_SHA,
30
29
  OpenTelemetry::SemanticConventions::Trace::HTTP_REQUEST_CONTENT_LENGTH => env["CONTENT_LENGTH"].to_i,
31
- HTTP_REQUEST_BODY => filtered_params(request),
30
+ HTTP_REQUEST_BODY => filtered_params(env),
32
31
  })
33
32
 
34
33
  app.call(env)
35
34
  end
36
35
 
37
- def filtered_params(request)
38
- params = request.params
39
- if request.path.starts_with?(PLUG_APP_PATH_PREFIX)
40
- {}
41
- else
42
- @filterer.filter(params)
43
- end.to_json
36
+ def filtered_params(env)
37
+ body = env[RACK_REQUEST_BODY]&.read
38
+ return "{}" if body.blank? || body == "{}"
39
+
40
+ @filterer.filter(JSON.parse(body)).to_json
41
+ ensure
42
+ env[RACK_REQUEST_BODY]&.try(:rewind)
44
43
  end
45
44
  end
46
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hephaestus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-19 00:00:00.000000000 Z
11
+ date: 2024-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,7 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.0'
41
+ force_ruby_platform: false
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: rails
43
44
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +53,7 @@ dependencies:
52
53
  - - "~>"
53
54
  - !ruby/object:Gem::Version
54
55
  version: '7.0'
56
+ force_ruby_platform: false
55
57
  - !ruby/object:Gem::Dependency
56
58
  name: rainbow
57
59
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +68,7 @@ dependencies:
66
68
  - - "~>"
67
69
  - !ruby/object:Gem::Version
68
70
  version: '3.0'
71
+ force_ruby_platform: false
69
72
  - !ruby/object:Gem::Dependency
70
73
  name: minitest
71
74
  requirement: !ruby/object:Gem::Requirement
@@ -97,7 +100,7 @@ dependencies:
97
100
  description: 'Hephaestus is a Rails generator to create plugs for Yetto.
98
101
 
99
102
  '
100
- email:
103
+ email:
101
104
  executables:
102
105
  - hephaestus
103
106
  extensions: []
@@ -127,7 +130,6 @@ files:
127
130
  - lib/hephaestus/version.rb
128
131
  - templates/.dockerignore
129
132
  - templates/.env.sample
130
- - templates/.github/.DS_Store
131
133
  - templates/.github/dependabot.yml
132
134
  - templates/.github/workflows/automerge.yml
133
135
  - templates/.github/workflows/deploy.yml
@@ -231,7 +233,7 @@ homepage: http://github.com/yettoapp/hephaestus
231
233
  licenses:
232
234
  - MIT
233
235
  metadata: {}
234
- post_install_message:
236
+ post_install_message:
235
237
  rdoc_options:
236
238
  - "--charset=UTF-8"
237
239
  require_paths:
@@ -247,8 +249,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
249
  - !ruby/object:Gem::Version
248
250
  version: 3.4.7
249
251
  requirements: []
250
- rubygems_version: 3.5.9
251
- signing_key:
252
+ rubygems_version: 3.5.3
253
+ signing_key:
252
254
  specification_version: 4
253
255
  summary: Generate a Rails app that can be used to create plugs for Yetto.
254
256
  test_files: []
Binary file