open-webui/backend/open_webui/utils
Your Full Name 89eb880b88 feat: granular webhook events + chat bubble CSS fix
Webhook: Granular event support (closes #1240)

Problem: WEBHOOK_URL accepted only one endpoint that fired for all
events (signup only). No way to route events to different endpoints.

Solution:
- Added WEBHOOK_EVENTS constant (signup, oauth_signup, signin, signout,
  user_deleted, user_role_changed)
- Added _parse_webhook_config() in webhook.py supporting three formats:
  1. Legacy single URL (no admin change needed, backwards-compatible)
  2. Newline/comma-separated JSON objects with optional events filter
  3. Full JSON array format
- Added post_webhook_event() dispatcher with event-scope filtering;
  URLs with events=null act as catch-all (preserves legacy behaviour)
- Updated auths.py: both signup paths now call post_webhook_event
  with event='signup'
- Updated oauth.py: OAuth signup uses post_webhook_event with
  event='oauth_signup' and includes provider name in payload

Example extended config:
  [{"url": "https://slack.com/...", "events": ["signup"]},
   {"url": "https://discord.com/..."}]

Chat Bubbles: Fix widescreen layout overflow (closes #5975)

Problem: In bubble mode, messages with YAML/JSON code blocks stretched
the bubble to full viewport width. The inner wrapper had min-w-full
applied unconditionally, forcing the flex container to full width.

Fix: Changed min-w-full to conditional in UserMessage.svelte:
  - Bubble mode: min-w-0 (lets flex child shrink, bubble hugs content)
  - Classic mode: min-w-full (unchanged, full-width layout preserved)

Tests: Added 15 unit tests in test/util/test_webhook.py covering
_parse_webhook_config (formats, edge cases) and post_webhook_event
(event filtering, catch-all, payload injection, backwards compat).
2026-05-24 18:13:09 +05:30
..
access_control fix: respect access_type in shared-chat file authorization branch (#24755) 2026-05-19 22:09:56 +04:00
images refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
mcp refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
telemetry refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
actions.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
anthropic.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
asgi_middleware.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
audit.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
auth.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
automations.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
calendar.py feat: calendar 2026-04-19 19:15:05 +09:00
channels.py refac 2026-03-17 17:58:01 -05:00
chat.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
code_interpreter.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
embeddings.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
files.py fix: get_image_base64_from_file_id 2026-05-19 20:33:46 +04:00
filter.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
groups.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
headers.py refac 2026-05-19 21:35:04 +04:00
logger.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
middleware.py refac 2026-05-20 00:22:27 +04:00
misc.py refac 2026-05-19 22:25:39 +04:00
models.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
oauth.py feat: granular webhook events + chat bubble CSS fix 2026-05-24 18:13:09 +05:30
payload.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
pdf_generator.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
plugin.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
rate_limit.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
redis.py refac: clean up Redis sentinel utilities and import grouping 2026-05-21 11:47:25 +04:00
response.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
sanitize.py refac 2026-03-17 17:58:01 -05:00
security_headers.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
session_pool.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
task.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
tools.py fix: log expected fetch/transcript/tool-server failures as warnings (#24903) 2026-05-19 21:55:40 +04:00
validate.py refac 2026-05-11 02:25:11 +09:00
webhook.py feat: granular webhook events + chat bubble CSS fix 2026-05-24 18:13:09 +05:30