mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #8252] bug: ENABLE_API_KEY_ENDPOINT_RESTRICTIONS feature does not work #30580
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ndrsfel on GitHub (Jan 1, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8252
Bug Report
Installation Method
Docker
Environment
Open WebUI Version: v0.5.3
Operating System: macOS
Confirmation:
Expected Behavior:
One can restrict API key access using
ENABLE_API_KEY_ENDPOINT_RESTRICTIONS&API_KEY_ALLOWED_ENDPOINTSenvironment variables.Actual Behavior:
One get's the following exception/error
Description
Bug Summary: To fix, please refac this section of the code to use
API_KEY_ALLOWED_ENDPOINTSinstead ofAPI_KEY_ALLOWED_PATHSas the error states above.Thank you for this awesome tool, Tim!
@tjbck commented on GitHub (Jan 1, 2025):
Its's a persistent config, and must be configured from the ui.
@ndrsfel commented on GitHub (Jan 3, 2025):
@tjbck Sorry for not being clear here, a quick search in the codebase shows, that there is no
request.app.state.config.API_KEY_ALLOWED_PATHSorAPI_KEY_ALLOWED_PATHSconfigurable via Admin UI.Rather, this is a typo and should be re-named to
request.app.state.config.API_KEY_ALLOWED_ENDPOINTS. Then, this is actually the correct value the Admin UI AND the environment variables point to.@ndrsfel commented on GitHub (Jan 5, 2025):
fixed with
99c3194. Thank you!@tjbck commented on GitHub (Jan 5, 2025):
@ndrsfel I must've been half awake half asleep reading your post, apologies for the confusion and thanks for the report! 😅