CI: e2e auth full failing: jose generateJWT 'payload must be an instance of Uint8Array' (jwt.ts:66)

未關閉
#5,092 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
github-actions, node.js, typescript

研究方向

Start with the failing tests in test/emailChangeConfirmation.e2e.full.test.ts and test/auth-api.e2e.full.test.ts, and with the JWT signing code at jwt.ts:66, which calls jose's SignJWT. Check how the secret reaches that call in the e2e environment, and run the workflow .github/workflows/e2e-webapp-auth-full.yml locally or in CI. Done means both failing tests pass and the workflow is green on main; the fix may be encoding the secret in the same realm or upgrading jose.

由索引模型根據 Issue 內容生成。

描述

What fails

Workflow .github/workflows/e2e-webapp-auth-full.yml fails on main in job 🛡️ E2E Auth Tests (full).

Error

FAIL test/emailChangeConfirmation.e2e.full.test.ts > redirects off the token URL and confirms only when the rendered form is submitted
TypeError: payload must be an instance of Uint8Array
 ❯ new FlattenedSign node_modules/.pnpm/[email protected]/node_modules/jose/dist/node/esm/jws/flattened/sign.js:14:19
 ❯ new CompactSign node_modules/.pnpm/[email protected]/node_modules/jose/dist/node/esm/jws/compact/sign.js:5:27
 ❯ SignJWT.sign node_modules/.pnpm/[email protected]/node_modules/jose/dist/node/esm/jwt/sign.js:12:21
FAIL test/auth-api.e2e.full.test.ts > API > Query dashboards — GET /api/v1/query/dashboards (sanity) > JWT read:query: auth passes
AssertionError: expected 403 not to be 403
 Test Files  2 failed | 7 passed (9)
      Tests  4 failed | 254 passed (258)

When it started

Likely cause

[email protected] receives a non-Uint8Array (cross-realm/TextEncoder) secret in the test env.

Suggested fix

Pass the secret via new TextEncoder().encode in the same realm, or bump jose.

主要語言
TypeScript
星號
16.5k
分支
1.5k
平均合併
1 天 15 小時
30 天內合併 PR
17

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

triggerdotdev/trigger.dev 的其他 Issue

查看 triggerdotdev/trigger.dev 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。