amalgm 0.1.47 → 0.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -70,7 +70,9 @@ function coerceAuth(harness, requested) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function runtimeHome({ amalgmDir, sessionId, harness, authMethod, tokenFingerprint }) {
|
|
73
|
-
|
|
73
|
+
// Claude Code provider auth is tied to the user's real home/keychain context.
|
|
74
|
+
// Isolating HOME makes the bundled Claude binary look logged out on macOS.
|
|
75
|
+
if (authMethod === 'provider_auth' && harness !== 'codex') return null;
|
|
74
76
|
const suffix = tokenFingerprint || 'default';
|
|
75
77
|
return path.join(amalgmDir, 'runtime', sessionId, harness, suffix);
|
|
76
78
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const assert = require('node:assert/strict');
|
|
4
|
+
const test = require('node:test');
|
|
5
|
+
const { authEnvelope, runtimeEnv } = require('../auth');
|
|
6
|
+
|
|
7
|
+
test('claude provider auth keeps the user home environment', () => {
|
|
8
|
+
const envelope = authEnvelope({
|
|
9
|
+
harness: 'claude_code',
|
|
10
|
+
authMethod: 'provider_auth',
|
|
11
|
+
sessionId: 'session-test',
|
|
12
|
+
amalgmDir: '/tmp/amalgm-test',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
assert.equal(envelope.runtimeHome, null);
|
|
16
|
+
|
|
17
|
+
const env = runtimeEnv({
|
|
18
|
+
harness: 'claude_code',
|
|
19
|
+
authMethod: 'provider_auth',
|
|
20
|
+
auth: envelope,
|
|
21
|
+
}, {
|
|
22
|
+
HOME: '/Users/example',
|
|
23
|
+
PATH: '/bin',
|
|
24
|
+
CLAUDE_CONFIG_DIR: '/Users/example/.claude',
|
|
25
|
+
ANTHROPIC_API_KEY: 'should-not-leak',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
assert.equal(env.HOME, '/Users/example');
|
|
29
|
+
assert.equal(env.CLAUDE_CONFIG_DIR, '/Users/example/.claude');
|
|
30
|
+
assert.equal(env.ANTHROPIC_API_KEY, undefined);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('codex provider auth still receives an isolated runtime home', () => {
|
|
34
|
+
const envelope = authEnvelope({
|
|
35
|
+
harness: 'codex',
|
|
36
|
+
authMethod: 'provider_auth',
|
|
37
|
+
sessionId: 'session-test',
|
|
38
|
+
amalgmDir: '/tmp/amalgm-test',
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
assert.match(envelope.runtimeHome, /\/tmp\/amalgm-test\/runtime\/session-test\/codex\/[^/]+$/);
|
|
42
|
+
});
|