DM creation regression in --auth-mode=dev: 'Authentication required' from PR #32 #40
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_collab#40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
In
--auth-mode=dev, everystartDmclick in the chat-app logs:DM never gets created. Reproduced on the dev box (
--auth-mode=dev, accessed over the Mycelium overlay →hero_routeron:9988).Root cause
PR #32 (DM permission gate split) replaced the previous
check_permission("channel.create", ...)call for DMs with a manual:The dev-mode bypass on the membership probe is correct, but it sits after the
ok_or(Unauthenticated)line. In the typical dev-mode flow:main.rs::handle_rpclines 491-501 force-dropX-Hero-Userso the picker can drive identity. caller_id is never resolved into params.chat-app.js::startDmdoesn't passcaller_idin params either (onlycreated_by).channel.rs::create:input.caller_id.ok_or(...)short-circuits →Authentication required. The dev bypass is never reached.Pre-PR-#32, the gate went through
check_permissionwhich hasif is_dev_mode() { return Ok(()); }at the very top, so dev-mode flows passed through cleanly.The auth-mode regression check in PR #32 verified the dev-mode case only by passing
caller_idexplicitly in a hand-crafted curl — which the chat-app does not.Truth table
:9988:9997:9997:9988Fix in
PR linked below — uses
require_caller(the canonical helper already used bychannel.rs::member_add) which folds the dev-bypass / proxy-fail-closed / authenticated-caller logic into one match.