[PR #682] [MERGED] Simplify endpoint role checking #75289

Closed
opened 2026-05-13 08:16:19 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/682
Author: @explorigin
Created: 2/9/2024
Status: Merged
Merged: 2/9/2024
Merged by: @tjbck

Base: mainHead: simplify-endpoint-code


📝 Commits (1)

  • 08e8e92 Endpoint role-checking was redundantly applied but FastAPI provides a nice abstraction mechanic...so I applied it. There should be no logical changes in this code; only simpler, cleaner ways for doing the same thing.

📊 Changes

11 files changed (+128 additions, -252 deletions)

View changed files

📝 backend/apps/ollama/main.py (+9 -15)
📝 backend/apps/openai/main.py (+14 -29)
📝 backend/apps/rag/main.py (+18 -30)
📝 backend/apps/web/routers/auths.py (+9 -21)
📝 backend/apps/web/routers/chats.py (+6 -12)
📝 backend/apps/web/routers/configs.py (+9 -20)
📝 backend/apps/web/routers/documents.py (+4 -22)
📝 backend/apps/web/routers/modelfiles.py (+4 -21)
📝 backend/apps/web/routers/prompts.py (+9 -29)
📝 backend/apps/web/routers/users.py (+30 -53)
📝 backend/utils/utils.py (+16 -0)

📄 Description

Endpoint role-checking was redundantly applied but FastAPI provides a nice abstraction mechanic...so I applied it.

There should be no logical changes in this code. I did swap some of the HTTP 40X codes to be more appropriate to the situation.

This is mostly an incremental PR that moves things forward while I'm working on the larger authentication rewrite.

image

😁


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/682 **Author:** [@explorigin](https://github.com/explorigin) **Created:** 2/9/2024 **Status:** ✅ Merged **Merged:** 2/9/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `simplify-endpoint-code` --- ### 📝 Commits (1) - [`08e8e92`](https://github.com/open-webui/open-webui/commit/08e8e922fd71a0650dfd2c05d1dcf883f1be0357) Endpoint role-checking was redundantly applied but FastAPI provides a nice abstraction mechanic...so I applied it. There should be no logical changes in this code; only simpler, cleaner ways for doing the same thing. ### 📊 Changes **11 files changed** (+128 additions, -252 deletions) <details> <summary>View changed files</summary> 📝 `backend/apps/ollama/main.py` (+9 -15) 📝 `backend/apps/openai/main.py` (+14 -29) 📝 `backend/apps/rag/main.py` (+18 -30) 📝 `backend/apps/web/routers/auths.py` (+9 -21) 📝 `backend/apps/web/routers/chats.py` (+6 -12) 📝 `backend/apps/web/routers/configs.py` (+9 -20) 📝 `backend/apps/web/routers/documents.py` (+4 -22) 📝 `backend/apps/web/routers/modelfiles.py` (+4 -21) 📝 `backend/apps/web/routers/prompts.py` (+9 -29) 📝 `backend/apps/web/routers/users.py` (+30 -53) 📝 `backend/utils/utils.py` (+16 -0) </details> ### 📄 Description Endpoint role-checking was redundantly applied but FastAPI provides a nice abstraction mechanic...so I applied it. There should be no logical changes in this code. I did swap some of the HTTP 40X codes to be more appropriate to the situation. This is mostly an incremental PR that moves things forward while I'm working on the larger authentication rewrite. <img width="134" alt="image" src="https://github.com/ollama-webui/ollama-webui/assets/697818/bf6e6f4a-4038-4626-88d4-9c3d72b9d70a"> 😁 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-13 08:16:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#75289