Skip to content

Chat API, waiting room middleware (FastAPI/Flask) and Live Chat user_hash - #3

Merged
deflinhec merged 2 commits into
mainfrom
claude/project-thread-y7499h
Nov 25, 2026
Merged

deflinhec merged 2 commits into
mainfrom
claude/project-thread-y7499h

Conversation

@deflinhec

Copy link
Copy Markdown
Member

Requested by Danny · project thread

Fills the Python gaps for three products.

  • Chat API on Client / AsyncClient: put_conversation, get_conversation, delete_conversation, add_members, remove_member, send_message, list_messages, mark_read, system_message, user_conversations, plus chat_request(method, path, params, body) for the rest (typing, reactions, edits, search, moderation). Signed under /apps/APP_ID/chat like the other HTTP calls.
  • Waiting room (hibira.waiting_room, no new deps): verify_pass, sign_user, waiting_room_url, WaitingRoom.decide, ASGIMiddleware (FastAPI, Starlette, Litestar, Quart) and WSGIMiddleware (Flask, Bottle, Pyramid, Falcon). Same behaviour as @hibira-io/waiting-room/server and the framework packages; tested against the shared server-signed pass from waiting-room/test/server.test.mjs.
  • Live Chat (hibira.livechat.user_hash): the verified-visitor hash for the widget's data-user-hash.
  • README sections + 中文摘要, CHANGELOG under Unreleased.

Testing

  • pytest: 65 passed (21 new), ruff check . and mypy (strict) clean.
  • Waiting room also checked with a real Flask app and FastAPI TestClient: no pass → 302 to the queue, ?hibira_pass → 302 + cookie, cookie → 200, POST without pass → 403.

中文摘要

Python 套件補上 Chat API、等候室 middleware(FastAPI/Starlette 與 Flask)和 Live Chat 已驗證訪客的 user_hash()。發佈時版本升到 0.2.0。


Generated by Claude Code

Python apps can now run the Chat API, put a waiting room in front of
FastAPI/Starlette or Flask pages, and sign Live Chat verified visitors.
The waiting room check uses the shared server-signed test vector.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SHtsCCKScUUX9khSrU2wij
@deflinhec deflinhec self-assigned this Nov 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SHtsCCKScUUX9khSrU2wij
Comment thread src/hibira/_signing.py Dismissed
@deflinhec
deflinhec marked this pull request as ready for review November 25, 2026 21:53

deflinhec commented Nov 25, 2026 •

Copy link
Copy Markdown
Member Author

CodeQL is failing on one alert: MD5 in src/hibira/_signing.py (body_md5). This is not a security issue. The Channels HTTP API signature (Pusher auth_version 1.0) requires body_md5 as a body checksum. The signature itself is HMAC-SHA256 with the app secret, and the server rejects requests without body_md5, so the hash can't be changed or dropped. The alert needs to be dismissed as a false positive in Security > Code scanning. This session's token can't reach the code-scanning API to do that.


Generated by Claude Code

@deflinhec
deflinhec merged commit adcb0df into main Nov 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants