prefab-cloud-ruby 1.3.0 → 1.3.1

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: 55134a75669f459bbb12d50cfa6e221937a5c00f53ca365e609f0cb436b24aff
4
- data.tar.gz: f3507032152e1dfe7b48156e5b8795d3bfd9262e077fab18923fef7cbeb78e34
3
+ metadata.gz: ac25de1650da9f74095f10f535d3d82d7b865c8e3f2c56d621703ebe5a5c15f9
4
+ data.tar.gz: a628c38bba37dbb0f49fcb9ed6beeb6c58363a73a656a24d853d87ea9d835d92
5
5
  SHA512:
6
- metadata.gz: 839db6777d5e6c3a76d34b7812787e8241779b2ede48d4ffddbf5e96bb493494e8d30e980582a5d06518e8f64f789287417ac5e6abc66c7789e17082992c83fb
7
- data.tar.gz: fd26b0d5ceb02a17724ede1a3329bda2a1ca7ee1c8d49e0776c61498bfe7e1b41ca81158e395192c4c73c35970824e5eb2d319b241a9489e0e215febe9ea2bb6
6
+ metadata.gz: 1ea0aef2dd291d5263b825ad7ccb0565feb05acba45c0e142872f22b1111b93c3fadb431a03540230d97f48b20c13772821d523e41beb9b940bcbeec25e074bf
7
+ data.tar.gz: 9a70210438aeff434d33adfd6119ea279d4b27ff0c87cc604970ed3e48c77651d8064b761b06cc376039f29cab2519f72c494579472de87bdfadd7fdf02c4467
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.3.1 - 2023-11-14
6
+ - Improve path of rails.controller logging & fix strong param include (#159)
7
+
5
8
  ## 1.3.0 - 2023-11-13
6
9
  - Less logging when wifi is off and we load from cache (#157)
7
10
  - Alpha: Add Provided & Secret Support (#152)
data/Gemfile CHANGED
@@ -8,6 +8,7 @@ gem 'ld-eventsource'
8
8
  gem 'uuid'
9
9
 
10
10
  gem 'activesupport', '>= 4'
11
+ gem 'actionpack', '>= 4'
11
12
 
12
13
  group :development do
13
14
  gem 'benchmark-ips'
data/Gemfile.lock CHANGED
@@ -1,6 +1,22 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
+ actionpack (7.1.2)
5
+ actionview (= 7.1.2)
6
+ activesupport (= 7.1.2)
7
+ nokogiri (>= 1.8.5)
8
+ racc
9
+ rack (>= 2.2.4)
10
+ rack-session (>= 1.0.1)
11
+ rack-test (>= 0.6.3)
12
+ rails-dom-testing (~> 2.2)
13
+ rails-html-sanitizer (~> 1.6)
14
+ actionview (7.1.2)
15
+ activesupport (= 7.1.2)
16
+ builder (~> 3.1)
17
+ erubi (~> 1.11)
18
+ rails-dom-testing (~> 2.2)
19
+ rails-html-sanitizer (~> 1.6)
4
20
  activesupport (7.1.2)
5
21
  base64
6
22
  bigdecimal
@@ -20,6 +36,7 @@ GEM
20
36
  builder (3.2.4)
21
37
  concurrent-ruby (1.1.10)
22
38
  connection_pool (2.4.1)
39
+ crass (1.0.6)
23
40
  descendants_tracker (0.0.4)
24
41
  thread_safe (~> 0.3, >= 0.3.1)
25
42
  docile (1.3.5)
@@ -27,6 +44,7 @@ GEM
27
44
  unf (>= 0.0.5, < 1.0.0)
28
45
  drb (2.2.0)
29
46
  ruby2_keywords
47
+ erubi (1.12.0)
30
48
  faraday (1.3.0)
31
49
  faraday-net_http (~> 1.0)
32
50
  multipart-post (>= 1.2, < 3)
@@ -81,6 +99,9 @@ GEM
81
99
  llhttp-ffi (0.3.1)
82
100
  ffi-compiler (~> 1.0)
83
101
  rake (~> 13.0)
102
+ loofah (2.21.4)
103
+ crass (~> 1.0.2)
104
+ nokogiri (>= 1.12.0)
84
105
  macaddr (1.7.2)
85
106
  systemu (~> 2.6.5)
86
107
  mini_portile2 (2.8.2)
@@ -109,6 +130,17 @@ GEM
109
130
  public_suffix (4.0.6)
110
131
  racc (1.7.0)
111
132
  rack (3.0.6.1)
133
+ rack-session (2.0.0)
134
+ rack (>= 3.0.0)
135
+ rack-test (2.1.0)
136
+ rack (>= 1.3)
137
+ rails-dom-testing (2.2.0)
138
+ activesupport (>= 5.0.0)
139
+ minitest
140
+ nokogiri (>= 1.6)
141
+ rails-html-sanitizer (1.6.0)
142
+ loofah (~> 2.21)
143
+ nokogiri (~> 1.14)
112
144
  rake (13.0.6)
113
145
  rchardet (1.8.0)
114
146
  rdoc (6.3.3)
@@ -134,6 +166,7 @@ PLATFORMS
134
166
  ruby
135
167
 
136
168
  DEPENDENCIES
169
+ actionpack (>= 4)
137
170
  activesupport (>= 4)
138
171
  benchmark-ips
139
172
  bundler
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
@@ -28,6 +28,7 @@ module Prefab
28
28
  payload.delete(:headers)
29
29
  payload.delete(:request)
30
30
  payload.delete(:response)
31
+ payload[:req_path] = payload.delete(:path)
31
32
  params = payload[:params]
32
33
 
33
34
  if params.kind_of?(Hash) || params.kind_of?(::ActionController::Parameters)
@@ -44,6 +44,7 @@ require 'prefab/context'
44
44
  require 'prefab/logger_client'
45
45
  require 'active_support/deprecation'
46
46
  require 'active_support'
47
+ require 'action_controller/metal/strong_parameters'
47
48
  require 'prefab/log_subscribers/action_controller_subscriber'
48
49
  require 'prefab/client'
49
50
  require 'prefab/config_client_presenter'
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: prefab-cloud-ruby 1.3.0 ruby lib
5
+ # stub: prefab-cloud-ruby 1.3.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "prefab-cloud-ruby".freeze
9
- s.version = "1.3.0"
9
+ s.version = "1.3.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Jeff Dwyer".freeze]
14
- s.date = "2023-11-13"
14
+ s.date = "2023-11-14"
15
15
  s.description = "Feature Flags, Live Config, and Dynamic Log Levels as a service".freeze
16
16
  s.email = "jdwyer@prefab.cloud".freeze
17
17
  s.executables = ["console".freeze]
@@ -130,6 +130,7 @@ Gem::Specification.new do |s|
130
130
  s.add_runtime_dependency(%q<ld-eventsource>.freeze, [">= 0"])
131
131
  s.add_runtime_dependency(%q<uuid>.freeze, [">= 0"])
132
132
  s.add_runtime_dependency(%q<activesupport>.freeze, [">= 4"])
133
+ s.add_runtime_dependency(%q<actionpack>.freeze, [">= 4"])
133
134
  s.add_development_dependency(%q<benchmark-ips>.freeze, [">= 0"])
134
135
  s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
135
136
  s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
@@ -143,6 +144,7 @@ Gem::Specification.new do |s|
143
144
  s.add_dependency(%q<ld-eventsource>.freeze, [">= 0"])
144
145
  s.add_dependency(%q<uuid>.freeze, [">= 0"])
145
146
  s.add_dependency(%q<activesupport>.freeze, [">= 4"])
147
+ s.add_dependency(%q<actionpack>.freeze, [">= 4"])
146
148
  s.add_dependency(%q<benchmark-ips>.freeze, [">= 0"])
147
149
  s.add_dependency(%q<bundler>.freeze, [">= 0"])
148
150
  s.add_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
@@ -5,13 +5,42 @@ require 'test_helper'
5
5
  class TestActionController < Minitest::Test
6
6
  def setup
7
7
  super
8
+ end
9
+
10
+ def test_load
8
11
  new_client(config: log_level_config("log-level.rails.controller", "INFO"))
9
12
  @subscriber = Prefab::LogSubscribers::ActionControllerSubscriber.new
13
+ @subscriber.process_action(event)
14
+ assert_logged ['INFO 2023-08-09 15:18:12 -0400: rails.controller.request 200 MyController#index action=index controller=MyController db_runtime=0.05 format=application/html method=GET params={"p1"=>"v1"} req_path=/my?p1=v1 status=200 view_runtime=0.02']
10
15
  end
11
16
 
12
- def test_load
17
+ def test_json
18
+ new_client(config: log_level_config("log-level.rails.controller", "INFO"), log_formatter: Prefab::Options::JSON_LOG_FORMATTER)
19
+ @subscriber = Prefab::LogSubscribers::ActionControllerSubscriber.new
20
+ event = ActiveSupport::Notifications::Event.new(
21
+ 'process_action.action_controller',
22
+ Time.now,
23
+ Time.now,
24
+ 99,
25
+ path: '/original_path',
26
+ )
27
+ @subscriber.process_action(event)
28
+ assert_logged ["{\"severity\":\"INFO\",\"datetime\":\"2023-08-09 15:18:12 -0400\",\"path\":\"rails.controller.request\",\"message\":\" #\",\"req_path\":\"/original_path\"}"]
29
+
30
+ end
31
+
32
+ def test_funny_params
33
+ new_client(config: log_level_config("log-level.rails.controller", "INFO"))
34
+ @subscriber = Prefab::LogSubscribers::ActionControllerSubscriber.new
35
+ event = ActiveSupport::Notifications::Event.new(
36
+ 'process_action.action_controller',
37
+ Time.now,
38
+ Time.now,
39
+ 99,
40
+ params: "foo"
41
+ )
13
42
  @subscriber.process_action(event)
14
- assert_logged ['INFO 2023-08-09 15:18:12 -0400: rails.controller.request 200 MyController#index action=index controller=MyController db_runtime=0.05 format=application/html method=GET params={"p1"=>"v1"} path=/my?p1=v1 status=200 view_runtime=0.02']
43
+ assert_logged ['INFO 2023-08-09 15:18:12 -0400: rails.controller.request # params=foo']
15
44
  end
16
45
 
17
46
 
@@ -34,19 +63,19 @@ class TestActionController < Minitest::Test
34
63
  end
35
64
 
36
65
  def log_level_config(path, level)
37
- PrefabProto::Config.new(
38
- id: 123,
39
- key: path,
40
- config_type: PrefabProto::ConfigType::LOG_LEVEL,
41
- rows: [
42
- PrefabProto::ConfigRow.new(
43
- values: [
44
- PrefabProto::ConditionalValue.new(
45
- value: PrefabProto::ConfigValue.new(log_level: level)
46
- )
47
- ]
48
- )
49
- ]
50
- )
66
+ PrefabProto::Config.new(
67
+ id: 123,
68
+ key: path,
69
+ config_type: PrefabProto::ConfigType::LOG_LEVEL,
70
+ rows: [
71
+ PrefabProto::ConfigRow.new(
72
+ values: [
73
+ PrefabProto::ConditionalValue.new(
74
+ value: PrefabProto::ConfigValue.new(log_level: level)
75
+ )
76
+ ]
77
+ )
78
+ ]
79
+ )
51
80
  end
52
81
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prefab-cloud-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dwyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-13 00:00:00.000000000 Z
11
+ date: 2023-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -114,6 +114,20 @@ dependencies:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '4'
117
+ - !ruby/object:Gem::Dependency
118
+ name: actionpack
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '4'
124
+ type: :runtime
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '4'
117
131
  - !ruby/object:Gem::Dependency
118
132
  name: benchmark-ips
119
133
  requirement: !ruby/object:Gem::Requirement