You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-ups from the device-flow review:
- README: the OIDC quick-start still called the pre-rename API (getToken()
as the interactive sign-in, auth::getTokenSilently). Use signIn() for the
one-time sign-in and auth::getToken for the token provider, matching the
renamed methods.
- OidcDeviceAuth: pre-encode the invariant form params (client_id, scope,
audience) once in the constructor and the device_code once in pollForToken,
instead of re-running URLEncoder on every poll (~once/5s through a sign-in)
and every silent refresh. Mirrors the existing GRANT_TYPE_*_ENCODED
constants; the wire output is unchanged. Add appendEncodedParam for the
pre-encoded values and keep appendParam for the dynamic refresh_token.
- Reorder getToken() before signIn() and rename the lagging
testGetTokenSilently* / testConcurrentGetToken* methods to match the
renamed API.
- QwpQueryClientTokenProviderTest: cover the real connect path, not just the
test hook - a throwing provider fails the connection attempt, the pulled
token reaches the actual upgrade Authorization header, and a null, empty or
blank provider return is rejected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Prefer `httpTokenProvider(auth::getTokenSilently)` for a long-lived sender: it pulls a freshly refreshed token on every request, so the sender keeps working as the token rotates. A fixed `httpToken(token)` captures the token once, so a sender that outlives the token's lifetime starts failing with 401s. Either way, hand the token to the client through the builder (or the header/password fields below), not by embedding it in a `Sender.fromConfig(...)` string or the `QDB_CLIENT_CONF` environment variable, which are easily logged, persisted, or left in shell history.
189
+
Prefer `httpTokenProvider(auth::getToken)` for a long-lived sender: it pulls a freshly refreshed token on every request, so the sender keeps working as the token rotates. A fixed `httpToken(token)` captures the token once, so a sender that outlives the token's lifetime starts failing with 401s. Either way, hand the token to the client through the builder (or the header/password fields below), not by embedding it in a `Sender.fromConfig(...)` string or the `QDB_CLIENT_CONF` environment variable, which are easily logged, persisted, or left in shell history.
190
190
191
191
By default the prompt prints the verification URL and code to `System.out`**and** tries to open the URL in your default browser. The browser open is best-effort: it only opens an `http(s)` URL, is skipped on a headless host or a JVM without the `java.desktop` module, and never blocks sign-in — the URL and code are always printed too, so a remote or browserless process still works. To disable the browser launch for a whole process (a server, automation, CI), set the system property `-Dquestdb.client.oidc.open.browser=false`. To print only (no browser) for a single client, pass `DeviceCodePrompt.SYSTEM_OUT`; to render the challenge yourself (a clickable link or QR code in a notebook), pass any `DeviceCodePrompt`:
192
192
@@ -195,7 +195,7 @@ By default the prompt prints the verification URL and code to `System.out` **and
0 commit comments