fix(superset): disable Secure session cookie over HTTP so mo/bart can log in
Talisman forced Secure on the session cookie while Superset is served over
plain HTTP, so browsers never returned the cookie and every login failed CSRF
validation ("CSRF session token is missing"). Set session_cookie_secure=False
(+ SESSION_COOKIE_SECURE/WTF_CSRF_SSL_STRICT). Also rename S3 lakehouse prefix
iceberg-warehouse -> hadoop (Trino iceberg.hadoop.historical_sales) and repoint
the Superset dataset. Adds sanitized infra backup scripts.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import sys, json, time, urllib.request
|
||||
|
||||
TRINO = "http://127.0.0.1:8089"
|
||||
USER = "mo"
|
||||
|
||||
def run(sql):
|
||||
req = urllib.request.Request(
|
||||
TRINO + "/v1/statement", data=sql.encode(),
|
||||
headers={"X-Trino-User": USER, "X-Trino-Catalog": "iceberg",
|
||||
"Content-Type": "text/plain"})
|
||||
rows, cols = [], None
|
||||
r = json.loads(urllib.request.urlopen(req).read())
|
||||
while True:
|
||||
if r.get("columns") and cols is None:
|
||||
cols = [c["name"] for c in r["columns"]]
|
||||
rows.extend(r.get("data", []) or [])
|
||||
nxt = r.get("nextUri")
|
||||
st = r.get("stats", {}).get("state")
|
||||
err = r.get("error")
|
||||
if err:
|
||||
raise RuntimeError(json.dumps(err.get("message", err)))
|
||||
if not nxt:
|
||||
break
|
||||
time.sleep(0.1)
|
||||
r = json.loads(urllib.request.urlopen(urllib.request.Request(
|
||||
nxt, headers={"X-Trino-User": USER})).read())
|
||||
return cols, rows
|
||||
|
||||
if __name__ == "__main__":
|
||||
sql = sys.stdin.read() if len(sys.argv) < 2 else sys.argv[1]
|
||||
for stmt in [s for s in sql.split(";\n") if s.strip()]:
|
||||
cols, rows = run(stmt.strip())
|
||||
print(f"--- {stmt.strip()[:70]} ---")
|
||||
if cols:
|
||||
print("\t".join(cols))
|
||||
for row in rows[:50]:
|
||||
print("\t".join(str(x) for x in row))
|
||||
Reference in New Issue
Block a user