Skip to content

当前 - #116

Open
thefloshibisci wants to merge 18 commits into
P0luz:mainfrom
thefloshibisci:main
Open

当前#116
thefloshibisci wants to merge 18 commits into
P0luz:mainfrom
thefloshibisci:main

Conversation

@thefloshibisci

Copy link
Copy Markdown

改了什么

为什么这么改

测过没有


  • 我的提交都带了 Signed-off-by:(git commit -s),
    表示我有权提交这些代码 —— 见 DCO 与 CONTRIBUTING.md
  • 没有把真实记忆内容、API Key、密码带进这个 PR

The star-map detail page in Xinchao calls /api/bucket/{id} with the
same Bearer token used for MCP protocol auth (OMBRE_MCP_TOKEN /
config['mcp_token']).  The previous fix (73a318a) only accepted a
separate OMBRE_MCP_SERVICE_TOKEN env var, which is typically not
configured.  This made every feel/plan/letter/i bucket appear in the
star map (via pulse) but show 'not in current memory library' when
clicked, because the HTTP read returned 401 and the MCP search
fallback could not find the bucket by query.

Now _is_service_token_authenticated accepts either the dedicated
service token or the live MCP static token, both in constant time.
Mutation routes remain Dashboard-session-only.
The production MCP token is 10 chars, but _MIN_SERVICE_TOKEN_LENGTH=32
was used for both service tokens and MCP tokens, causing the 10-char
token to be rejected with 401 on HTTP API routes like /api/bucket/{id}.

- Add _MIN_MCP_TOKEN_LENGTH=8 (MCP tokens are validated by the MCP
  server itself, lower bar is acceptable)
- Service tokens still require _MIN_SERVICE_TOKEN_LENGTH=32 (unchanged)
- Add regression tests for short (10-char) MCP tokens
@WS-www

WS-www commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

感谢提交。逐个看了 7 个提交,我这边的审查意见如下,最终由主负责人决定。

鉴权放宽的两处不建议合并。 只读桶详情端点接受 MCP 静态 token、调低 token 最小长度,这两处都在放宽鉴权。本地复现:用 MCP 静态 token 调 /api/bucket/{id},人类锁给 AI 的信在这个 PR 下返回 200 和正文,main / testing 上是 401;oauth 模式下配置里残留的静态 token 也会被接受。如果是第三方 sidecar 需要读桶详情,建议另开 issue 讨论一个独立、默认关闭、按 AI 视角过滤锁信的只读接口。

其他几点:

  • Dockerfile 加回了 apt-get update,那一行是之前为用户反馈专门去掉的。
  • src/tools/anchor/core.py 的 +235/−228 主要是 merge 提交把整个文件从 CRLF 改成了 LF,真正的改动约 7 行;src/web/_shared.py 多了 BOM。
  • 7 个提交都没有 Signed-off-by(见 CONTRIBUTING.md 的 DCO 说明);新增的环境变量没有登记到 docs/ENVIRONMENT_VARIABLES.md;测试里的 token 样例建议换成明显的假值。

pulse 把 type == "i" 的条目单独分区这个想法可取,但 I 条目该不该出现在 pulse 里需要主负责人先定,定了之后可以单独提一个小 PR。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants