Skip to content

AIS-87 add ALTCHA browser gate Event Function - #57

Open
churnikov wants to merge 2 commits into
mainfrom
feat/altcha-signup-gate
Open

churnikov wants to merge 2 commits into
mainfrom
feat/altcha-signup-gate

Conversation

@churnikov

Copy link
Copy Markdown
Contributor

Summary

Adds altcha_browser_gate, an Open WebUI Event Function that runs an ALTCHA proof-of-work check in front of the web UI, signup, signin and login. It works with the altchaGate NGINX sidecar in openllm-charts: the sidecar blocks requests, and the Function serves the check page and records which browsers have passed. whale-auth-tools creates and verifies challenges, so no HMAC secrets enter Open WebUI.

Behaviour

  • Unverified page visits: the visitor sees a "Checking your browser" page that solves the challenge automatically and reloads the same URL.
  • Unverified signup, signin or LDAP: the request gets a 403.
  • One-time challenges: each challenge is stored in Redis and deleted the first time anyone tries to verify it.
  • Clearance cookie: SameSite=Lax, so links from other sites keep it. Pending challenges use a separate cookie, so several tabs can verify at the same time.
  • Failure mode: if the Function is disabled, or Redis or whale-auth-tools is down, the gated pages are blocked. To turn the gate off, set altchaGate.enabled=false in the chart.

Rollout

  1. Install and enable the Function while altchaGate.enabled=false.
  2. Enable altchaGate in the chart and restart all replicas.

🤖 Generated with Claude Code

churnikov and others added 2 commits November 13, 2026 12:32
Add the ALTCHA browser interstitial Event Function with Redis-backed clearance and upstream verification.

Document browser gate setup and behavior, add pinned httpx and redis dependencies, and cover verification flows with tests.
- Use SameSite=Lax for the clearance cookie so navigations from email,
  Slack, other sites and OAuth returns keep it.
- Store pending challenges in a separate cookie with one Redis key per
  challenge, so parallel tabs verify independently and a new challenge
  never replaces existing clearance.
- Short-circuit /challenge for already-cleared browsers.
- Show a specific message when the proxy rate-limits a request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@churnikov churnikov self-assigned this Nov 13, 2026
@churnikov
churnikov requested a review from a team as a code owner November 13, 2026 12:01
@churnikov
churnikov added this pull request to stack #59 November 13, 2026 14:46
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.

1 participant