Skip to content

AIS-107 add questionarie after sign up - #58

Open
churnikov wants to merge 3 commits into
feat/altcha-signup-gatefrom
feat/registration-questionnaire
Open

churnikov wants to merge 3 commits into
feat/altcha-signup-gatefrom
feat/registration-questionnaire

Conversation

@churnikov

@churnikov churnikov commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

image

Adds a registration questionnaire for pending users and requires it before an account can be approved.

  • New Event Function registration_questionnaire (oi_registration_questionnaire.py)
  • Serves GET/POST /auth/registration-questionnaire to signed-in pending users: organisation, positions, SciLifeLab affiliation, planned use, Slack opt-in.
  • Builds the form from the whale-auth-tools schema and submits answers there with an ALTCHA payload. The account email is sent as contactEmail.
  • Stores only the submission ID in the user's info (scilifelab_questionnaire); one submission per account.
  • Serves GET/POST /auth/registration-questionnaire to signed-in pending users: organisation, positions, SciLifeLab affiliation, planned use, Slack opt-in.
  • Builds the form from the whale-auth-tools schema and submits answers there with an ALTCHA payload. The account email is sent as contactEmail.
  • Stores only the submission ID in the user's info (scilifelab_questionnaire); one submission per account.
  • POST /api/v1/registration-questionnaire/status returns {"required": bool} so the Open WebUI fork can redirect pending users to the form.
  • Valves: require_altcha, altcha_widget_url. Needs WHALE_AUTH_URL and WHALE_AUTH_API_TOKEN.
  • Account approval Function 0.3.0
  • New require_questionnaire Valve (default on). An approval to user without a questionnaire submission is undone: the role returns to pending, with no group or email. Approving again after submission works normally.
  • README: setup, Valves, endpoints and the questionnaire requirement.

Rollout

  1. Deploy the openllm-charts change, which provides the settings and the ALTCHA widget.
  2. Install registration_questionnaire, then update the account approval Function. In this order, approvals are not undone before users can submit.
  3. Restart Open WebUI so the routes are registered.

🤖 Generated with Claude Code

@churnikov
churnikov requested a review from akochari November 13, 2026 14:46
@churnikov churnikov self-assigned this Nov 13, 2026
@churnikov
churnikov requested a review from a team as a code owner November 13, 2026 14:46
@churnikov
churnikov added this pull request to stack #59 November 13, 2026 14:46
Comment thread openwebui-functionality/README.md Outdated

The `registration_questionnaire` Event Function asks newly registered users for
the information administrators use to decide on approval. It serves a form at
`/auth/registration-questionnaire` with these questions:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have the actual questions in the readme file? they will perhaps change in the future. we shouldn't have same info repeated in multiple places, we won't be able to maintain it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't be maintained manually. This is generated by claude and as I said, there are two skills triggered: update or create tests and update or create docs records if a OI function is created or updated.

So I'd say it's fine in terms of maintenance, but if it's too verbose, we can consider updating the skill to make it less so

Comment thread openwebui-functionality/README.md Outdated
```

Email verification tests cover environment defaults and saved overrides, duration and email header validation, signup sending and pausing, inactivity when deployment settings are missing, email-change revocation, TTL refresh on existing routes, error pages for expired, invalid, and outdated links, resend eligibility, cooldown, and cross-site rejection, and email branding. Account approval notification tests cover Valve defaults and validation, pending-user marking and backfill, approval emails and group assignment from role and SCIM events, existing memberships, group failures retaining the marker, no email for unmarked users, admin approvals, or paused sending, idempotency, inactivity when deployment settings are missing, sign-in link selection, and email content. Gmail and Open WebUI database calls are mocked; no real emails are sent.
Email verification tests cover environment defaults and saved overrides, duration and email header validation, signup sending and pausing, inactivity when deployment settings are missing, email-change revocation, TTL refresh on existing routes, error pages for expired, invalid, and outdated links, resend eligibility, cooldown, and cross-site rejection, and email branding. Account approval notification tests cover Valve defaults and validation, pending-user marking and backfill, approval emails and group assignment from role and SCIM events, undoing approvals without a questionnaire submission and re-approval after submission, existing memberships, group failures retaining the marker, no email for unmarked users, admin approvals, or paused sending, idempotency, inactivity when deployment settings are missing, sign-in link selection, and email content. Registration questionnaire tests cover the redirect status for each kind of user, form rendering from the service schema, ALTCHA embedding and the `require_altcha` switch, submission payloads and the user-info marker, validation and service rejections that keep entered answers, service failures, refusals for signed-out, non-pending, and already-submitted users, cross-site and oversized POSTs, inactivity, route registration, and Valve validation. Gmail, `whale-auth-tools`, and Open WebUI database calls are mocked; no real emails or requests are sent.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather have these descriptions close to the tests themselves because this will get outdated quickly. It's best if we don't have to come to the readme file to make changes after we change/add/remove tests.

- Center status and informational messages consistently.
- Clarify that questionnaire answers are required for account review.
- Add repository changelog requirements and an initial `CHANGELOG.md`.
- Add the `sync-changelog` skill for recording repository changes.
- Condense Open WebUI function documentation guidance and update the Functions README.
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.

2 participants