schwab_rb 1.0.4 → 1.0.5
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/lib/schwab_rb/stream/base.rb +34 -2
- data/lib/schwab_rb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8d136dcb5cef454ed8cfaca6a8ad90a8ebf25971e283e4098f73dc765d06023c
|
|
4
|
+
data.tar.gz: 93bfb2468fcc4706b361bd987087256eed9fe84e6ef3486743659acd51e0de61
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d684f28d255009c90b0fb0abd401f6c452532bdcdbb1ccbc42d6a33c893aef8f6821af278ffbd9f81792e53db7f511ce561c7d29ac80a5f1d682aded578f886
|
|
7
|
+
data.tar.gz: 2772b8c48ab306c3d821639bc68ac950bdd7b8b56995f13a55a495b4d60fa5b0f87e2114d471622e6ce2069a8d93a3d8837865f346f7545148cf5b129cb1a1d4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.0.5] - 2026-10-19
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Sanitized stream subscription logging (`SUBS`, `ADD`, `UNSUBS`) at INFO level with service, command, request ID, and keys.
|
|
7
|
+
- Stream subscription acknowledgement response logging at INFO level with service, command, response code, message, and request ID.
|
|
8
|
+
|
|
9
|
+
### Security
|
|
10
|
+
- Redacted `Authorization` access tokens in WebSocket outbound debug logging.
|
|
11
|
+
|
|
3
12
|
## [1.0.4] - 2026-09-21
|
|
4
13
|
|
|
5
14
|
### Added
|
|
@@ -72,6 +72,7 @@ module SchwabRb
|
|
|
72
72
|
service_name, Commands::UNSUBS,
|
|
73
73
|
keys: symbols_to_remove
|
|
74
74
|
)
|
|
75
|
+
log_subscription_request(request)
|
|
75
76
|
send_message(@message_builder.wrap_requests(request))
|
|
76
77
|
end
|
|
77
78
|
|
|
@@ -176,6 +177,7 @@ module SchwabRb
|
|
|
176
177
|
keys: sub[:symbols],
|
|
177
178
|
fields: sub[:fields]
|
|
178
179
|
)
|
|
180
|
+
log_subscription_request(request)
|
|
179
181
|
send_message(@message_builder.wrap_requests(request))
|
|
180
182
|
end
|
|
181
183
|
end
|
|
@@ -186,6 +188,7 @@ module SchwabRb
|
|
|
186
188
|
keys: handler[:symbols],
|
|
187
189
|
fields: handler[:fields]
|
|
188
190
|
)
|
|
191
|
+
log_subscription_request(request)
|
|
189
192
|
send_message(@message_builder.wrap_requests(request))
|
|
190
193
|
end
|
|
191
194
|
|
|
@@ -213,10 +216,36 @@ module SchwabRb
|
|
|
213
216
|
return unless parsed.key?("response")
|
|
214
217
|
|
|
215
218
|
parsed["response"].each do |resp|
|
|
216
|
-
|
|
219
|
+
log_stream_response(resp)
|
|
217
220
|
end
|
|
218
221
|
end
|
|
219
222
|
|
|
223
|
+
def log_subscription_request(request)
|
|
224
|
+
service = request["service"]
|
|
225
|
+
command = request["command"]
|
|
226
|
+
request_id = request["requestid"]
|
|
227
|
+
keys = request.dig("parameters", "keys")
|
|
228
|
+
SchwabRb::Logger.logger.info(
|
|
229
|
+
"Stream subscription request: service=#{service} command=#{command} " \
|
|
230
|
+
"request_id=#{request_id} keys=#{keys}"
|
|
231
|
+
)
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
def log_stream_response(resp)
|
|
235
|
+
service = resp["service"]
|
|
236
|
+
command = resp["command"]
|
|
237
|
+
request_id = resp["requestid"]
|
|
238
|
+
content = resp["content"] || {}
|
|
239
|
+
code = content["code"]
|
|
240
|
+
msg = content["msg"]
|
|
241
|
+
|
|
242
|
+
SchwabRb::Logger.logger.info(
|
|
243
|
+
"Stream response: service=#{service} command=#{command} " \
|
|
244
|
+
"code=#{code} msg=#{msg.inspect} request_id=#{request_id}"
|
|
245
|
+
)
|
|
246
|
+
SchwabRb::Logger.logger.debug("Raw stream response: #{resp}")
|
|
247
|
+
end
|
|
248
|
+
|
|
220
249
|
def handle_disconnect(error)
|
|
221
250
|
@connected = false
|
|
222
251
|
begin
|
|
@@ -255,7 +284,10 @@ module SchwabRb
|
|
|
255
284
|
@write_mutex.synchronize do
|
|
256
285
|
return unless @connection
|
|
257
286
|
|
|
258
|
-
SchwabRb::Logger.logger.debug
|
|
287
|
+
if SchwabRb::Logger.logger.debug?
|
|
288
|
+
sanitized = json_string.gsub(/"Authorization"\s*:\s*"[^"]*"/, '"Authorization":"[REDACTED]"')
|
|
289
|
+
SchwabRb::Logger.logger.debug("Stream sending: #{sanitized}")
|
|
290
|
+
end
|
|
259
291
|
@connection.write(json_string)
|
|
260
292
|
@connection.flush
|
|
261
293
|
end
|
data/lib/schwab_rb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: schwab_rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joseph Platta
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-10-19 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: async
|