fix(config-service): make /config/user-system anonymous so INACTIVE users can read inviteOnly#5572
fix(config-service): make /config/user-system anonymous so INACTIVE users can read inviteOnly#5572aicam wants to merge 3 commits into
Conversation
…sers can read inviteOnly A freshly-registered user is INACTIVE until an admin approves them and therefore cannot reach the @RolesAllowed("REGULAR", "ADMIN") config endpoints. The frontend reads the `inviteOnly` flag at exactly that point to decide whether to show the registration-request form (and notify admins). Since apache#5305 moved /config/user-system behind a role check, the flag became unreachable for the very users it targets, so the form never appeared and no admin notification was sent. Restore @permitAll on /config/user-system. It only exposes the boolean inviteOnly flag, which is non-sensitive and already needed pre-activation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8d3763f to
8e6a1b4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5572 +/- ##
============================================
- Coverage 52.32% 51.68% -0.64%
+ Complexity 2484 2423 -61
============================================
Files 1068 1057 -11
Lines 41353 41036 -317
Branches 4441 4413 -28
============================================
- Hits 21639 21211 -428
- Misses 18444 18580 +136
+ Partials 1270 1245 -25
*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:
|
…nfig/user-system The spec pinned /config/user-system as @RolesAllowed (401 without a token). Now that the endpoint is @permitAll, assert it answers anonymous callers with 200 and exposes exactly the inviteOnly flag, while still serving authenticated callers. Mirrors the existing /config/pre-login guard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The PR description is not following the PR template. Please fix the PR description. Also, please create an issue and resolve that issue in this PR. Since it is related to user experience, please include screenshots of BEFORE & AFTER. |
|
@xuang7 I think this needs to be included in the release v1.2 . Can you review it and decide ? |
|
test @aicam |
Yicong-Huang
left a comment
There was a problem hiding this comment.
please move needed endpoint (e.g., invite-only config) to pre-login which is exposed to all. don't expose all endpoints just because one of the flag needs to be exposed.
What changes were proposed in this PR?
#5305 moved
GET /config/user-systemfrom@PermitAllto@RolesAllowed("REGULAR", "ADMIN"). A freshly-registered user isINACTIVEuntil admin approval, so they cannot reach
@RolesAllowedendpoints — therequest returns 403,
inviteOnlyis left undefined on the frontend, theregistration-request form never appears, and no admin notification email is
sent. In invite-only deployments, new sign-ups are silently dropped.
This PR restores
@PermitAllon/config/user-system. The endpoint exposesonly the non-sensitive boolean
inviteOnlyflag, which is specifically neededbefore activation.
Any related issues, documentation, discussions?
Resolves #5587
How was this PR tested?
ConfigResourceAuthSpeccases:/config/user-systemreturns 200anonymously, exposes exactly the
inviteOnlykey, and still returns 200 witha valid Bearer token.
inviteOnly: true, the registration-request form appears, and the adminnotification email is sent.
The following picture shows the modal opened after applying this fix to one of our deployments

Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)