svcbase 0.1.16 → 0.1.17

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: ee9043e3f2173b8d9d6adfe661dd37f7db925a00912f9c9a15e7f74dede6ea74
4
- data.tar.gz: 1be47052db3c376410cee00d62d16997b46eaf31e317a9010fdc34f52eb68199
3
+ metadata.gz: 46cffe5e3f74c1beca674901ee6a4df4e690d74690966165e8ddd0d1a39ab764
4
+ data.tar.gz: 11b67eb8e85f737fdc388bbdb366770d3c0926cc2ba25e9a168d86739aaa8b21
5
5
  SHA512:
6
- metadata.gz: ad56907c1f5572d9677280f743b18f04f1011b4556c5b2b1f658ff975ea9006d677e20e30d72d75017373f4a41b3cb8d4c3d383a48d70e01fd44fc655f3c5a49
7
- data.tar.gz: 1fce1b726d8507e00072a976cfb227321389f80fd55d5ecbe1d50d578c3f0dfc1933ca6d1904b07db2ced7ad976fb489e43e651c0347d66f455cf6bd7f038d55
6
+ metadata.gz: fe2dd1de0c3d0fa7d16f4835eb51020297b485918d92aab6dbf47f57252a54e48a34764abd21d6024caccaa53b919a428d07625684628a0e6da86e12fd035f4d
7
+ data.tar.gz: cad22ef2f910eca6c99b1d2e306b0ee91852a8e33017bb9a501381e3e18e37f6bc8a3ed87f4748cef32675d70b993b18fcb1aa602216386a75d91766c9ac4aff
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 3.2.2
@@ -27,7 +27,6 @@ module Core
27
27
  def filter(paramhash, maskkeys)
28
28
  paramhash.each do |key, value|
29
29
  next paramhash[key] = '*' if maskkeys&.include?(key.to_sym)
30
- next
31
30
 
32
31
  case value
33
32
  when String
@@ -66,7 +66,7 @@ module Core
66
66
  end
67
67
 
68
68
  # only suppress if successful and we didn't take too long
69
- return if (status == 304 || (200..299).cover?(status)) && !request_took_too_long && suppress?(status)
69
+ return if successful?(status) && !request_took_too_long && suppress?(status)
70
70
 
71
71
  r = env[Grape::Env::GRAPE_REQUEST]
72
72
 
@@ -78,14 +78,22 @@ module Core
78
78
  ua: request.env['HTTP_USER_AGENT'] }
79
79
 
80
80
  log.warn "#{processed_by} request took #{elapsed_time} msec" if request_took_too_long
81
- log.info info
81
+
82
+ if successful?(status)
83
+ if suppress_path?(r.path)
84
+ log.debug info
85
+ else
86
+ log.info info
87
+ end
88
+ else
89
+ log.error info
90
+ end
82
91
  end
83
92
  # rubocop:enable AbcSize
84
93
 
85
94
  #
86
95
  # Helpers
87
96
  #
88
-
89
97
  private def suppress?(status)
90
98
  return true if get_route_option(:suppress_log)
91
99
  # create either an array with the oid, or an empty array
@@ -180,5 +188,13 @@ module Core
180
188
  private def request
181
189
  @request ||= ::Rack::Request.new(env)
182
190
  end
191
+
192
+ private def suppress_path?(path)
193
+ path =~ %r{^/v1/health$|^/v1/ping$}
194
+ end
195
+
196
+ private def successful?(status)
197
+ (status == 304 || (200..299).cover?(status))
198
+ end
183
199
  end
184
200
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Svcbase
4
- VERSION = '0.1.16'
4
+ VERSION = '0.1.17'
5
5
  end
data/svcbase.gemspec CHANGED
@@ -12,16 +12,16 @@ Gem::Specification.new do |spec|
12
12
  spec.email = ['jnardone@secureauth.com']
13
13
 
14
14
  spec.summary = 'Base service code'
15
- #spec.homepage = 'http://no'
15
+ spec.homepage = 'http://no'
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
18
  # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- # if spec.respond_to?(:metadata)
20
- # spec.metadata['allowed_push_host'] = 'https://artifactory.secureauth.com/artifactory/api/gems/rubygems-local'
21
- # else
22
- # raise 'RubyGems 2.0 or newer is required to protect against ' \
23
- # 'public gem pushes.'
24
- # end
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
21
+ else
22
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
23
+ 'public gem pushes.'
24
+ end
25
25
 
26
26
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
27
  f.match(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svcbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Nardone
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-24 00:00:00.000000000 Z
11
+ date: 2024-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -279,9 +279,10 @@ files:
279
279
  - locale/en.yml
280
280
  - locale/zz.yml
281
281
  - svcbase.gemspec
282
- homepage:
282
+ homepage: http://no
283
283
  licenses: []
284
- metadata: {}
284
+ metadata:
285
+ allowed_push_host: https://rubygems.org/
285
286
  post_install_message:
286
287
  rdoc_options: []
287
288
  require_paths:
@@ -297,8 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
298
  - !ruby/object:Gem::Version
298
299
  version: '0'
299
300
  requirements: []
300
- rubyforge_project:
301
- rubygems_version: 2.7.6
301
+ rubygems_version: 3.4.10
302
302
  signing_key:
303
303
  specification_version: 4
304
304
  summary: Base service code