Repository navigation
Zeta 后端:Worker UI 反代路由 + spark:8082 链接改写 + 登记字段 - #268
Merged
todosdev[bot] merged 4 commits intoNov 30, 2026
Merged
Conversation
…4-7afe-b4da-9ed1e5df51f4 # Conflicts: # worker/src/index.ts
…4-7afe-b4da-9ed1e5df51f4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
/spark-worker:验 Zeta 登录态(口径同/spark-ui),按当前数据源上下文转发到登记的 Worker UI 上游,调用带Authorization: Bearer。/spark-ui与/spark-history反代响应中,把指向spark:8082的 executor 日志链接(logPage 等)改写到/spark-worker,沿用既有反代改写实现。worker_ui_url:粘贴带?_token=的完整链接,后端拆令牌、存干净地址 + 独立 token,调用仍用 Bearer;DTO 暴露has_worker_ui。变更
worker/src/routes/spark-worker.ts:Worker UI 反代 +rewriteWorkerLocation/Url/Html+ 会话 Cookie(spark_worker_session,Path=/spark-worker)。worker/src/lib/spark-worker-link.ts:固定spark:8082链接改写与共享常量(SPARK_WORKER_MOUNT、SPARK_WORKER_SESSION_COOKIE)。worker/src/routes/spark-ui.ts、worker/src/routes/spark-history.ts:rewriteSparkUiUrl/Location/Html、rewriteHistoryUrl/Location/Html前置rewriteSparkWorkerLink;会话 bootstrap 同时 mint worker Cookie。worker/src/lib/spark-access.ts:normalizeSparkAccess新增worker_ui_url拆令牌逻辑,存worker_url+worker_platform_token(round-trip 兼容);hasWorkerUi/checkDatabaseHasWorkerUi。worker/src/routes/admin.ts:登记/更新/测试路径接入worker_ui_url,含非 Spark 拒绝与 PATCH 更新/清空。worker/src/routes/databases.ts:GET /api/databases增加has_worker_ui。worker/src/lib/auth.ts:worker_ui会话 token(create/verify)。worker/src/middleware/auth.ts、worker/src/middleware/security.ts:/spark-worker路径特判。worker/src/routes/auth.ts:logout 清理spark_worker_session。worker/src/index.ts:注册/spark-worker、/api/spark-worker。spark-access/spark-ui/spark-history/spark-worker/admin-spark/databases等新增用例,覆盖登记拆令牌、链接改写、裸导航经 Cookie 认证转发。测试
worker/pnpm type-check:通过。vitest run(spark-access / spark-ui / spark-history / spark-worker / admin-spark / databases / query-spark / livy / auth-login):261 通过。worker/pnpm test:1187 passed | 9 failed | 2 skipped;9 个失败均为spark-live.test.ts命中本机已配置的SPARK_ACCESS真端点返回 starting/unreachable(与本次改动无关,CI 无该环境变量时会跳过)。