exis_ray 0.6.1 → 0.7.1
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 +5 -0
- data/lib/exis_ray/configuration.rb +2 -2
- data/lib/exis_ray/json_formatter.rb +4 -3
- data/lib/exis_ray/railtie.rb +13 -14
- data/lib/exis_ray/version.rb +1 -1
- data/spec/exis_ray/configuration_spec.rb +4 -4
- data/spec/exis_ray/json_formatter_spec.rb +32 -0
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 91d6964520e83c2088af45357edf601358d2ffefbff4861ef15e1abaf09a36bc
|
|
4
|
+
data.tar.gz: d276b0753bd7b956662a3f6e1d61cb51d707a9729496f17b8bd4a3ca1bc7fba4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b382e4fcd8171db8771f9f5f8d2238fdf2cd17b2ac4e953c54d06248eab390c321bf37579b954e3965bb7092c0959dcfae999782200ea8cbee487ca6c74b314
|
|
7
|
+
data.tar.gz: a6da50e40e16e4560d6c52e6443b36d2c7ffef5263940b73a3696d7411817ef5990cd26bf625141984694b7d2f824b22fdd88ba2e9072762b721b9e1718a3eaf
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [0.7.1] - 2026-04-06
|
|
2
|
+
|
|
3
|
+
### Fixed
|
|
4
|
+
- **`JsonFormatter` truncaba valores key=value sin comillas:** `KV_PARSE_RE` usaba `\S+` como fallback, cortando en el primer espacio. Ahora usa un lookahead que extiende el valor hasta el próximo token `key=` o fin de string. Ejemplo: `error_message=wrong number of arguments (given 1, expected 0)` ahora captura el valor completo en vez de truncar a `"wrong"`.
|
|
5
|
+
|
|
1
6
|
## [0.6.1] - 2026-04-05
|
|
2
7
|
|
|
3
8
|
### Added
|
|
@@ -56,8 +56,8 @@ module ExisRay
|
|
|
56
56
|
def initialize
|
|
57
57
|
@trace_header = "HTTP_X_AMZN_TRACE_ID"
|
|
58
58
|
@propagation_trace_header = "X-Amzn-Trace-Id"
|
|
59
|
-
@reporter_class =
|
|
60
|
-
@current_class =
|
|
59
|
+
@reporter_class = nil
|
|
60
|
+
@current_class = nil
|
|
61
61
|
@log_format = :text
|
|
62
62
|
@log_subscriber_class = nil
|
|
63
63
|
@service_version = default_service_version
|
|
@@ -22,8 +22,9 @@ module ExisRay
|
|
|
22
22
|
# Detecta si un string comienza con al menos un par key=value.
|
|
23
23
|
KV_DETECT_RE = /\A\w+=/
|
|
24
24
|
|
|
25
|
-
# Extrae pares key=value de un string. Soporta valores
|
|
26
|
-
|
|
25
|
+
# Extrae pares key=value de un string. Soporta valores entre comillas dobles/simples
|
|
26
|
+
# o valores sin comillas que se extienden hasta el próximo token key= o fin de string.
|
|
27
|
+
KV_PARSE_RE = /(\w+)=("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|(?:(?!\s+\w+=).)+)/
|
|
27
28
|
|
|
28
29
|
# Claves sensibles que deben filtrarse automáticamente según el estándar de Gabriel.
|
|
29
30
|
SENSITIVE_KEYS = /password|pass|passwd|secret|token|api_key|auth/i
|
|
@@ -181,7 +182,7 @@ module ExisRay
|
|
|
181
182
|
val = if value.start_with?('"', "'")
|
|
182
183
|
value[1..-2].to_s.gsub("\\#{value[0]}", value[0])
|
|
183
184
|
else
|
|
184
|
-
value
|
|
185
|
+
value.strip
|
|
185
186
|
end
|
|
186
187
|
|
|
187
188
|
result[key] = cast_value(key, val)
|
data/lib/exis_ray/railtie.rb
CHANGED
|
@@ -38,22 +38,21 @@ module ExisRay
|
|
|
38
38
|
# 3. Integraciones Post-Boot y Forzado de Formateadores
|
|
39
39
|
# Se ejecuta una vez que las gemas y el entorno de Rails están completamente cargados.
|
|
40
40
|
config.after_initialize do
|
|
41
|
-
# Validación de configuración:
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
end
|
|
41
|
+
# Validación de configuración: verificamos que las clases configuradas
|
|
42
|
+
# hereden de los tipos base. Usamos warn en lugar de raise porque en
|
|
43
|
+
# Rails 8.1+ after_initialize puede correr antes de eager_load!,
|
|
44
|
+
# y safe_constantize puede fallar aún con eager_load=true.
|
|
45
|
+
if (name = ExisRay.configuration.current_class).present?
|
|
46
|
+
klass = name.safe_constantize
|
|
47
|
+
if klass && !klass.<=(ExisRay::Current)
|
|
48
|
+
raise "ExisRay: current_class '#{name}' does not inherit from ExisRay::Current"
|
|
50
49
|
end
|
|
50
|
+
end
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
end
|
|
52
|
+
if (name = ExisRay.configuration.reporter_class).present?
|
|
53
|
+
klass = name.safe_constantize
|
|
54
|
+
if klass && !klass.<=(ExisRay::Reporter)
|
|
55
|
+
raise "ExisRay: reporter_class '#{name}' does not inherit from ExisRay::Reporter"
|
|
57
56
|
end
|
|
58
57
|
end
|
|
59
58
|
|
data/lib/exis_ray/version.rb
CHANGED
|
@@ -14,12 +14,12 @@ RSpec.describe ExisRay::Configuration do
|
|
|
14
14
|
expect(config.propagation_trace_header).to eq("X-Amzn-Trace-Id")
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
it "reporter_class por defecto es
|
|
18
|
-
expect(config.reporter_class).to
|
|
17
|
+
it "reporter_class por defecto es nil" do
|
|
18
|
+
expect(config.reporter_class).to be_nil
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
it "current_class por defecto es
|
|
22
|
-
expect(config.current_class).to
|
|
21
|
+
it "current_class por defecto es nil" do
|
|
22
|
+
expect(config.current_class).to be_nil
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
it "log_format por defecto es :text" do
|
|
@@ -287,6 +287,38 @@ RSpec.describe ExisRay::JsonFormatter do
|
|
|
287
287
|
|
|
288
288
|
expect(result).to eq({ "msg" => "hello world" })
|
|
289
289
|
end
|
|
290
|
+
|
|
291
|
+
it "captura valores sin comillas con espacios hasta el próximo key=" do
|
|
292
|
+
input = "event=unhandled_exception error_class=ArgumentError " \
|
|
293
|
+
"error_message=wrong number of arguments (given 1, expected 0)"
|
|
294
|
+
result = formatter.send(:parse_kv_string, input)
|
|
295
|
+
|
|
296
|
+
expect(result).to eq({
|
|
297
|
+
"event" => "unhandled_exception",
|
|
298
|
+
"error_class" => "ArgumentError",
|
|
299
|
+
"error_message" => "wrong number of arguments (given 1, expected 0)"
|
|
300
|
+
})
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
it "captura valores sin comillas con espacios al final del string" do
|
|
304
|
+
result = formatter.send(:parse_kv_string, "component=exis_ray event=something went wrong")
|
|
305
|
+
|
|
306
|
+
expect(result).to eq({
|
|
307
|
+
"component" => "exis_ray",
|
|
308
|
+
"event" => "something went wrong"
|
|
309
|
+
})
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
it "mezcla valores con y sin comillas correctamente" do
|
|
313
|
+
result = formatter.send(:parse_kv_string, 'event=error msg="hello world" detail=some extra info status=500')
|
|
314
|
+
|
|
315
|
+
expect(result).to eq({
|
|
316
|
+
"event" => "error",
|
|
317
|
+
"msg" => "hello world",
|
|
318
|
+
"detail" => "some extra info",
|
|
319
|
+
"status" => 500
|
|
320
|
+
})
|
|
321
|
+
end
|
|
290
322
|
end
|
|
291
323
|
|
|
292
324
|
describe "#filter_sensitive_hash (privado)" do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: exis_ray
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gabriel Edera
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-04-
|
|
11
|
+
date: 2026-04-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -87,8 +87,8 @@ licenses:
|
|
|
87
87
|
metadata:
|
|
88
88
|
homepage_uri: https://github.com/gedera/exis_ray
|
|
89
89
|
source_code_uri: https://github.com/gedera/exis_ray
|
|
90
|
-
changelog_uri: https://github.com/gedera/exis_ray/blob/v0.
|
|
91
|
-
documentation_uri: https://github.com/gedera/exis_ray/blob/v0.
|
|
90
|
+
changelog_uri: https://github.com/gedera/exis_ray/blob/v0.7.1/CHANGELOG.md
|
|
91
|
+
documentation_uri: https://github.com/gedera/exis_ray/blob/v0.7.1/skill
|
|
92
92
|
post_install_message:
|
|
93
93
|
rdoc_options: []
|
|
94
94
|
require_paths:
|