feat(openclaw-plugin): align auth, namespace, and role id handling#1606
Conversation
…ecall Made-with: Cursor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
|
AI说测试写偏了?看看是不是如此:这个剩余问题就是 tests/server/test_auth.py (line 38) 里的 helper 还在用 UserIdentifier(...).agent_space_name() 生成旧的 hash agent URI。PR 这次想验证的是 canonical namespace 行为,但这组测试实际没有用到插件现在会发出的 canonical agent 路径,所以会给人“都测过了”的错觉。换句话说,这个 PR 不是“完全没问题”,而是“主逻辑我没再看到明显 bug,但测试覆盖有一个实质缺口”。 |
的确写偏了,是原命名空间的残留,因为本PR是插件代码修改,不涉及server侧,故删除相关test代码 |
qin-ctx
left a comment
There was a problem hiding this comment.
This review only includes blocking issues. The current implementation conflicts with the server's existing api_key auth/session contracts in two places, so the plugin would regress common root-key and user-key deployments.
问题1. 已修复 |
Description
This PR updates the OpenClaw OpenViking plugin to align authentication behavior, canonical namespace expansion, and session
role_idpropagation with the current multi-tenant integration flow. It also adds test coverage and a Chinese test report for the validated matrix.Related Issue
#1479
#1351
Related PR
#1356
#1507
Type of Change
Changes Made
serverAuthModeand canonical namespace policy configuration.role_idfrom sender context in bothafterTurnandmemory_storesession writes.Testing
api_keyapi_key_without_key_devdefault/defaultdev fallback 生效api_keypersonal_token_defaultDEFAULT_USER_TOKEN_19950api_keyagentid_prefix_workerworker_maindeprecated_agent_aliasagentScopeMode=agent兼容正常new_policy_overrides_deprecatedff_user_tokenff_agent_tokentf_user_tokentf_agent_tokentt_user_tokentt_agent_tokentrustedtrusted_without_keytrustedtrusted_with_keytrustedtrusted_root_key_requiredtrustedtrusted_root_key_optional_oksenderId -> role_idsenderid_trusted_user_msgtelegram:12345 -> telegram_12345senderId -> role_idsenderid_trusted_blankrole_id:nullsenderId -> role_idsenderid_sanitize_symbolswx/user-01@abc -> wx_user-01_abcrole_idrole_idrole_idmemory_storerequesterSenderId -> role_idmemory_store已使用requesterSenderId写出真实role_idChecklist
Screenshots (if applicable)
Additional Notes