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
Part of #352. Updated for the same-origin / cookie-auth model.
ACM-mode transport behind the injected ctx.fetch, so authedFetch/queryJson/runQuery/loadSchema stay untouched. Pure translation logic in src/core/ at 100%.
Scope
Cookie auth, no token. Requests go to /api/cluster/{id}/query with credentials:'same-origin' and noAuthorization/X-Auth-Token header.
JSON body request: { node, query, ddl, user, password, timeout, swarm } (matches acm-ui's own cluster-explore/query). SQL/creds never in the URL.
Settings → in-SQL: rewrite otherwise-dropped query-string settings into an appended SETTINGS <k=v,…> clause; then FORMAT <fmt>. ⚠️ SQL-tail rewriter must handle existing FORMAT/SETTINGS, trailing ;, comments — its own pure module + tests.
Response unwrap: parse the per-node array → select the target node → on meta.error, synthesize a non-ok Response carrying the CH error text (so parseExceptionText works); else wrap resultas raw text for the requested format (do NOT blindly JSON.parse — TSV/CSV/raw and empty effect-statement bodies must pass through).
Fake progress-stream: for Table/KPI/Filter, emit the buffered rows as synthetic progress lines so runQuery's reader loop + grids work unchanged.
Explicit node required on every query (LB nondeterminism verified).
Removed vs. original
Map AUTHENTICATION_FAILED → synthetic 401 to reuse refresh(). The ACM session is browser-managed (cookie); a real session expiry is a normal login redirect. Only the temp CH password is ours to re-mint (see [sup] ACM cookie-auth session: URL cluster/node context + temp-credential lifecycle #354) — via an explicit single-flight remint on a CH-auth error, not by sniffing error text into the shared authedFetch refresh path (which latches authConfirmed after first success anyway).
Acceptance
Injected fetch; no changes to authedFetch/queryJson/runQuery.
Cookie auth; nothing in the URL; JSON body.
Settings effective via in-SQL SETTINGS; SQL-tail rewriter unit-tested on FORMAT/SETTINGS/;/comment edge cases.
result wrapped per-format; empty bodies + error envelopes handled.
Grids render via the fake stream unchanged; explicit node targeting.
Part of #352. Updated for the same-origin / cookie-auth model.
ACM-mode transport behind the injected
ctx.fetch, soauthedFetch/queryJson/runQuery/loadSchemastay untouched. Pure translation logic insrc/core/at 100%.Scope
/api/cluster/{id}/querywithcredentials:'same-origin'and noAuthorization/X-Auth-Tokenheader.{ node, query, ddl, user, password, timeout, swarm }(matches acm-ui's owncluster-explore/query). SQL/creds never in the URL.SETTINGS <k=v,…>clause; thenFORMAT <fmt>.FORMAT/SETTINGS, trailing;, comments — its own pure module + tests.meta.error, synthesize a non-okResponse carrying the CH error text (soparseExceptionTextworks); else wrapresultas raw text for the requested format (do NOT blindlyJSON.parse— TSV/CSV/raw and empty effect-statement bodies must pass through).Table/KPI/Filter, emit the buffered rows as synthetic progress lines sorunQuery's reader loop + grids work unchanged.Removed vs. original
Map. The ACM session is browser-managed (cookie); a real session expiry is a normal login redirect. Only the temp CH password is ours to re-mint (see [sup] ACM cookie-auth session: URL cluster/node context + temp-credential lifecycle #354) — via an explicit single-flight remint on a CH-auth error, not by sniffing error text into the sharedAUTHENTICATION_FAILED→ synthetic 401 to reuserefresh()authedFetchrefresh path (which latchesauthConfirmedafter first success anyway).Acceptance
fetch; no changes toauthedFetch/queryJson/runQuery.SETTINGS; SQL-tail rewriter unit-tested on FORMAT/SETTINGS/;/comment edge cases.resultwrapped per-format; empty bodies + error envelopes handled.