You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing an issue with API key authentication (G4F_API_KEY) in g4f. I've set the environment variable, but I can still access the API and UI without providing the key. Authentication doesn't seem to be enforced.
Steps to Reproduce:
I set the G4F_API_KEY environment variable in my docker-compose.yml file. Here’s an excerpt from my file (with the API key masked):
Description:
Hello,
I'm experiencing an issue with API key authentication (
G4F_API_KEY
) in g4f. I've set the environment variable, but I can still access the API and UI without providing the key. Authentication doesn't seem to be enforced.Steps to Reproduce:
I set the
G4F_API_KEY
environment variable in mydocker-compose.yml
file. Here’s an excerpt from my file (with the API key masked):I started the container using
docker-compose up -d
.I verified that the environment variable is correctly set inside the container:
The
echo
command correctly displays the API key I set.I tried accessing the API with
curl
without providing the API key:Expected Result: A 401 Unauthorized or 403 Forbidden error.
Actual Result: The API successfully responds (HTTP 200) and returns a response, as if authentication is not enabled.
I also tried accessing the UI (
http://localhost:8080/chat/
) without providing an API key, and I could access it without any issues.Expected Behavior:
The API and UI should deny access without the correct API key (401 or 403 error).
Observed Behavior:
The API and UI are accessible without an API key.
Any help in resolving this issue would be greatly appreciated. Thank you!
This version is clear, follows GitHub's issue formatting, and maintains the original intent. 🚀
The text was updated successfully, but these errors were encountered: