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 +4 -4
- data/.ruby-version +1 -1
- data/lib/svcbase/corelogger.rb +0 -1
- data/lib/svcbase/middleware/apilogger.rb +19 -3
- data/lib/svcbase/version.rb +1 -1
- data/svcbase.gemspec +7 -7
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46cffe5e3f74c1beca674901ee6a4df4e690d74690966165e8ddd0d1a39ab764
|
4
|
+
data.tar.gz: 11b67eb8e85f737fdc388bbdb366770d3c0926cc2ba25e9a168d86739aaa8b21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe2dd1de0c3d0fa7d16f4835eb51020297b485918d92aab6dbf47f57252a54e48a34764abd21d6024caccaa53b919a428d07625684628a0e6da86e12fd035f4d
|
7
|
+
data.tar.gz: cad22ef2f910eca6c99b1d2e306b0ee91852a8e33017bb9a501381e3e18e37f6bc8a3ed87f4748cef32675d70b993b18fcb1aa602216386a75d91766c9ac4aff
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
3.2.2
|
data/lib/svcbase/corelogger.rb
CHANGED
@@ -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
|
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
|
-
|
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
|
data/lib/svcbase/version.rb
CHANGED
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
|
-
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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.
|
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:
|
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
|
-
|
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
|