-
Notifications
You must be signed in to change notification settings - Fork 10
support extra headers #373
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| # DEBUG: Print headers (mask auth token) | ||
| debug_headers = {k: (v[:20] + "..." if k == "Authorization" else v) for k, v in headers.items()} | ||
| print(f"[DEBUG] Headers being sent: {debug_headers}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Debug print statements accidentally committed to production code
Debug print statements were left in the create_dataset_from_jsonl function. These lines print [DEBUG] prefixed messages to stdout, including the FIREWORKS_EXTRA_HEADERS environment variable value and partial authorization tokens (first 20 characters). This debugging code pollutes output for production users and potentially leaks sensitive information.
|
|
||
| # DEBUG: Print headers (mask auth token) | ||
| debug_headers = {k: (v[:20] + "..." if k == "Authorization" else v) for k, v in headers.items()} | ||
| print(f"[DEBUG] Headers being sent: {debug_headers}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Debug print statements accidentally committed to production code
Debug print statements were left in the create_dataset_from_jsonl function. These lines print [DEBUG] prefixed messages to stdout, including the FIREWORKS_EXTRA_HEADERS environment variable value and partial authorization tokens (first 20 characters). This debugging code pollutes output for production users and potentially leaks sensitive information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # DEBUG: Check environment variable | ||
| extra_headers_env = os.environ.get("FIREWORKS_EXTRA_HEADERS", "<NOT SET>") | ||
| print(f"[DEBUG] FIREWORKS_EXTRA_HEADERS env: {extra_headers_env}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stop printing extra header secrets during dataset creation
create_dataset_from_jsonl now unconditionally prints the value of FIREWORKS_EXTRA_HEADERS (and the constructed headers below) to stdout. If callers set that env var with API tokens or other sensitive headers, every dataset creation leaks those secrets into logs/terminals because there is no debug guard or masking.
Useful? React with 👍 / 👎.
Note
Introduce
FIREWORKS_EXTRA_HEADERSand newget_platform_headers, updating all API calls to use it; add OpenAI API key to.env.exampleand adjust multipart uploads to omit Content-Type.get_extra_headers()andget_platform_headers()to centralize request headers and supportFIREWORKS_EXTRA_HEADERS.get_platform_headers()acrossevaluation.py(preview/create),cli_commands/create_rft.py(polling/existence checks),fireworks_rft.py(dataset create/upload, RFT job),platform_api.py(secrets create/get/delete), andpytest/handle_persist_flow.py(dataset create/upload, job create).Content-Typeto allow multipart boundaries to be set byrequests.create_dataset_from_jsonlto show extra headers usage (masked auth).OPENAI_API_KEYto.env.example.Written by Cursor Bugbot for commit 9761e85. This will update automatically on new commits. Configure here.