Repository navigation
Redact API keys that wrap onto the next line - #2
Merged
Merged
Conversation
Detection ran per OCR line, so a key that wrapped left its tail visible on the next line, and a key split into two short halves was not found at all. Follow a key across the line break when the next line starts below and to the left with a random-looking piece, or when both halves together look like a key. Adds unit tests and a wrapped-key screenshot fixture that runs on the platform OCR engine.
The temp image was named after the process id only, so two OCR runs in the same process overwrote each other's image and one got the other's text. Two platform OCR tests running in parallel hit this on Linux.
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.
Detection ran per OCR line, so a key that wrapped to the next line left its tail visible, and a key split into two short halves across lines was not detected at all.
tests/fixtures/wrapped-key.pngchecked on the platform OCR engine (Windows.Media.Ocr / Vision / tesseract). With the fix disabled it fails on Windows:5vXz7aBcQ3 is activestayed uncovered.