test(cline): align auth-header test with upstream WorkOS-JWT-only prefixing
Upstream f6e7cabe stopped workos:-prefixing opaque tokens (ClinePass API
keys like clp_...), so getClineAccessToken now only prefixes WorkOS JWTs.
The fork's test asserted the old unconditional-prefix behavior.
This commit is contained in:
@@ -53,9 +53,15 @@ describe("cline auth header shape", () => {
|
||||
expect(buildClineHeaders("sk_abc", {}, { isApiKey: true }).Authorization).toBe("Bearer sk_abc");
|
||||
});
|
||||
|
||||
it("prefixes OAuth tokens with workos:", () => {
|
||||
expect(buildClineHeaders("tok123").Authorization).toBe("Bearer workos:tok123");
|
||||
expect(buildClineHeaders("workos:tok123").Authorization).toBe("Bearer workos:tok123");
|
||||
it("prefixes WorkOS JWT OAuth tokens with workos:", () => {
|
||||
const jwt = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIn0.sig";
|
||||
expect(buildClineHeaders(jwt).Authorization).toBe(`Bearer workos:${jwt}`);
|
||||
expect(buildClineHeaders(`workos:${jwt}`).Authorization).toBe(`Bearer workos:${jwt}`);
|
||||
});
|
||||
|
||||
it("does not workos:-prefix opaque tokens (API keys, clp_…)", () => {
|
||||
expect(buildClineHeaders("tok123").Authorization).toBe("Bearer tok123");
|
||||
expect(buildClineHeaders("clp_abc123").Authorization).toBe("Bearer clp_abc123");
|
||||
});
|
||||
|
||||
it("sends Cline product identity headers (free-model gate)", () => {
|
||||
|
||||
Reference in New Issue
Block a user