feat(client-core): enviar x-client-id no lugar de x-api-key - #277
Merged
Merged
Conversation
O valor identifica a aplicacao (client id publico no bundle), nao um segredo. O firebolt-api ja aceita os dois headers, entao a troca e compativel. Cobre os 5 metodos do APIService (start/next/previous/debug/upload). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Ela deve ser MAIOR que a versão atual da main (0.11.2). Por favor, atualize sua branch com a main e rode o seguinte script para corrigir: version:patch |
Contributor
Coverage Report for client-core
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Bump exigido pelo check de versao do monorepo (lerna fixed mode) para o PR do header x-client-id. Atualiza os 11 packages, o lerna.json e as cross-deps.
Contributor
Coverage Report for client
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Contributor
Coverage Report for validators
File CoverageNo changed files found. |
Contributor
|
Canary publicado: v0.11.3-next.2df9c02 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Por quê
O valor passado em
formAccess.apiKeyidentifica a aplicação (um client id público, embarcado no bundle do browser), não um segredo nem um usuário. O nomex-api-keysugere uma credencial secreta e gera report de segurança falso-positivo (HackerOne no consumidor do SDK). Este PR renomeia o header parax-client-id.Compatibilidade
O back (
firebolt-api) já aceitax-client-idex-api-key(fase de transição, em produção), então a troca não quebra os fluxos atuais. O SDK é usado só internamente pelos fronts da CP.O que muda
packages/client-core/lib/services/API.ts: constantex-api-key→x-client-id, aplicada nos 5 métodos que enviam a chave (getStartForm,getNextStep,getPreviousStep,getDebugStep,upload).API.test.tscobrindo o header enviado (antes não havia cobertura de header).Depois deste PR
@iq-firebolt/client-core(e doclient, que depende dele).credit-partner-forms-ui0.11.1,mono-marketplace-hub-ui0.8.3-next.129).npfemastercard) e ox-api-keypode ser removido do back.Verificação
vitest run lib/services/API.test.ts: 4 passed. Rodei o arquivo isolado (Node 25); o CI valida na matriz oficial.🤖 Generated with Claude Code