-
Notifications
You must be signed in to change notification settings - Fork 108
PRP: Secret extractor for Mistral API Key #1702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PRP: Secret extractor for Mistral API Key #1702
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
| return keyLength | ||
| } | ||
|
|
||
| // Detect finds potential Mistral API keys that have contextual indicators nearby. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is already implemented in the veles/secrets/common/pair library so you can reuse that - just make sure only the real secret is used in the FromPair function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you set FindA to look for contextRe since then we won't needlessly look for 32-length blobs in a file if the context isn't present.
- Use veles/secrets/common/pair library instead of custom detection logic - Improve contextRe to match camelCase (MistralApiKey) and dash separators (mistral-api-key) - Make 'api' optional in context to match MistralKey, mistral_key, etc. - Set FindA to contextRe for efficient scanning (only search for keys if context present) - MaxSecretLen now auto-calculated by pair.Detector - Add acceptance test with velestest.AcceptDetector - Update test case for multiple keys scenario
#1480 #1480