chand1012 / openai-cf-workers-ai

Replacing OpenAI's API with Cloudflare AI.
MIT License
224 stars 45 forks source link

add: BearerAuthentication middleware #6

Closed devcxl closed 5 months ago

devcxl commented 5 months ago

Adding the BearerAuthentication middleware enhances the security of the interface.

devcxl commented 5 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 5 months ago

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

chand1012 commented 5 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 5 months ago

Okay, I'll update the README file later.

devcxl commented 5 months ago

Done

chand1012 commented 5 months ago

Thank you for your help!