chand1012 / openai-cf-workers-ai

Replacing OpenAI's API with Cloudflare AI.
MIT License
235 stars 49 forks source link

add: BearerAuthentication middleware #6

Closed devcxl closed 7 months ago

devcxl commented 7 months ago

Adding the BearerAuthentication middleware enhances the security of the interface.

devcxl commented 7 months ago

I think it's necessary to enforce the addition of ACCESS_TOKEN to ensure the security of the interface. As for the suggestion to control the setting of the base using environment variables, it's indeed a good idea.

devcxl commented 7 months ago

However, how to pass the environment variables to the base is a problem.

chand1012 commented 7 months ago

That's fine then, could you modify the README to add instructions about changing the ACCESS_TOKEN so that people don't get confused when they get rejected by their instance? Thanks.

devcxl commented 7 months ago

Okay, I'll update the README file later.

devcxl commented 7 months ago

Done

chand1012 commented 7 months ago

Thank you for your help!