mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 04:53:33 +01:00
cleanup old setAuthToken
This commit is contained in:
@@ -126,20 +126,6 @@ suite('AgentService (node dispatcher)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ---- setAuthToken ---------------------------------------------------
|
||||
|
||||
suite('setAuthToken', () => {
|
||||
|
||||
test('broadcasts token to all registered providers', async () => {
|
||||
service.registerProvider(copilotAgent);
|
||||
|
||||
await service.setAuthToken('my-token');
|
||||
|
||||
assert.strictEqual(copilotAgent.setAuthTokenCalls.length, 1);
|
||||
assert.strictEqual(copilotAgent.setAuthTokenCalls[0], 'my-token');
|
||||
});
|
||||
});
|
||||
|
||||
// ---- listSessions / listModels --------------------------------------
|
||||
|
||||
suite('aggregation', () => {
|
||||
|
||||
@@ -19,7 +19,7 @@ export class MockAgent implements IAgent {
|
||||
private readonly _sessions = new Map<string, URI>();
|
||||
private _nextId = 1;
|
||||
|
||||
readonly setAuthTokenCalls: string[] = [];
|
||||
|
||||
readonly sendMessageCalls: { session: URI; prompt: string }[] = [];
|
||||
readonly disposeSessionCalls: URI[] = [];
|
||||
readonly abortSessionCalls: URI[] = [];
|
||||
@@ -80,10 +80,6 @@ export class MockAgent implements IAgent {
|
||||
this.changeModelCalls.push({ session, model });
|
||||
}
|
||||
|
||||
async setAuthToken(token: string): Promise<void> {
|
||||
this.setAuthTokenCalls.push(token);
|
||||
}
|
||||
|
||||
async authenticate(resource: string, token: string): Promise<boolean> {
|
||||
this.authenticateCalls.push({ resource, token });
|
||||
return true;
|
||||
@@ -241,8 +237,6 @@ export class ScriptedMockAgent implements IAgent {
|
||||
}
|
||||
}
|
||||
|
||||
async setAuthToken(_token: string): Promise<void> { }
|
||||
|
||||
async authenticate(_resource: string, _token: string): Promise<boolean> {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ class MockSideEffectHandler implements IProtocolSideEffectHandler {
|
||||
async handleCreateSession(_command: ICreateSessionParams): Promise<void> { /* session created via state manager */ }
|
||||
handleDisposeSession(_session: string): void { }
|
||||
async handleListSessions(): Promise<ISessionSummary[]> { return []; }
|
||||
handleSetAuthToken(_token: string): void { }
|
||||
handleGetResourceMetadata() { return { resources: [] }; }
|
||||
async handleAuthenticate(_params: { resource: string; token: string }) { return { authenticated: true }; }
|
||||
async handleBrowseDirectory(uri: string): Promise<{ entries: { name: string; type: 'file' | 'directory' }[] }> {
|
||||
|
||||
Reference in New Issue
Block a user