Skip to content
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

support openai 'sk-proj-' apikey format #2426

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

saberuster
Copy link
Contributor

Why are these changes needed?

I recently created a new oai api key and found that it has 'sk-proj-' as the prefix, and the current code base can only match the 'sk-' prefix.

api_key_re = re.compile(r"^sk-[A-Za-z0-9]{32,}$")

Related issue number

Checks

Copy link

gitguardian bot commented Apr 18, 2024

⚠️ GitGuardian has uncovered 4 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
- Generic High Entropy Secret ef77502 test/oai/test_utils.py View secret
- Generic High Entropy Secret ef77502 test/oai/test_utils.py View secret
- Generic High Entropy Secret ef77502 test/oai/test_utils.py View secret
- Generic High Entropy Secret ef77502 test/oai/test_utils.py View secret
🛠 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 the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. 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


🦉 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.

Our GitHub checks need improvements? Share your feedbacks!

@saberuster
Copy link
Contributor Author

@microsoft-github-policy-service agree

@sonichi sonichi linked an issue Apr 18, 2024 that may be closed by this pull request
@sonichi
Copy link
Contributor

sonichi commented Apr 18, 2024

@nerfZael could you take a look at this PR?

@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.60%. Comparing base (4a44093) to head (68a514a).
Report is 39 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2426      +/-   ##
==========================================
+ Coverage   38.14%   39.60%   +1.46%     
==========================================
  Files          78       82       +4     
  Lines        7865     8355     +490     
  Branches     1683     1922     +239     
==========================================
+ Hits         3000     3309     +309     
- Misses       4615     4762     +147     
- Partials      250      284      +34     
Flag Coverage Δ
unittests 39.54% <100.00%> (+1.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonichi sonichi requested a review from nerfZael April 18, 2024 12:27
Copy link
Collaborator

@AaronWard AaronWard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

jayralencar pushed a commit to jayralencar/autogen that referenced this pull request May 28, 2024
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
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.

[Bug]: Using OpenAI project API key gives warnings
5 participants