Skip to content

Conversation

@lsanarchist
Copy link
Contributor

@google-cla
Copy link

google-cla bot commented Jan 21, 2026

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.
Copy link
Collaborator

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.

Copy link
Collaborator

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.

lsanarchist and others added 6 commits January 24, 2026 10:08
- 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
@lsanarchist
Copy link
Contributor Author

#1480

@copybara-service copybara-service bot merged commit 110859b into google:main Feb 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants