chore(opencode): consolidate escape logic (#32360)
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
parseJwtClaims,
|
||||
extractAccountIdFromClaims,
|
||||
extractAccountId,
|
||||
renderOAuthError,
|
||||
type IdTokenClaims,
|
||||
} from "../../src/plugin/openai/codex"
|
||||
|
||||
@@ -14,6 +15,14 @@ function createTestJwt(payload: object): string {
|
||||
}
|
||||
|
||||
describe("plugin.codex", () => {
|
||||
test("escapes provider errors in callback HTML", () => {
|
||||
const error = `</div><script>alert("xss" & 'more')</script>`
|
||||
const html = renderOAuthError(error)
|
||||
|
||||
expect(html).toContain("</div><script>alert("xss" & 'more')</script>")
|
||||
expect(html).not.toContain(error)
|
||||
})
|
||||
|
||||
describe("parseJwtClaims", () => {
|
||||
test("parses valid JWT with claims", () => {
|
||||
const payload = { email: "test@example.com", chatgpt_account_id: "acc-123" }
|
||||
|
||||
Reference in New Issue
Block a user