* 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)
| 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 | |
| 147 | function tryParseStartupInfo(line: string): ProxyStartupInfo | undefined { |
no outgoing calls