pinecone-io / pinecone-python-client

The Pinecone Python client
https://www.pinecone.io/docs
Apache License 2.0
284 stars 78 forks source link

Make GRPC a drop in replacement #349

Closed mcpaddy closed 2 months ago

mcpaddy commented 3 months ago

Problem

To make the GRPC version a drop-in for the normal client. For example LangChain.

Solution

Alias the function get to result.

Type of Change

Test Plan

Test using LangChain and my own code. There should be no need for this with the change.

    if mode  == 'GRPC':
      [async_result.result() for async_result in async_results]
    else:
      [async_result.get() for async_result in async_results]
gitguardian[bot] commented 3 months ago

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | | | -------------- | ------------------ | ------------------------------ | ---------------- | --------------- | -------------------- | | [10042887](https://dashboard.gitguardian.com/workspace/465975/incidents/10042887) | Triggered | RSA Private Key | 96d6994e50d82c6bfc6248e50b410b40b7913b38 | tests/integration/proxy_config/.mitm/proxy1/mitmproxy-ca.pem | [View secret](https://github.com/pinecone-io/pinecone-python-client/commit/96d6994e50d82c6bfc6248e50b410b40b7913b38#diff-24d23c709aac8c15bd797b60ad620b8b0a76485671652b7721d8624b82a47a5cL1) | | [10042888](https://dashboard.gitguardian.com/workspace/465975/incidents/10042888) | Triggered | RSA Private Key | 96d6994e50d82c6bfc6248e50b410b40b7913b38 | tests/integration/proxy_config/.mitm/proxy2/mitmproxy-ca.pem | [View secret](https://github.com/pinecone-io/pinecone-python-client/commit/96d6994e50d82c6bfc6248e50b410b40b7913b38#diff-97bf7390f207d598cc2181fd9d054c66f54b9b9a5982697bcc644d802373cc80L1) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secrets safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate these secrets](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

jhamon commented 2 months ago

I'm addressing this in another PR in a way that will include tests, etc.