Repository navigation
feat(config-service): split /config/pre-login from authenticated endpoints - #5305
Merged
Merged
Conversation
…oints Closes apache#5304 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5305 +/- ##
============================================
+ Coverage 49.86% 49.92% +0.05%
- Complexity 2415 2416 +1
============================================
Files 1052 1052
Lines 40764 40780 +16
Branches 4355 4356 +1
============================================
+ Hits 20327 20358 +31
+ Misses 19224 19210 -14
+ Partials 1213 1212 -1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
bobbai00
approved these changes
Jun 1, 2026
bobbai00
left a comment
Contributor
There was a problem hiding this comment.
Tested locally, works great. LGTM
aicam
added a commit
to aicam/texera
that referenced
this pull request
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) <[email protected]>
aicam
added a commit
to aicam/texera
that referenced
this pull request
Jun 10, 2026
A freshly-registered user is INACTIVE and cannot reach the @RolesAllowed config endpoints, yet the frontend reads inviteOnly right after registration to decide whether to show the registration-request form (and notify admins). apache#5305 moved inviteOnly to /config/user-system (@RolesAllowed), making it unreachable for exactly those users. Expose the flag on the already-public @permitAll /config/pre-login instead, without widening any authenticated endpoint. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Yicong-Huang
pushed a commit
that referenced
this pull request
Jun 10, 2026
…VE users see the registration-request form (#5572) ### What changes were proposed in this PR? #5305 moved `GET /config/user-system` from `@PermitAll` to `@RolesAllowed("REGULAR", "ADMIN")`. A freshly-registered user is `INACTIVE` until admin approval, so they cannot reach `@RolesAllowed` endpoints — the request returns 403/401, `inviteOnly` is left undefined on the frontend, the registration-request form never appears, and no admin notification email is sent. In invite-only deployments, new sign-ups are silently dropped. Per review feedback (@Yicong-Huang), instead of re-opening the whole `/config/user-system` endpoint with `@PermitAll`, this PR exposes only the `inviteOnly` boolean on the already-public `/config/pre-login` and keeps `/config/user-system` `@RolesAllowed`. The frontend already loads `/config/pre-login` anonymously during APP_INITIALIZER, so `inviteOnly` is now available before activation without widening the authenticated surface. <!-- BEFORE & AFTER screenshots to be added. --> ### Any related issues, documentation, discussions? Resolves #5587 ### How was this PR tested? - Updated `ConfigResourceAuthSpec`: `/config/pre-login` exposes exactly `{localLogin, googleLogin, defaultLocalUser, attributionEnabled, inviteOnly}` anonymously; `/config/user-system` returns 401 + `Bearer` challenge without a token and 200 with a valid Bearer token. `sbt ConfigService/test` → 9 passed. - Verified live on an invite-only deployment: a fresh INACTIVE registration reads `inviteOnly: true` from `/config/pre-login`, the registration-request form appears, and the admin notification email is sent, while `/config/user-system` still returns 403/401 to anonymous callers. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.8) --------- (backported from commit 17607c5) Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
SarahAsad23
pushed a commit
to SarahAsad23/texera
that referenced
this pull request
Jun 10, 2026
…VE users see the registration-request form (apache#5572) ### What changes were proposed in this PR? apache#5305 moved `GET /config/user-system` from `@PermitAll` to `@RolesAllowed("REGULAR", "ADMIN")`. A freshly-registered user is `INACTIVE` until admin approval, so they cannot reach `@RolesAllowed` endpoints — the request returns 403/401, `inviteOnly` is left undefined on the frontend, the registration-request form never appears, and no admin notification email is sent. In invite-only deployments, new sign-ups are silently dropped. Per review feedback (@Yicong-Huang), instead of re-opening the whole `/config/user-system` endpoint with `@PermitAll`, this PR exposes only the `inviteOnly` boolean on the already-public `/config/pre-login` and keeps `/config/user-system` `@RolesAllowed`. The frontend already loads `/config/pre-login` anonymously during APP_INITIALIZER, so `inviteOnly` is now available before activation without widening the authenticated surface. <!-- BEFORE & AFTER screenshots to be added. --> ### Any related issues, documentation, discussions? Resolves apache#5587 ### How was this PR tested? - Updated `ConfigResourceAuthSpec`: `/config/pre-login` exposes exactly `{localLogin, googleLogin, defaultLocalUser, attributionEnabled, inviteOnly}` anonymously; `/config/user-system` returns 401 + `Bearer` challenge without a token and 200 with a valid Bearer token. `sbt ConfigService/test` → 9 passed. - Verified live on an invite-only deployment: a fresh INACTIVE registration reads `inviteOnly: true` from `/config/pre-login`, the registration-request form appears, and the admin notification email is sent, while `/config/user-system` still returns 403/401 to anonymous callers. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.8) --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
ELin2025
pushed a commit
to ELin2025/texera
that referenced
this pull request
Jun 16, 2026
…VE users see the registration-request form (apache#5572) ### What changes were proposed in this PR? apache#5305 moved `GET /config/user-system` from `@PermitAll` to `@RolesAllowed("REGULAR", "ADMIN")`. A freshly-registered user is `INACTIVE` until admin approval, so they cannot reach `@RolesAllowed` endpoints — the request returns 403/401, `inviteOnly` is left undefined on the frontend, the registration-request form never appears, and no admin notification email is sent. In invite-only deployments, new sign-ups are silently dropped. Per review feedback (@Yicong-Huang), instead of re-opening the whole `/config/user-system` endpoint with `@PermitAll`, this PR exposes only the `inviteOnly` boolean on the already-public `/config/pre-login` and keeps `/config/user-system` `@RolesAllowed`. The frontend already loads `/config/pre-login` anonymously during APP_INITIALIZER, so `inviteOnly` is now available before activation without widening the authenticated surface. <!-- BEFORE & AFTER screenshots to be added. --> ### Any related issues, documentation, discussions? Resolves apache#5587 ### How was this PR tested? - Updated `ConfigResourceAuthSpec`: `/config/pre-login` exposes exactly `{localLogin, googleLogin, defaultLocalUser, attributionEnabled, inviteOnly}` anonymously; `/config/user-system` returns 401 + `Bearer` challenge without a token and 200 with a valid Bearer token. `sbt ConfigService/test` → 9 passed. - Verified live on an invite-only deployment: a fresh INACTIVE registration reads `inviteOnly: true` from `/config/pre-login`, the registration-request form appears, and the admin notification email is sent, while `/config/user-system` still returns 403/401 to anonymous callers. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.8) --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
…oints (apache#5305) ### What changes were proposed in this PR? `config-service` no longer broadcasts the full GUI configuration to anonymous callers. The four fields the frontend actually needs before login (`localLogin`, `googleLogin`, `defaultLocalUser`, `attributionEnabled`) move to a new `GET /api/config/pre-login` (`@PermitAll`). `GET /api/config/gui` and `GET /api/config/user-system` are now `@RolesAllowed("REGULAR", "ADMIN")` and only answer authenticated traffic. On the frontend, `GuiConfigService.load()` always fetches `/config/pre-login` at `APP_INITIALIZER`. When a JWT is already in `localStorage` (browser reload while logged in), it chains `/config/gui` + `/config/user-system` in the same await so the full config is in memory before any post-login component mounts. `UserService.handleAccessToken` does the same chaining on a fresh login so `loginWithExistingToken` (which reads `config.env.inviteOnly`) runs only after the authenticated config has resolved. Expired-token 403s on the post-login fetch are caught so a stale `localStorage` token cannot block bootstrap — that was the exact failure mode that caused apache#5025 to revert the earlier eager-401 lockdown. ### Any related issues, documentation, discussions? Closes apache#5304. Related: apache#4901 (eager-401 from `JwtAuthFilter`), apache#5025 (revert that broke `ConfigService` bootstrap last time we attempted a similar lockdown), apache#5199 (re-applied `@RolesAllowed` enforcement on the microservices, with `@PermitAll` opt-out for the two pre-login endpoints). ### How was this PR tested? Added unit tests covering pre-login / gui / user-system access with and without a valid Bearer token, the orchestrator's branching on a stored token, the 403 fallback, and the `UserService.handleAccessToken` ordering guarantee. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Opus 4.7 --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
…VE users see the registration-request form (apache#5572) ### What changes were proposed in this PR? apache#5305 moved `GET /config/user-system` from `@PermitAll` to `@RolesAllowed("REGULAR", "ADMIN")`. A freshly-registered user is `INACTIVE` until admin approval, so they cannot reach `@RolesAllowed` endpoints — the request returns 403/401, `inviteOnly` is left undefined on the frontend, the registration-request form never appears, and no admin notification email is sent. In invite-only deployments, new sign-ups are silently dropped. Per review feedback (@Yicong-Huang), instead of re-opening the whole `/config/user-system` endpoint with `@PermitAll`, this PR exposes only the `inviteOnly` boolean on the already-public `/config/pre-login` and keeps `/config/user-system` `@RolesAllowed`. The frontend already loads `/config/pre-login` anonymously during APP_INITIALIZER, so `inviteOnly` is now available before activation without widening the authenticated surface. <!-- BEFORE & AFTER screenshots to be added. --> ### Any related issues, documentation, discussions? Resolves apache#5587 ### How was this PR tested? - Updated `ConfigResourceAuthSpec`: `/config/pre-login` exposes exactly `{localLogin, googleLogin, defaultLocalUser, attributionEnabled, inviteOnly}` anonymously; `/config/user-system` returns 401 + `Bearer` challenge without a token and 200 with a valid Bearer token. `sbt ConfigService/test` → 9 passed. - Verified live on an invite-only deployment: a fresh INACTIVE registration reads `inviteOnly: true` from `/config/pre-login`, the registration-request form appears, and the admin notification email is sent, while `/config/user-system` still returns 403/401 to anonymous callers. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.8) --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
config-serviceno longer broadcasts the full GUI configuration to anonymous callers. The four fields the frontend actually needs before login (localLogin,googleLogin,defaultLocalUser,attributionEnabled) move to a newGET /api/config/pre-login(@PermitAll).GET /api/config/guiandGET /api/config/user-systemare now@RolesAllowed("REGULAR", "ADMIN")and only answer authenticated traffic.On the frontend,
GuiConfigService.load()always fetches/config/pre-loginatAPP_INITIALIZER. When a JWT is already inlocalStorage(browser reload while logged in), it chains/config/gui+/config/user-systemin the same await so the full config is in memory before any post-login component mounts.UserService.handleAccessTokendoes the same chaining on a fresh login sologinWithExistingToken(which readsconfig.env.inviteOnly) runs only after the authenticated config has resolved. Expired-token 403s on the post-login fetch are caught so a stalelocalStoragetoken cannot block bootstrap — that was the exact failure mode that caused #5025 to revert the earlier eager-401 lockdown.Any related issues, documentation, discussions?
Closes #5304.
Related: #4901 (eager-401 from
JwtAuthFilter), #5025 (revert that brokeConfigServicebootstrap last time we attempted a similar lockdown), #5199 (re-applied@RolesAllowedenforcement on the microservices, with@PermitAllopt-out for the two pre-login endpoints).How was this PR tested?
Added unit tests covering pre-login / gui / user-system access with and without a valid Bearer token, the orchestrator's branching on a stored token, the 403 fallback, and the
UserService.handleAccessTokenordering guarantee.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.7