Skip to content

fix(config-service): make /config/user-system anonymous so INACTIVE users can read inviteOnly#5572

Open
aicam wants to merge 2 commits into
apache:mainfrom
aicam:fix/user-system-config-permitall
Open

fix(config-service): make /config/user-system anonymous so INACTIVE users can read inviteOnly#5572
aicam wants to merge 2 commits into
apache:mainfrom
aicam:fix/user-system-config-permitall

Conversation

@aicam

@aicam aicam commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Problem

A freshly-registered user is INACTIVE until an admin approves them, so they cannot reach the @RolesAllowed("REGULAR", "ADMIN") config endpoints. The frontend reads the inviteOnly flag at exactly that point (right after registration) to decide whether to show the registration-request form — which collects the user's affiliation/reason and triggers the admin notification email.

#5305 moved /config/user-system from @PermitAll to @RolesAllowed("REGULAR", "ADMIN"). As a result, an INACTIVE user's request for inviteOnly returns 403, the flag is left undefined on the frontend, and:

  • the registration-request form never appears, and
  • no admin notification email is sent.

So in invite-only deployments, new sign-ups are silently dropped.

Fix

Restore @PermitAll on /config/user-system. The endpoint only exposes the boolean inviteOnly flag, which is non-sensitive and is specifically needed before activation.

Testing

Verified on an invite-only deployment: a fresh registration now receives inviteOnly: true while INACTIVE, the registration-request form appears, and the admin notification email is sent.

🤖 Generated with Claude Code

@github-actions github-actions Bot added fix platform Non-amber Scala service paths labels Jun 8, 2026
…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>
@aicam aicam force-pushed the fix/user-system-config-permitall branch from 8d3763f to 8e6a1b4 Compare June 8, 2026 22:50
@aicam aicam requested a review from bobbai00 June 8, 2026 22:50
@codecov-commenter

codecov-commenter commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.17%. Comparing base (564ccdb) to head (8723d87).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #5572   +/-   ##
=========================================
  Coverage     52.17%   52.17%           
  Complexity     2482     2482           
=========================================
  Files          1068     1068           
  Lines         41311    41311           
  Branches       4439     4439           
=========================================
  Hits          21556    21556           
  Misses        18490    18490           
  Partials       1265     1265           
Flag Coverage Δ *Carryforward flag
access-control-service 64.61% <ø> (ø)
agent-service 33.76% <ø> (ø) Carriedforward from 8e6a1b4
amber 53.28% <ø> (ø) Carriedforward from 8e6a1b4
computing-unit-managing-service 1.65% <ø> (ø)
config-service 56.06% <ø> (ø)
file-service 38.32% <ø> (ø)
frontend 46.42% <ø> (ø) Carriedforward from 8e6a1b4
pyamber 90.72% <ø> (ø) Carriedforward from 8e6a1b4
python 90.75% <ø> (ø) Carriedforward from 8e6a1b4
workflow-compiling-service 58.69% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…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>
@bobbai00

bobbai00 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix platform Non-amber Scala service paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants