mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 12:13:59 +00:00
feat(auth): add shared resource controls
This commit is contained in:
1 parent
2d382d5474
commit
64e1d1f815
32 files changed
+1068
-43
No files matched your search
@@ -31,7 +31,7 @@ describe('sync command MCP sync behavior', () => {
|
||||
mock.restore();
|
||||
});
|
||||
|
||||
it('syncs MCP servers only to non-bare profiles', async () => {
|
||||
it('syncs MCP servers only to shared-resource profiles', async () => {
|
||||
spyOn(ClaudeDirInstaller.prototype, 'install').mockReturnValue(true);
|
||||
spyOn(ClaudeDirInstaller.prototype, 'cleanupDeprecated').mockReturnValue({
|
||||
success: true,
|
||||
@@ -42,6 +42,8 @@ describe('sync command MCP sync behavior', () => {
|
||||
spyOn(ProfileRegistry.prototype, 'getAllProfilesMerged').mockReturnValue({
|
||||
work: profile(),
|
||||
sandbox: profile({ bare: true }),
|
||||
local: profile({ shared_resource_mode: 'profile-local' }),
|
||||
restored: profile({ bare: true, shared_resource_mode: 'shared' }),
|
||||
personal: profile(),
|
||||
});
|
||||
spyOn(InstanceManager.prototype, 'hasInstance').mockReturnValue(true);
|
||||
@@ -55,8 +57,16 @@ describe('sync command MCP sync behavior', () => {
|
||||
|
||||
await expect(handleSyncCommand()).rejects.toThrow('process.exit(0)');
|
||||
|
||||
expect(getInstancePathSpy.mock.calls.map((call) => call[0])).toEqual(['work', 'personal']);
|
||||
expect(syncMcpSpy.mock.calls.map((call) => call[0])).toEqual(['/tmp/work', '/tmp/personal']);
|
||||
expect(getInstancePathSpy.mock.calls.map((call) => call[0])).toEqual([
|
||||
'work',
|
||||
'restored',
|
||||
'personal',
|
||||
]);
|
||||
expect(syncMcpSpy.mock.calls.map((call) => call[0])).toEqual([
|
||||
'/tmp/work',
|
||||
'/tmp/restored',
|
||||
'/tmp/personal',
|
||||
]);
|
||||
});
|
||||
|
||||
it('skips MCP sync when all profiles are bare', async () => {
|
||||
@@ -69,7 +79,7 @@ describe('sync command MCP sync behavior', () => {
|
||||
spyOn(SharedManager.prototype, 'ensureSharedDirectories').mockImplementation(() => {});
|
||||
spyOn(ProfileRegistry.prototype, 'getAllProfilesMerged').mockReturnValue({
|
||||
sandbox: profile({ bare: true }),
|
||||
experiment: profile({ bare: true }),
|
||||
experiment: profile({ shared_resource_mode: 'profile-local' }),
|
||||
});
|
||||
spyOn(InstanceManager.prototype, 'hasInstance').mockReturnValue(true);
|
||||
|
||||
|
||||
Reference in new issue
Block a user