agentHostAuthenticationService.ts ×4

Frontier kind: Code frontier

unlabeled · c_b9be69d3993a

12 tests · 50743 LOC · 304 files · introduces 0 tests · 27 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges27 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5151 ranges50743 lines · 304 files · Browse complete extent
All tests (intent)
12 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 27 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentHostAuthenticationService.ts 25 introduced LOC · 4 ranges

Open complete file

22
23 async authenticate(params: AuthenticateParams, providers: Iterable<IAgent>): Promise<AuthenticateResult> {
24 > this._logService.trace(`[AgentHostAuthenticationService] authenticate called: resource=${params.resource}`); agentHostAuthenticationService.ts
25 > const providerList = [...providers];
26 > // Multiple providers may share the same protected resource (e.g.
27 > // both Copilot CLI and Claude consume the GitHub Copilot token).
28 > // Fan out to every matching provider in parallel; the request is
29 > // considered authenticated if at least one accepts. Provider
30 > // failures are isolated -- one provider rejecting (e.g. proxy
31 > // server bind failure) MUST NOT prevent another provider from
32 > // accepting the same token.
33 > const matching = providerList.filter(
34 > p => p.getProtectedResources().some(r => r.resource === params.resource),
35 > );
36 > const settled = await Promise.allSettled(
37 > matching.map(p => p.authenticate(params.resource, params.token)),
38 > );
39 > let authenticated = false;
40 > for (let i = 0; i < settled.length; i++) {
41 const result = settled[i];
42 if (result.status === 'fulfilled') {
49 }
50 }
51 > const sessionResourceHandlers = providerList.filter(p => p.handleAuthenticationToken); agentHostAuthenticationService.ts
52 > const sessionResourceSettled = await Promise.allSettled(
53 > sessionResourceHandlers.map(p => p.handleAuthenticationToken ? p.handleAuthenticationToken(params) : Promise.resolve(false)),
54 > );
55 > for (let i = 0; i < sessionResourceSettled.length; i++) {
56 const result = sessionResourceSettled[i];
57 if (result.status === 'fulfilled') {
64 }
65 }
66 > if (authenticated) { agentHostAuthenticationService.ts
67 const scopes = this._normalizeScopes(params.scopes);
68 this._tokens.set(this._key(params.resource, scopes), { resource: params.resource, scopes, token: params.token });
69 }
70 > return { authenticated }; agentHostAuthenticationService.ts
71 > }
72
73 getAuthToken(request: IAgentHostAuthTokenRequest): string | undefined {
src/vs/platform/agentHost/node/agentService.ts 2 introduced LOC · 1 range

Open complete file

682
683 async authenticate(params: AuthenticateParams): Promise<AuthenticateResult> {
684 > return this._authService.authenticate(params, this._providers.values()); agentService.ts
685 > }
686
687 getAuthToken(request: IAgentHostAuthTokenRequest): string | undefined {