grpc_access_logging_interceptor 0.0.4 → 0.0.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d112bd024b17036fc73b5462d28e6137ae2b645e52ec9ac5fe5019ecf62632b7
|
4
|
+
data.tar.gz: 76c09a4b55b8ac16e2908113d2653f5698b07c51538f020a060aa69478c97816
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd8afce16b5006e26e4b6470f9780b7ea278f08b36f6c2588555bd9ccc12d016c41c302b1cbb5be1d915574a0bef3bf73defb120720d63daf226f249bd438a45
|
7
|
+
data.tar.gz: 56208cf9eff9a61d97ae43f1f1a0d4d9fd3dc89db7e667948e70ac619847c35e36a72cbe1bd0aa48e6bbb0270961b81b413883ee7637581a44d0c2b4295a21a4
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
grpc_access_logging_interceptor (0.0.
|
4
|
+
grpc_access_logging_interceptor (0.0.5)
|
5
|
+
gmsc
|
5
6
|
grpc
|
6
7
|
|
7
8
|
GEM
|
@@ -9,6 +10,7 @@ GEM
|
|
9
10
|
specs:
|
10
11
|
coderay (1.1.2)
|
11
12
|
diff-lcs (1.3)
|
13
|
+
gmsc (0.0.1)
|
12
14
|
google-protobuf (3.11.1)
|
13
15
|
googleapis-common-protos-types (1.0.4)
|
14
16
|
google-protobuf (~> 3.0)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "base64"
|
2
|
+
require "gmsc"
|
2
3
|
require "grpc"
|
3
4
|
require "grpc_access_logging_interceptor/default_logger"
|
4
5
|
|
@@ -33,7 +34,7 @@ module GrpcAccessLoggingInterceptor
|
|
33
34
|
params: filter(request.to_h).to_json,
|
34
35
|
user_agent: call.metadata[USER_AGENT_KEY],
|
35
36
|
grpc_method: grpc_method(method),
|
36
|
-
grpc_metadata:
|
37
|
+
grpc_metadata: GMSC.safe_convert(call.metadata).to_json,
|
37
38
|
})
|
38
39
|
data.merge!(custom_data(request: request, call: call, method: method))
|
39
40
|
|
@@ -72,25 +73,6 @@ module GrpcAccessLoggingInterceptor
|
|
72
73
|
"/#{method.owner.service_name}/#{camelize(method.name.to_s)}"
|
73
74
|
end
|
74
75
|
|
75
|
-
# @param [Hash] metadata
|
76
|
-
# @return [String]
|
77
|
-
def jsonize(metadata)
|
78
|
-
h = {}
|
79
|
-
metadata.each do |k, v|
|
80
|
-
if v.is_a?(String) && v.encoding == Encoding::ASCII_8BIT
|
81
|
-
begin
|
82
|
-
h[k] = v.encode(Encoding::UTF_8)
|
83
|
-
rescue Encoding::UndefinedConversionError
|
84
|
-
# If the value is binary, encode with Base64
|
85
|
-
h[k] = Base64.strict_encode64(v)
|
86
|
-
end
|
87
|
-
else
|
88
|
-
h[k] = v
|
89
|
-
end
|
90
|
-
end
|
91
|
-
h.to_json
|
92
|
-
end
|
93
|
-
|
94
76
|
# @param [String] term
|
95
77
|
# @return [String]
|
96
78
|
def camelize(term)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grpc_access_logging_interceptor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nao Minami
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: gmsc
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
description: An interceptor for access logging with gRPC.
|
126
140
|
email:
|
127
141
|
- south37777@gmail.com
|
@@ -165,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
179
|
- !ruby/object:Gem::Version
|
166
180
|
version: '0'
|
167
181
|
requirements: []
|
168
|
-
rubygems_version: 3.0.
|
182
|
+
rubygems_version: 3.0.6
|
169
183
|
signing_key:
|
170
184
|
specification_version: 4
|
171
185
|
summary: An interceptor for access logging with gRPC.
|