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

Aberta
#5,092 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
github-actions, node.js, typescript

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
16.5k
Forks
1.5k
Merge médio
1d 15h
PRs com merge (30d)
17

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de triggerdotdev/trigger.dev

Todas as issues de triggerdotdev/trigger.dev

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.