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

When debug logging is enabled, api-key header is also printed #1082

Open
1 task done
danigian opened this issue Jan 17, 2024 · 1 comment
Open
1 task done

When debug logging is enabled, api-key header is also printed #1082

danigian opened this issue Jan 17, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@danigian
Copy link

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

When debug logging is enabled, FinalRequestOptions is entirely dumped because of the following code:

if log.isEnabledFor(logging.DEBUG):
log.debug("Request options: %s", model_dump(options, exclude_unset=True))

This includes the api-key header that would be great to avoid logging

To Reproduce

  1. Enable debug logging
  2. Get a AsyncAzureOpenAI client and execute any kind of request against the service
  3. See the api-key getting logged as part of the headers

Code snippets

No response

OS

WSL

Python version

Python v3.9.18

Library version

openai v1.7.2

@danigian danigian added the bug Something isn't working label Jan 17, 2024
@rattrayalex
Copy link
Collaborator

Thanks for raising, we'll look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants