The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-5305-0e5686ec2fff54a9b1a9b44840c5de3ceb7dd178
 has succeeded.
Run started by GitHub user Yicong-Huang (triggered by Yicong-Huang).

Head commit for run:
eb287f3fc2cbba5416d851078affc10537123e68 / Yicong Huang 
<[email protected]>
feat(config-service): split /config/pre-login from authenticated endpoints 
(#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 #5025 to
revert the earlier eager-401 lockdown.

### Any related issues, documentation, discussions?

Closes #5304.

Related: #4901 (eager-401 from `JwtAuthFilter`), #5025 (revert that
broke `ConfigService` bootstrap last time we attempted a similar
lockdown), #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]>

Report URL: https://github.com/apache/texera/actions/runs/26741010946

With regards,
GitHub Actions via GitBox

Reply via email to