jagadish-zentiti
bc771fbc1e
fix(mcp): guard DbTokenStorage against non-dict oauth_tokens JSON ( #5107 )
...
_load() returned whatever json.loads() produced without checking it was a
dict; _update() did the same before assigning data[key] = value. If the
oauth_tokens column ever held a JSON array or primitive (DB corruption,
manual edit, migration drift), _load()'s callers crashed with
AttributeError on .get(), and _update() crashed with TypeError trying to
item-assign into a list/string/int.
Validate the parsed value is a dict in both methods, falling back to {}
otherwise - same recovery behavior already used elsewhere in the codebase
for this exact JSON-blob-is-not-a-dict shape (_parse_tool_args,
_is_sensitive_path's siblings).
Adds 3 regression tests for _load, get_tokens, and _update against a
non-dict oauth_tokens value.
Fixes #5082
2026-07-11 05:26:23 +01:00
..
2026-07-07 00:51:34 +00:00
2026-06-04 18:57:24 +02:00
2026-07-11 01:45:14 +01:00
2026-07-07 00:50:07 +00:00
2026-07-08 17:44:28 +00:00
2026-06-19 00:34:30 +00:00
2026-06-28 14:07:23 +00:00
2026-06-23 23:28:53 +02:00
2026-06-23 16:12:32 +02:00
2026-06-27 22:25:13 +01:00
2026-05-31 23:58:26 +09:00
2026-06-07 12:55:01 +02:00
2026-06-19 00:28:22 -07:00
2026-06-15 15:03:09 +09:00
2026-06-29 14:59:25 +00:00
2026-06-28 01:18:17 +01:00
2026-06-28 14:07:23 +00:00
2026-06-24 11:11:07 +00:00
2026-06-29 01:45:05 +00:00
2026-06-08 21:33:29 +02:00
2026-06-28 01:23:08 +01:00
2026-06-09 10:16:38 +09:00
2026-06-01 22:22:41 +09:00
2026-06-03 14:14:27 +09:00
2026-06-15 17:44:10 +01:00
2026-06-21 11:08:50 +00:00
2026-06-29 19:56:17 +01:00
2026-06-15 20:31:57 +09:00
2026-06-27 13:05:44 +00:00
2026-07-08 23:57:23 +02:00
2026-05-31 23:58:26 +09:00
2026-06-10 12:08:22 +01:00
2026-07-01 10:11:22 +00:00
2026-07-08 21:04:15 +02:00
2026-06-03 14:06:31 +09:00
2026-06-09 10:40:17 +02:00
2026-06-26 14:21:27 +01:00
2026-07-07 00:50:07 +00:00
2026-06-08 09:58:52 +02:00
2026-06-24 16:50:07 +02:00
2026-06-08 09:58:52 +02:00
2026-06-06 03:37:10 -06:00
2026-06-30 19:54:51 +02:00
2026-07-05 03:44:19 +03:00
2026-07-07 00:50:07 +00:00
2026-07-07 00:50:07 +00:00
2026-06-10 15:15:13 +09:00
2026-06-15 17:44:10 +01:00
2026-07-11 05:26:23 +01:00
2026-06-04 16:26:11 +01:00
2026-06-06 03:17:19 -06:00
2026-06-04 05:31:15 +01:00
2026-06-30 18:04:29 +01:00
2026-06-27 16:25:15 +01:00
2026-06-15 21:20:15 +09:00
2026-06-15 15:16:41 +09:00
2026-06-10 10:41:52 +02:00
2026-05-31 23:58:26 +09:00
2026-06-01 18:27:17 +09:00
2026-06-29 19:24:29 +01:00
2026-06-08 19:16:37 +02:00
2026-06-27 13:50:04 +01:00
2026-07-03 15:07:16 +01:00
2026-06-15 17:44:10 +01:00
2026-06-16 03:33:02 +01:00
2026-05-31 23:58:26 +09:00
2026-06-02 23:33:22 +09:00
2026-06-10 15:15:13 +09:00
2026-05-31 23:58:26 +09:00
2026-06-11 01:17:02 +02:00
2026-06-03 13:42:24 +09:00
2026-06-15 17:44:10 +01:00
2026-06-08 09:58:52 +02:00
2026-06-09 16:00:24 +01:00
2026-06-09 01:06:20 +01:00
2026-06-27 13:05:44 +00:00
2026-06-11 12:53:33 +02:00
2026-06-28 21:49:09 +00:00
2026-07-05 13:19:04 +01:00
2026-07-07 00:50:07 +00:00
2026-07-07 00:51:34 +00:00
2026-06-28 00:48:35 +01:00
2026-06-27 10:12:28 -07:00
2026-06-04 13:18:50 +01:00
2026-07-02 10:11:51 +01:00
2026-06-28 14:07:23 +00:00
2026-07-07 00:50:07 +00:00
2026-07-07 00:50:07 +00:00
2026-07-08 17:44:28 +00:00
2026-07-07 00:51:34 +00:00
2026-06-30 16:50:32 +01:00
2026-07-03 13:07:44 +01:00
2026-06-02 20:44:27 +09:00
2026-06-26 18:01:04 +01:00
2026-06-09 01:24:30 +02:00
2026-06-29 16:32:32 +01:00
2026-06-03 22:47:00 +09:00
2026-06-28 00:05:02 +01:00
2026-06-27 17:44:32 +01:00
2026-07-04 17:03:38 +01:00
2026-06-15 15:03:41 +09:00