-
-
Notifications
You must be signed in to change notification settings - Fork 646
Add basic authentication for HTTP #217
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: master
Are you sure you want to change the base?
Conversation
…PASSWORD in environment variables
|
WHY??? This app is all local activity! Please do NOT do this! This app is becoming far too complex as it is. |
|
@wangjia184 why not use the api_key param so it is compatible with openai specs and API design in general |
|
@fireblade2534 how to enable api_key for this API? I am not familar with OpenAI's procotol. is it done by Bearer Authentication? How is it enabled in the docker image? some other environment variables? Thanks |
|
@RBEmerson970 local activity also needs authentication. The reason is from compliance requirements (e.g., PCI DSS, NIST 800-53, CIS Controls) which explicitly require authentication for all system interfaces, regardless of network locality. In short, it is not allowed to deploy un-authenticated API in our network even it is only accessed locally because non-compliant endpoints may fail audits or violate contractual obligations. So, it is really needed. Basic Auth is better than Bearer Authentication and other approaches like OAuth because it is friendly to web browser. You have the choice not enabling it by default. |
|
I'd call that in-house, not local. Authentication, etc. becomes a job for your IT staff. |
|
DevOps/IT staff certainly can setup firewall to isolate. but... according to the compliance requirement, any API can be accessed from another machine must be authenticated. Unless the API is bound to localhost, otherwise it is not allowed. Even it is in K8S group. I know it is way too strict, but financial institutions always go in this way. it is about obligations instead of technology |
|
@wangjia184 https://platform.openai.com/docs/api-reference/authentication @RBEmerson970 I think that having the option for authentication is a good idea as long as it can be disabled. Also the implementation in this pr is not that complex. |
|
Option, yes, requirement, no. IMNSHO the issue heads into commercial vs. private use. |
|
Agreed authentication should be optional |
I see, it is Bearer Authentication, that can be implemented |
|
+1 for this, if I'm allowed to vote. It only enforces basic auth if username and password are set, so 100% backward-compatible. But also would love to see (optional) Bearer Auth as well. |
To enable it, just specify the HTTP_USERNAME and HTTP_PASSWORD in environment variables
E.g.