gritz-core 0.6.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +4 -0
- data/lib/gritz/compat/gruf.rb +1 -0
- data/lib/gritz/configuration.rb +2 -1
- data/lib/gritz/core/version.rb +1 -1
- data/lib/gritz/core.rb +2 -0
- data/lib/gritz/fork_guard.rb +1 -0
- data/lib/gritz/middleware/logging.rb +17 -16
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 40b995a6a11953b9aec90291e60bbd928911c1e4e0337a7241daf3c34b210e27
|
|
4
|
+
data.tar.gz: 511df3afe2b9071e7920b36633a58fdd759832ccf158392a7e2be553385a72f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a66f9c4d58aca49a6e4bf9912b2f2ecf1f0391e2381cb9c3b9cbe29ab7bb47c777fcad4667afb67f90a8d2d98f7fc9df231cf82a4fa25021777b264e074ac6d4
|
|
7
|
+
data.tar.gz: c1bbe9d8f404c15669814fab6f85d3b6b389b0ff3bd7548cfb5ce5e7ca98e6672d8811ca9707339c47a09128aa06b4475606e386104d06f52403098400073953
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
- Start the 0.9 stabilization series with the documented public API and support policy.
|
|
6
|
+
- Reject directories and named pipes configured as TLS certificate, key or client CA files before allocating transport resources.
|
|
7
|
+
|
|
8
|
+
## 0.6.1
|
|
9
|
+
|
|
10
|
+
- Avoid formatting suppressed RPC completion logs, preserving responses, status mapping and metrics when INFO logging is disabled.
|
|
11
|
+
|
|
3
12
|
## 0.6.0
|
|
4
13
|
|
|
5
14
|
- Run Async workers through the same supervisor, CLI and real-server test helper as Native workers.
|
data/README.md
CHANGED
|
@@ -31,6 +31,10 @@ bundle exec rake build
|
|
|
31
31
|
|
|
32
32
|
Tests, lint and packaging run independently in this repository. See [CONTRIBUTING.md](CONTRIBUTING.md), [SECURITY.md](SECURITY.md) and the [release guide](docs/guides/releasing.md).
|
|
33
33
|
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
Read the [published guides and API reference](https://gritzrpc.github.io/gritz/), [public API policy](https://github.com/gritzrpc/gritz/blob/main/docs/public-api.md), [support policy](https://github.com/gritzrpc/gritz/blob/main/docs/support-policy.md) and [stabilization gate](https://github.com/gritzrpc/gritz/blob/main/docs/stabilization.md).
|
|
37
|
+
|
|
34
38
|
## License
|
|
35
39
|
|
|
36
40
|
[MIT](LICENSE.txt).
|
data/lib/gritz/compat/gruf.rb
CHANGED
data/lib/gritz/configuration.rb
CHANGED
|
@@ -216,7 +216,8 @@ module Gritz
|
|
|
216
216
|
end
|
|
217
217
|
|
|
218
218
|
tls.each do |name, path|
|
|
219
|
-
|
|
219
|
+
valid = %i[cert key client_ca].include?(name) && path.is_a?(String) && File.file?(path) && File.readable?(path)
|
|
220
|
+
raise ConfigurationError, "Invalid tls #{name}" unless valid
|
|
220
221
|
end
|
|
221
222
|
end
|
|
222
223
|
end
|
data/lib/gritz/core/version.rb
CHANGED
data/lib/gritz/core.rb
CHANGED
|
@@ -4,6 +4,8 @@ require "zeitwerk"
|
|
|
4
4
|
require_relative "errors"
|
|
5
5
|
require_relative "core/version"
|
|
6
6
|
|
|
7
|
+
# Transport-independent RPC controllers, middleware, clients and lifecycle tools.
|
|
8
|
+
# @api public
|
|
7
9
|
module Gritz
|
|
8
10
|
module Core
|
|
9
11
|
# Core loading deliberately does not require grpc or initialize transports.
|
data/lib/gritz/fork_guard.rb
CHANGED
|
@@ -22,22 +22,23 @@ module Gritz
|
|
|
22
22
|
code = :internal
|
|
23
23
|
raise
|
|
24
24
|
ensure
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
context.logger.info do
|
|
26
|
+
duration = (Process.clock_gettime(Process::CLOCK_MONOTONIC) - started) * 1000
|
|
27
|
+
fields = { request_id: context.request_id, service: context.method.service,
|
|
28
|
+
method: context.method.name, code: code, duration_ms: duration.round(3),
|
|
29
|
+
peer: context.peer, worker: context.worker, pid: Process.pid, bytes_in: context.bytes_in, bytes_out: context.bytes_out }
|
|
30
|
+
fields.merge!(context.store.fetch(:gritz_error, {}))
|
|
31
|
+
fields = prepare(fields, context.log_redact)
|
|
32
|
+
if context.log_format == :logfmt
|
|
33
|
+
fields.map do |key, value|
|
|
34
|
+
value = value.to_s if value.is_a?(Symbol)
|
|
35
|
+
value = JSON.generate(value) if value.is_a?(Hash) || value.is_a?(Array)
|
|
36
|
+
"#{key}=#{JSON.generate(value)}"
|
|
37
|
+
end.join(" ")
|
|
38
|
+
else
|
|
39
|
+
JSON.generate(fields)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
41
42
|
end
|
|
42
43
|
|
|
43
44
|
private
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gritz-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yudai Takada
|
|
@@ -171,6 +171,7 @@ licenses:
|
|
|
171
171
|
metadata:
|
|
172
172
|
allowed_push_host: https://rubygems.org
|
|
173
173
|
source_code_uri: https://github.com/gritzrpc/gritz-core
|
|
174
|
+
documentation_uri: https://gritzrpc.github.io/gritz/
|
|
174
175
|
changelog_uri: https://github.com/gritzrpc/gritz-core/blob/main/CHANGELOG.md
|
|
175
176
|
rubygems_mfa_required: 'true'
|
|
176
177
|
rdoc_options: []
|