[PR #9620] [MERGED] feat: Adding debug logs for oauth role & group management #22396

Closed
opened 2026-04-20 04:07:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/9620
Author: @tarmst
Created: 2/7/2025
Status: Merged
Merged: 2/7/2025
Merged by: @tjbck

Base: devHead: add-oauth-debug-logs


📝 Commits (1)

  • 85912d7 Adding debug logs for oauth role & group management

📊 Changes

2 files changed (+24 additions, -0 deletions)

View changed files

📝 backend/open_webui/env.py (+1 -0)
📝 backend/open_webui/utils/oauth.py (+23 -0)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for validating the changes?
    • Tested both with & without the new environment variable enabled for expected behavior.
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To cleary categorize this pull request, prefix the pull request title, using one of the following:
    • feat: Introduces a new feature or enhancement to the codebase

Changelog Entry

Description

Added logging to oauth role & group management so that users may swap logging levels to debug to see if groups/roles are available and if they are added to users.

Added

  • Added logging to oauth role & group management using variable OAUTH_LOG_LEVEL

Security

  • User groups, oauth groups, & OWUI groups printed to debug logs.

Testing logs

DEBUG [open_webui.utils.oauth] Running OAUTH Role management
DEBUG [open_webui.utils.oauth] Oauth Roles claim: roles
DEBUG [open_webui.utils.oauth] User roles from oauth: None
DEBUG [open_webui.utils.oauth] Accepted user roles: ['user']
DEBUG [open_webui.utils.oauth] Accepted admin roles: ['admin']
DEBUG [open_webui.utils.oauth] Running OAUTH Group management
DEBUG [open_webui.utils.oauth] Oauth Groups claim: groups
DEBUG [open_webui.utils.oauth] User oauth groups: ['group1', 'group2', 'group3']
DEBUG [open_webui.utils.oauth] User's current groups: ['group1', 'group2']
DEBUG [open_webui.utils.oauth] All groups available in OpenWebUI: ['group1', 'group2', 'group3']
DEBUG [open_webui.utils.oauth] Adding user to group group3 as it was found in their oauth groups


🔄 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/9620 **Author:** [@tarmst](https://github.com/tarmst) **Created:** 2/7/2025 **Status:** ✅ Merged **Merged:** 2/7/2025 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `add-oauth-debug-logs` --- ### 📝 Commits (1) - [`85912d7`](https://github.com/open-webui/open-webui/commit/85912d726e759e83a42f03497175b08a2a421a1a) Adding debug logs for oauth role & group management ### 📊 Changes **2 files changed** (+24 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/env.py` (+1 -0) 📝 `backend/open_webui/utils/oauth.py` (+23 -0) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Please verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Have you written and run sufficient tests for validating the changes? - Tested both with & without the new environment variable enabled for expected behavior. - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Prefix:** To cleary categorize this pull request, prefix the pull request title, using one of the following: - **feat**: Introduces a new feature or enhancement to the codebase # Changelog Entry ### Description Added logging to oauth role & group management so that users may swap logging levels to debug to see if groups/roles are available and if they are added to users. ### Added - Added logging to oauth role & group management using variable `OAUTH_LOG_LEVEL` ### Security - User groups, oauth groups, & OWUI groups printed to debug logs. --- ### Testing logs ``` DEBUG [open_webui.utils.oauth] Running OAUTH Role management DEBUG [open_webui.utils.oauth] Oauth Roles claim: roles DEBUG [open_webui.utils.oauth] User roles from oauth: None DEBUG [open_webui.utils.oauth] Accepted user roles: ['user'] DEBUG [open_webui.utils.oauth] Accepted admin roles: ['admin'] DEBUG [open_webui.utils.oauth] Running OAUTH Group management DEBUG [open_webui.utils.oauth] Oauth Groups claim: groups DEBUG [open_webui.utils.oauth] User oauth groups: ['group1', 'group2', 'group3'] DEBUG [open_webui.utils.oauth] User's current groups: ['group1', 'group2'] DEBUG [open_webui.utils.oauth] All groups available in OpenWebUI: ['group1', 'group2', 'group3'] DEBUG [open_webui.utils.oauth] Adding user to group group3 as it was found in their oauth groups ``` --- <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-04-20 04:07:13 -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#22396