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

Remove api key validation #3569

Merged
merged 2 commits into from
Sep 25, 2024
Merged

Conversation

jackgerrits
Copy link
Member

@jackgerrits jackgerrits commented Sep 25, 2024

Why are these changes needed?

It's not our business to check if keys are valid. If they are invalid, OpenAI or the given provider will provide the appropriate error message. The alternative of checking keys means we will exist in this permanent state of chasing key format changes which is not necessary or helpful and people are getting confusing warning messages due to false positives.

Related issue number

Closes #3345
Closes #3157
Closes #3544

Replaces #3330
Replaces #3494

Checks

Copy link

gitguardian bot commented Sep 25, 2024

⚠️ GitGuardian has uncovered 8 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.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
12853598 Triggered Generic High Entropy Secret ed2bec7 test/oai/test_utils.py View secret
10404693 Triggered Generic High Entropy Secret ed2bec7 test/oai/test_utils.py View secret
12853599 Triggered Generic High Entropy Secret ed2bec7 test/oai/test_utils.py View secret
10404694 Triggered Generic High Entropy Secret ed2bec7 test/oai/test_utils.py View secret
12853601 Triggered Generic High Entropy Secret ed2bec7 test/oai/test_utils.py View secret
10404696 Triggered Generic High Entropy Secret ed2bec7 test/oai/test_utils.py View secret
10422482 Triggered Generic High Entropy Secret ed2bec7 test/oai/test_utils.py View secret
12853602 Triggered Generic High Entropy Secret ed2bec7 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.

@jackgerrits jackgerrits added this pull request to the merge queue Sep 25, 2024
Merged via the queue into microsoft:main with commit 857830c Sep 25, 2024
141 of 154 checks passed
@jackgerrits jackgerrits deleted the api_validation branch September 25, 2024 16:54
@nstielau
Copy link

+1, thanks @jackgerrits

There is a case for autogen owning an improved developer UX here, but without a PR on the table and continued errors, I think this is the right move.

Also, since OpenAPI doesn't provide any validation function or API, autogen will be chasing any changes that it seems OpenAI can and does make.

@robraux
Copy link
Contributor

robraux commented Sep 30, 2024

@jackgerrits

Looks like this check is broken if not isinstance(client, openai.AzureOpenAI) and str(client.base_url).startswith(OPEN_API_BASE_URL_PREFIX):

Don't you want the warning to only display if the instance IS the AzureOpenAI? I'm using main branch now and getting the warning for all of my standard OpenAI clients. Was this intended functionality to introduce?

@jackgerrits
Copy link
Member Author

You're totally right, thanks for catching that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants