Repository navigation
🐛 fix: deny instead of reporting an outage when wave-auth-api answers 403 to validate - #71
Merged
Merged
Conversation
… 403 to validate Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Contexto
Encontrado em teste da unidade
nakeddo tim-network-adapter. Uma API key válida que não temauth.api_key.validaterecebe 403 do wave-auth-api noPOST /auth/permissions/validate(Insufficient permissions.). OWaveAuthPermissionValidatortratava esse 403 como "sem veredito" e lançavaPermissionValidatorUnavailableError. Com isso, o serviço que usa a framework respondia 503 ("Unable to validate the API key at this time.") para um problema que está na credencial, não numa indisponibilidade:O que muda
WaveAuthPermissionValidator: um 403 do/validateagora lançaPermissionDeniedError("The API key is not allowed to validate the<permission>permission"). Os handlers já mapeiam esse erro para 403.authorized: true.PermissionDeniedErrorjá é tratado como rejeição da key.PermissionValidatorUnauthorizedError.PermissionValidatorUnavailableError.PermissionValidator.validatepassa a descrever o caso do 403.AGENTS.md).Como testar
pnpm lint,pnpm test(260 testes) epnpm buildpassam. A spec do validator cobre:PermissionDeniedError, com a mensagem;authorized: trueno corpo continua negando;auth.api_key.validate→ 403, antes 503.readno confirm → 403.Depois do merge
Publicar a 0.17.1 e fazer o bump nos consumidores. No tim-network-adapter,
ocsenakedjá estão na 0.17.x;bscsix,hperm,carrier-serviceelibsainda estão na 0.16.🤖 Generated with Claude Code