MCPcopy Create free account
hub / github.com/github/copilot-sdk / setCopilotUserByToken

Method setCopilotUserByToken

nodejs/test/e2e/harness/CapiProxy.ts:137–144  ·  view source on GitHub ↗

* Register a per-token response for the `/copilot_internal/user` endpoint. * When a request with `Authorization: Bearer ` arrives at the proxy, * the matching response is returned.

(token: string, response: CopilotUserResponse)

Source from the content-addressed store, hash-verified

135 * the matching response is returned.
136 */
137 async setCopilotUserByToken(token: string, response: CopilotUserResponse): Promise<void> {
138 const res = await fetch(`${this.proxyUrl}/copilot-user-config`, {
139 method: "POST",
140 headers: { "content-type": "application/json" },
141 body: JSON.stringify({ token, response }),
142 });
143 expect(res.ok).toBe(true);
144 }
145}
146
147function tryParseStartupInfo(line: string): ProxyStartupInfo | undefined {

Calls

no outgoing calls

Tested by 2