Skip to content

feat(users): provision accounts through listed SSO providers with signup closed (#874) - #913

Merged
antosubash merged 9 commits into
mainfrom
feat/issue-874-oauth-provisioning
Nov 11, 2026
Merged

antosubash merged 9 commits into
mainfrom
feat/issue-874-oauth-provisioning

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • Adds two users settings: oauth_signup_providers (any of google, github, microsoft, oidc, normalised) and oauth_signup_default_role (blank means no role; admin is refused).
  • A first sign-in through a listed provider creates the account (external, SSO-only) when the provider proved the email, whatever allow_signup says. An unproven email is refused, even with signup open. Listing a provider never loosens anything.
  • Accounts from a listed provider get oauth_signup_default_role, never the self-signup user role. Unlisted providers keep the old rule: they create accounts only with allow_signup on, and those accounts get user. Local registration (the API, the /users/register page and the links) still follows allow_signup alone.
  • The OAuth provider fields moved to users/core/oauth_settings.py (OAuthSettings), because settings.py was at the 300-line cap. UsersSettings(OAuthSettings, _UsersCoreSettings) keeps the settings editor's field order, and a test checks it. UserManager.allow_signup stays for downstream readers.
  • Docs: the users README, docs/modules/users.md (new "Provisioning accounts through SSO" section) and the CHANGELOG.
  • Design: docs/superpowers/specs/2026-11-11-oauth-provisioning-design.md.

Closes #874

Verification

  • New and extended tests:
    • settings validation and the order and provider-name checks (tests/core/settings/);
    • callback flows: a listed provider with a proven email, without one, an unlisted provider, and local registration staying closed (tests/oauth/flow/test_users_oauth_provider_signup.py);
    • which role each case gets: configured, blank, missing, and unlisted with signup open (tests/accounts/manager/test_users_default_role.py).
  • Local CI:
    • make lint passes, and make test-js has 906 passed.
    • make test-py had 8363 passed and 1 failure: test_background_tasks_outbox_thread_loops, a wall-clock bound in an untouched module (1.77 s vs 1.5 s at load 13.5). It passes on its own (4/4).
    • The users and settings tests pass (1414).
  • Reviews: Sonnet correctness and maintainability (2 passes) and Codex. Codex caught 3 ty return-type errors after the split, which are fixed.
  • Verification report: https://claude.ai/artifact/7fpUrZ7CkZZPzXYDDMSWPp

Report links are Claude Artifacts and start private. The author can share them from claude.ai/code/artifacts if reviewers need access.

Test plan

  • CI is green
  • Settings → Users: the OAuth groups still come after the general fields, and "OAuth provisioning" shows both new fields

https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4

…ettings

settings.py was at the 300-line cap. UsersSettings inherits OAuthSettings, so
every field stays on app.state.users.settings.

Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…osed (#874)

A provider in oauth_signup_providers may create an account on first sign-in
when it proved the email, whatever allow_signup says; the account gets
oauth_signup_default_role (none when blank). Other providers keep following
allow_signup, and local registration is unchanged.

Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Keep the settings editor's field order (OAuth fields last), restore
UserManager.allow_signup, normalise provider names, tie OAUTH_PROVIDER_NAMES
to build_clients by test, and document the provisioning role.

Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
README states the provisioning role applies with signup open too.

Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: c68f0c8
Status: ✅  Deploy successful!
Preview URL: https://cafe7716.simple-module-python.pages.dev
Branch Preview URL: https://feat-issue-874-oauth-provisi.simple-module-python.pages.dev

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-11T18:29:47.575493Z c68f0c8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@antosubash
antosubash merged commit 31134c4 into main Nov 11, 2026
17 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.

users: SSO account provisioning is tied to local self-signup (allow_signup); add a provider-scoped setting

1 participant