Skip to content

Commit 16cb006

Browse files
Update e2e for Authorization pass-through in provider endpoint
The runtime now surfaces Authorization in the headers map (consistent with BYOK pass-through) rather than stripping it. Update the e2e to assert the new contract and regen the RPC bindings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b7579b9 commit 16cb006

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

nodejs/src/generated/rpc.ts

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodejs/test/e2e/provider_endpoint.e2e.test.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ describe("session.provider.getEndpoint RPC", async () => {
3434
expect(endpoint.baseUrl).toBe("https://api.example.test/v1");
3535
expect(endpoint.apiKey).toBe("byok-secret");
3636
expect(endpoint.headers).toMatchObject({ "X-Custom-Header": "byok-yes" });
37-
// Auth and per-request session-token headers should not appear here.
38-
expect(endpoint.headers).not.toHaveProperty("Authorization");
39-
expect(endpoint.headers).not.toHaveProperty("Copilot-Session-Token");
4037
// BYOK sessions never issue a CAPI session token.
4138
expect(endpoint.sessionToken).toBeUndefined();
4239
} finally {
@@ -69,15 +66,13 @@ describe("session.provider.getEndpoint RPC", async () => {
6966
expect(endpoint.apiKey).toBeTypeOf("string");
7067
expect(endpoint.apiKey!.length).toBeGreaterThan(0);
7168

72-
// Standard CAPI headers should be present, and the Authorization /
73-
// session-token headers must not be in `headers` (they're carried
74-
// by `apiKey` and `sessionToken` respectively).
69+
// Standard CAPI headers should be present, and Authorization is
70+
// surfaced as the runtime sends it (`Bearer <apiKey>`).
7571
expect(endpoint.headers["Copilot-Integration-Id"]).toBeTypeOf("string");
7672
expect(endpoint.headers["User-Agent"]).toMatch(/Copilot/i);
7773
expect(endpoint.headers["X-GitHub-Api-Version"]).toBeTypeOf("string");
7874
expect(endpoint.headers["X-Interaction-Id"]).toMatch(/[0-9a-f-]{8,}/);
79-
expect(endpoint.headers).not.toHaveProperty("Authorization");
80-
expect(endpoint.headers).not.toHaveProperty("Copilot-Session-Token");
75+
expect(endpoint.headers.Authorization).toBe(`Bearer ${endpoint.apiKey}`);
8176

8277
// When the omit-modelId path returned an auto-mode session token, it
8378
// must use the documented header name and an ISO 8601 expiry. The

0 commit comments

Comments
 (0)