finapps_core 3.0.3 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/finapps_core/middleware/response/custom_logger.rb +15 -1
- data/lib/finapps_core/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d84b8723e6a578eb0d3b9acc147b244bed2b1bf5
|
4
|
+
data.tar.gz: 376f447016bc6a972ff845d1690a9f1b7b1929c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8b80765b6c9f266bbfe7647266635851a179905f624590ebe4661213e116fe96831d7bb4aca06f7c8e855bf468d8a55f225f4eb7da498eb4e096fa4dcfae64a
|
7
|
+
data.tar.gz: fcefa24b01aaa13b250acd19b13e0cdaeb6fceac96a26a35add3520e5f47b2bdf1048ea366526baa018e4f364da42b11cdd8f32cb9a277b78b5484e1c57dda5f
|
@@ -21,12 +21,17 @@ module FinAppsCore
|
|
21
21
|
def call(env)
|
22
22
|
debug "#{self.class.name}##{__method__} => URL: #{env.method.upcase} #{env.url}"
|
23
23
|
debug "#{self.class.name}##{__method__} => Request Headers: #{dump env.request_headers}"
|
24
|
+
if env[:body] && log_body?(:request)
|
25
|
+
debug "#{self.class.name}##{__method__} => Request Response: #{dump env[:body]}"
|
26
|
+
end
|
24
27
|
super
|
25
28
|
end
|
26
29
|
|
27
30
|
def on_complete(env)
|
28
31
|
debug "#{self.class.name}##{__method__} => Response Headers: #{dump env.response_headers}"
|
29
|
-
|
32
|
+
if env.body && log_body?(:response)
|
33
|
+
debug "#{self.class.name}##{__method__} => Response Body: #{dump env.body}"
|
34
|
+
end
|
30
35
|
end
|
31
36
|
|
32
37
|
private
|
@@ -36,6 +41,15 @@ module FinAppsCore
|
|
36
41
|
s.nil? ? 'NO-CONTENT' : s.to_json
|
37
42
|
end
|
38
43
|
|
44
|
+
def log_body?(type)
|
45
|
+
case @options[:bodies]
|
46
|
+
when Hash then
|
47
|
+
@options[:bodies][type]
|
48
|
+
else
|
49
|
+
@options[:bodies]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
39
53
|
def new_logger
|
40
54
|
logger = Logger.new(STDOUT)
|
41
55
|
logger.level = FinAppsCore::REST::Defaults::DEFAULTS[:log_level]
|
data/lib/finapps_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finapps_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Quintero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -337,20 +337,20 @@ signing_key:
|
|
337
337
|
specification_version: 4
|
338
338
|
summary: FinApps REST API ruby client - Core.
|
339
339
|
test_files:
|
340
|
-
- spec/middleware/response/raise_error_spec.rb
|
341
|
-
- spec/middleware/request/user_agent_spec.rb
|
342
|
-
- spec/middleware/request/no_encoding_basic_authentication_spec.rb
|
343
|
-
- spec/middleware/request/request_id_spec.rb
|
344
|
-
- spec/middleware/request/tenant_authentication_spec.rb
|
345
|
-
- spec/middleware/request/accept_json_spec.rb
|
346
|
-
- spec/rest/credentials_spec.rb
|
347
|
-
- spec/rest/configuration_spec.rb
|
348
340
|
- spec/rest/defaults_spec.rb
|
349
341
|
- spec/rest/base_client_spec.rb
|
342
|
+
- spec/rest/credentials_spec.rb
|
343
|
+
- spec/rest/configuration_spec.rb
|
350
344
|
- spec/rest/resources_spec.rb
|
345
|
+
- spec/support/fake_api.rb
|
351
346
|
- spec/utils/parameter_filter_spec.rb
|
352
347
|
- spec/utils/validatable_spec.rb
|
353
|
-
- spec/
|
348
|
+
- spec/spec_helpers/client.rb
|
354
349
|
- spec/spec_helper.rb
|
355
350
|
- spec/core_extensions/object/is_integer_spec.rb
|
356
|
-
- spec/
|
351
|
+
- spec/middleware/request/no_encoding_basic_authentication_spec.rb
|
352
|
+
- spec/middleware/request/user_agent_spec.rb
|
353
|
+
- spec/middleware/request/tenant_authentication_spec.rb
|
354
|
+
- spec/middleware/request/accept_json_spec.rb
|
355
|
+
- spec/middleware/request/request_id_spec.rb
|
356
|
+
- spec/middleware/response/raise_error_spec.rb
|