Repository navigation
fix(build): let an agent directory's auth.ts export authorizeApproval / authorizeSession - #661
Merged
Merged
Conversation
LinuxDevil
force-pushed
the
fix/build-authorize-hooks
branch
3 times, most recently
from
October 16, 2026 21:00
f35c995 to
796d2e1
Compare
… / authorizeSession A node-server / docker build of an agent directory always used the default access rules, so a manager could not decide another user's paused approval (403 LOUSHO_APPROVAL_FORBIDDEN) while the user could approve their own. auth.ts may now export functions named authorizeApproval and authorizeSession next to its default auth list; resolveAgentDir() returns them and the built server passes them to createDeployedServer(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinuxDevil
force-pushed
the
fix/build-authorize-hooks
branch
from
October 16, 2026 21:58
796d2e1 to
2e1e870
Compare
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.
Problem
An agent directory built with
lousho build <dir> --target=node-server(ordocker) always used the default access rules. With per-user tokens inauth.ts, a manager approving alice's paused claim got403 LOUSHO_APPROVAL_FORBIDDEN, while alice could approve her own. The generated server passed onlyauth/schedules/channelstocreateDeployedServer(), which already acceptsauthorizeApproval/authorizeSession.Fix
auth.tsmay export functions namedauthorizeApprovalandauthorizeSessionnext to its default auth list (default export unchanged). A non-function under those names fails the load withLOUSHO_AGENT_DIR_INVALID.resolveAgentDir()returns them onResolvedAgentDir.createDeployedServer().cloudflare-worker(it does not useauth.tsat all, onlyLOUSHO_API_TOKEN) andlousho dev(no route auth, so there is no principal to check). The docs say so.auth.ts, who may use a session, who may decide an approval, with a manager-approval example for agent directories), agent-directories.md, deployment.md; CHANGELOG; llms.txt regenerated; api report updated.Verification
src/deploy/adapters/node-server-approvals.test.ts: builds a fixture agent dir (alice/bob/manager tokens, both rules exported), runsdist/server.js; alice self-approve 403, manager approve 200 and run finishes; bob reading alice's session 403, manager 200. Fails on main's wiring, passes with the fix.loadAuth.test.tscovers the named exports and rejects a non-function.tsc --noEmit,npm run lint,npm run build, docs snippet check,vitest run src/agentDir src/deploy src/serverall pass.🤖 Generated with Claude Code