mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-20 04:59:34 +01:00
fix(webview): the review items of #825
The owner of a managed dsh tab is compared with the server's starter only in multi-user mode: a record created there keeps its owner, while a single-user start records none, so that tab would never get its cookie again (new route test). CLAUDE.md and the invariants doc name the cookie rules. The third item, Codeman's session cookie filtered on the WebSocket leg whether or not the dsh cookie is injected, came in with the merge itself, where it met #827. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9d0f29fb22
commit
acd90efe73
4 files changed
+25
-3
No files matched your search
@@ -512,6 +512,24 @@ describe('managed DeepSeek web cookie', () => {
|
||||
expect(getDeepSeekWebCookie).toHaveBeenCalledWith(upstream.port, 'carol');
|
||||
});
|
||||
|
||||
// A record keeps the owner it was created under. Back in single-user mode the
|
||||
// server is started with no starter, so comparing that stale owner would leave
|
||||
// the tab on dsh's 401 for good.
|
||||
it('presents it in single-user mode to a managed tab created under multi-user mode', async () => {
|
||||
process.env.CODEMAN_MULTIUSER = '1';
|
||||
currentUser = { username: 'carol', role: 'user' };
|
||||
await writeUsersFixture([{ username: 'carol', role: 'user', canBypassPermissions: true }]);
|
||||
const upstream = await startUpstream();
|
||||
const cap = await openManaged(`http://127.0.0.1:${upstream.port}/`);
|
||||
|
||||
delete process.env.CODEMAN_MULTIUSER;
|
||||
currentUser = undefined;
|
||||
mintCookieOn(upstream.port, undefined);
|
||||
expect((await getThrough(cap)).statusCode).toBe(200);
|
||||
expect(upstream.cookies).toEqual([COOKIE]);
|
||||
expect(getDeepSeekWebCookie).toHaveBeenCalledWith(upstream.port, undefined);
|
||||
});
|
||||
|
||||
/**
|
||||
* A loopback listener that completes the upgrade and records the cookie on the
|
||||
* handshake. The realtime leg is a separate code path from `proxyRequest`, so
|
||||
|
||||
Reference in new issue
Block a user