Repository navigation
feat: honor invite-only at sign-up and add an admin switch - #9498
Conversation
Automated Reviewer SuggestionsBased on the
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #9498 +/- ##
============================================
- Coverage 91.63% 91.61% -0.02%
+ Complexity 5042 5033 -9
============================================
Files 1284 1285 +1
Lines 56996 57059 +63
Branches 7405 7411 +6
============================================
+ Hits 52226 52276 +50
- Misses 2903 2913 +10
- Partials 1867 1870 +3
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 341 | 0.208 | 26,872/61,422/61,422 us | 🔴 +32.7% / 🔴 +347.4% |
| ⚪ | bs=100 sw=10 sl=64 | 800 | 0.488 | 122,195/149,678/149,678 us | ⚪ within ±5% / 🔴 +69.1% |
| ⚪ | bs=1000 sw=10 sl=64 | 936 | 0.572 | 1,058,506/1,155,054/1,155,054 us | ⚪ within ±5% / 🔴 +39.7% |
Baseline details
Latest main 43c3982 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 341 tuples/sec | 338 tuples/sec | 1,005 tuples/sec | +0.9% | -66.1% |
| bs=10 sw=10 sl=64 | MB/s | 0.208 MB/s | 0.206 MB/s | 0.614 MB/s | +1.0% | -66.1% |
| bs=10 sw=10 sl=64 | p50 | 26,872 us | 27,469 us | 10,325 us | -2.2% | +160.3% |
| bs=10 sw=10 sl=64 | p95 | 61,422 us | 46,293 us | 13,728 us | +32.7% | +347.4% |
| bs=10 sw=10 sl=64 | p99 | 61,422 us | 46,293 us | 16,323 us | +32.7% | +276.3% |
| bs=100 sw=10 sl=64 | throughput | 800 tuples/sec | 834 tuples/sec | 1,347 tuples/sec | -4.1% | -40.6% |
| bs=100 sw=10 sl=64 | MB/s | 0.488 MB/s | 0.509 MB/s | 0.822 MB/s | -4.1% | -40.7% |
| bs=100 sw=10 sl=64 | p50 | 122,195 us | 117,778 us | 80,846 us | +3.8% | +51.1% |
| bs=100 sw=10 sl=64 | p95 | 149,678 us | 152,320 us | 88,523 us | -1.7% | +69.1% |
| bs=100 sw=10 sl=64 | p99 | 149,678 us | 152,320 us | 112,010 us | -1.7% | +33.6% |
| bs=1000 sw=10 sl=64 | throughput | 936 tuples/sec | 954 tuples/sec | 1,394 tuples/sec | -1.9% | -32.8% |
| bs=1000 sw=10 sl=64 | MB/s | 0.572 MB/s | 0.582 MB/s | 0.851 MB/s | -1.7% | -32.7% |
| bs=1000 sw=10 sl=64 | p50 | 1,058,506 us | 1,043,700 us | 787,853 us | +1.4% | +34.4% |
| bs=1000 sw=10 sl=64 | p95 | 1,155,054 us | 1,164,479 us | 826,583 us | -0.8% | +39.7% |
| bs=1000 sw=10 sl=64 | p99 | 1,155,054 us | 1,164,479 us | 872,816 us | -0.8% | +32.3% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,586.55,200,128000,341,0.208,26871.93,61422.14,61422.14
1,100,10,64,20,2499.96,2000,1280000,800,0.488,122195.04,149678.02,149678.02
2,1000,10,64,20,21359.09,20000,12800000,936,0.572,1058505.62,1155053.66,1155053.66
kunwp1
left a comment
There was a problem hiding this comment.
Thanks for the feature! Left three comments!
kunwp1
left a comment
There was a problem hiding this comment.
LGTM! Left a few small follow-ups.
What changes were proposed in this PR?
USER_SYS_INVITE_ONLYnow decides the role a new account starts with, and admins can switch it on Admin → Settings without a restart.Sign-up roles. These sign-ups start REGULAR while invite-only is off, and INACTIVE while it is on:
An account from a provider that asserts no email (ORCID) stays INACTIVE until it supplies one, and then gets the same role. Staying INACTIVE until then is also what lets that step adopt a placeholder. Accounts already waiting for approval, and roles an admin set, are never changed.
An admin setting. Invite-only is now the
invite_onlysite setting, read on every sign-up. Admin → Settings has a Registration card with an Invite Only switch.USER_SYS_INVITE_ONLY, now declared indefault.conf, sets its value the first time config-service starts, like the page's other settings, and Reset restores it. The value is stored astrueorfalsewhatever spelling the variable uses (yes,off, …)./config/pre-loginreports the stored value to the sign-up form. Nothing reads it after sign-in any more, so/config/user-system, which served only this flag, is removed along with the request the frontend made to it on every sign-in. Each sign-up reads the setting before it opens its transaction, so a burst of sign-ups cannot have each one hold a pooled connection while it waits for a second.Every boolean default. The same now holds for every setting
default.confdeclares as a boolean: the sidebar tab switches (GUI_TABS_*_ENABLED) and the reset flag are stored astrueorfalsetoo. Before,GUI_TABS_HUB_ENABLED=onstoredon, and the dashboard and the admin page, which accept only"true", hid the Hub tab. A value that is not a boolean now stops config-service at startup, asUSER_SYS_INVITE_ONLYand the reset flag already did. Rows a deployment already stored asonstay until an admin saves or resets that switch.On by default, and closed when in doubt. A REGULAR account can run code on the server, so opening sign-up has to be a deployment's explicit choice. A deployment that never set the variable keeps its new accounts INACTIVE, as before. The configured value applies only while no row is stored: a read that fails, or a row that is neither true nor false, keeps sign-up closed and logs a warning. The admin card likewise shows anything but an explicit
falseas on, because Save writes whatever the switch shows.Pending accounts. Any INACTIVE account gets the pending-approval screen when it signs in, whatever the switch says now. So accounts still waiting when an admin turns invite-only off are not dropped onto a dashboard that refuses every request. The same goes for an account an admin deactivated, which before got this screen only on invite-only deployments.
Sign-up page. When the new account is usable, the page says so and opens the dashboard. The "contact the administrator" hint and message appear only while invite-only is on, or while the account is still INACTIVE.
Any related issues, documentation, discussions?
Closes #9497.
How was this PR tested?
Unit tests, all passing:
That is 15 SiteSettings, 105 Config, 9 InviteOnly, 43 ConfigService and 141 amber auth cases, plus 12 GuiConfigService, 62 admin-settings, 64 login and 39 AuthService cases. The new cases run with invite-only both on and off. They cover local sign-up, register/verify, Google and Apple, placeholder claims, the add-email step and placeholder adoption, and a switch reaching the very next registration. They check that pending accounts and admin-set roles are left alone, that a missing row falls back to the seed while a failed read or an unreadable row keeps sign-up closed, that invite-only, every sidebar tab switch and the reset flag are seeded as true or false whatever the spelling (
off,no,on,yes) while a value that is not a boolean is refused, and that a fresh deployment seeds invite-only on. They also cover the admin card's load, save, reset and its guard against saving before the load, the sign-up page's outcomes and hint, the pending screen for an INACTIVE sign-in while invite-only is off, and a sign-in that no longer asks for/config/user-system.Lint:
scalafmtCheckAllandscalafixAll --checkon DAO, Config, Auth, ConfigService and WorkflowExecutionService;prettier-eslint --list-differentandeslinton the changed frontend files.Manual check: config-service and the web server ran against a fresh database, with
USER_SYS_INVITE_ONLYunset.invite_onlywas seededtrue, and a sign-up came out INACTIVE with the Request access dialog./config/guiand/config/amberbut not/config/user-system, which now answers 404, and the sign-up form still told new accounts to ask for activation.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)
🤖 Generated with Claude Code