stack/apps/e2e/tests/backend/endpoints/api/v1
Konsti Wohlwend 7a35751f8e
Sign up rules (#1138)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> **High Risk**
> Touches core sign-up/auth flows and user restriction semantics
(including new DB constraints) and introduces dynamic rule
evaluation/logging; misconfiguration or CEL/parser bugs could block
sign-ups or incorrectly restrict users.
> 
> **Overview**
> Introduces **CEL-based sign-up rules** (config-driven) that are
evaluated during password/OTP/OAuth sign-ups and anonymous upgrades;
matching rules can reject sign-ups or mark users as admin-restricted,
and triggers are logged for analytics.
> 
> Extends `ProjectUser` with `restrictedByAdmin` plus public/private
restriction details, updates restriction computation/filtering, and
exposes these fields via user CRUD (including validation + DB constraint
enforcing consistency when unrestricted).
> 
> Adds a new dashboard **Sign-up Rules** page with a visual condition
builder (CEL <-> visual tree), drag-reorder by priority, per-rule 48h
sparkline analytics via a new hidden internal endpoint, and adds
user-page UI to view/edit manual restrictions. Also refactors ClickHouse
client initialization to require env vars (removing
`isClickhouseConfigured` checks) and adjusts CI container startup wait
time.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2141e689e8c1b72303b805e9234f996010d0880. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Sign-up Rules: visual rule builder, in-project CRUD with drag-reorder,
per-rule analytics, backend evaluation, and admin UI.
* Admin user restrictions: dashboard controls, banners/status,
public/private admin details surfaced in user views.

* **APIs & Schema**
* Config and user schemas extended; new SignUpRejected error and sign-up
rule types added.

* **Tests**
* Extensive unit and E2E coverage for rules, parser, evaluator,
analytics, and restricted-user flows.

* **Docs**
  * Editorial guidance added to AGENTS.md.

* **Chores**
* DB statement timeout, updated clean script, minor dependency
additions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-03 11:08:24 -08:00
..
__snapshots__ Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
auth Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
contact-channels Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
emails [Refactor] [Fix] Email Rendering Pipeline Refactor, Error Handling, and Bug Fixes (#1140) 2026-02-02 17:35:51 -08:00
integrations [Refactor] [Fix] Email Rendering Pipeline Refactor, Error Handling, and Bug Fixes (#1140) 2026-02-02 17:35:51 -08:00
internal Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
payments fix product route access (#1134) 2026-01-27 18:30:14 +00:00
analytics-events.test.ts query timing route (#1146) 2026-02-02 16:07:59 -08:00
analytics-query.test.ts query timing route (#1146) 2026-02-02 16:07:59 -08:00
api-keys.test.ts Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
auth-flows.test.ts Fix tests 2025-07-16 11:42:25 -07:00
check-feature-support.test.ts More backend endpoint implementations (#126) 2024-07-13 22:04:53 -07:00
connected-accounts.test.ts Fix connected account warnings 2026-01-28 00:18:02 -08:00
data-vault.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
email-themes.test.ts [Refactor] [Fix] Email Rendering Pipeline Refactor, Error Handling, and Bug Fixes (#1140) 2026-02-02 17:35:51 -08:00
index.test.ts Significantly faster users/[user_id] endpoint (and some others) (#998) 2025-11-05 09:15:36 -08:00
internal-metrics.test.ts "Last active at" column on users and sessions (#1081) 2026-01-09 11:39:07 -08:00
notification-preferences.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
oauth-providers.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
project-permission-definitions.test.ts Config DB migration step 2 (#629) 2025-04-29 14:52:45 -07:00
project-permissions.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
projects.test.ts Config sources (#1083) 2026-01-21 18:08:35 -08:00
render-email.test.ts [Refactor] [Fix] Email Rendering Pipeline Refactor, Error Handling, and Bug Fixes (#1140) 2026-02-02 17:35:51 -08:00
restricted-users.test.ts Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
send-email.test.ts Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
stripe-webhooks.test.ts fix product route access (#1134) 2026-01-27 18:30:14 +00:00
team-invitations.test.ts Onboarding app & restricted users (#1069) 2026-01-11 17:22:14 -08:00
team-member-profiles.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
team-memberships.test.ts Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
team-permission-definitions.test.ts Fix error where deleting a team creator default permission would make the dashboard crash 2025-08-11 17:42:54 -07:00
team-permissions.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
teams.test.ts Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
token-refresh-events.test.ts Reduce number of token refresh events 2026-01-28 14:56:11 -08:00
unsubscribe-link.test.ts [Refactor] [Fix] Email Rendering Pipeline Refactor, Error Handling, and Bug Fixes (#1140) 2026-02-02 17:35:51 -08:00
users-primary-email.test.ts Onboarding app & restricted users (#1069) 2026-01-11 17:22:14 -08:00
users.test.ts Sign up rules (#1138) 2026-02-03 11:08:24 -08:00