Repository navigation
Conversation
the api answers a wrong key with 401 "Invalid api key: <key>" and every command prints error bodies to stderr (batch writes them to .err files), so the full key ended up in terminals, logs and agent transcripts the client now replaces the key with [redacted] in any 4xx/5xx body, in both _get and _request, so every command gets it for free
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.
a wrong or revoked key gets printed in full by most commands
same for
scrapeand the other commands (stderr),auth, and batch.errfiles. the api echoes the key in its 401 body and the cli passes the body through. a typo'd key is usually one char off the real one, and this ends up in terminals, ci logs and agent transcripts (the skill itself says never print the key)fix:
Client._getandClient._requestreplace the key with[redacted]in any 4xx/5xx body, so every command that goes throughClientgets it without touching each error path. success bodies are left alone. the key is stripped first since the api drops trailing whitespace when it echoes it.crawlgoes through scrapy (key in the url) and isn't touched herepytest -m "not integration"and ruff passusageandscrapeboth printInvalid api key: [redacted]probably worth dropping the key from the 401 message on the api side too, this just covers the cli