Commit a454ac0
Fix OIDC refresh NPE and harden display safety
Address three moderate findings from the device-flow review.
adopt() no longer nulls a live in-memory refresh token when a re-read
store entry carries a valid served token but no refresh_token (a
cross-language peer that never received one, or a tampered file).
Nulling it made tryRefresh() call urlEncode(null) and throw an uncaught
NullPointerException that aborted getToken()/signIn() instead of
degrading to a refresh or an interactive sign-in. adopt() now keeps the
current refresh token and tracks what the file actually carried;
tryRefresh() also guards against a null refresh token defensively.
DisplaySafe.isDisplaySafe() now rejects U+2028 LINE SEPARATOR and U+2029
PARAGRAPH SEPARATOR, which are neither ISO control nor Cf format chars
yet break a rendered log line in ECMAScript/GUI/JSON log consumers. One
classifier change closes the gap across every sanitizer that shares it
(sanitizeForDisplay, OidcAuthException.putSanitized, and
Utf16Sink.putAsPrintable).
The httpTokenProvider Javadoc now documents that a failed HTTP flush
preserves the buffered request and its baked token and re-sends it
verbatim on retry rather than re-pulling, so a flush that keeps failing
until the pulled token expires is then rejected (for example a 401)
until the caller discards the buffered rows.
Add DisplaySafeTest coverage for U+2028/U+2029 and an
OidcDeviceAuthPersistenceTest regression that reproduces the refresh NPE
via a peer entry omitting the refresh token (verified both ways).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ea7c1a8 commit a454ac0
5 files changed
Lines changed: 80 additions & 7 deletions
File tree
- core/src
- main/java/io/questdb/client
- cutlass/auth
- std/str
- test/java/io/questdb/client/test
- cutlass/auth
- std/str
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2026 | 2026 | | |
2027 | 2027 | | |
2028 | 2028 | | |
2029 | | - | |
2030 | | - | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
2031 | 2039 | | |
2032 | 2040 | | |
2033 | 2041 | | |
| |||
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
1040 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1041 | 1049 | | |
1042 | 1050 | | |
1043 | 1051 | | |
| |||
1054 | 1062 | | |
1055 | 1063 | | |
1056 | 1064 | | |
1057 | | - | |
1058 | | - | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
1059 | 1069 | | |
1060 | 1070 | | |
1061 | 1071 | | |
| |||
1463 | 1473 | | |
1464 | 1474 | | |
1465 | 1475 | | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
1466 | 1481 | | |
1467 | 1482 | | |
1468 | 1483 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
313 | 344 | | |
314 | 345 | | |
315 | 346 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
74 | 87 | | |
75 | 88 | | |
76 | 89 | | |
| |||
0 commit comments