apache / apache/texera

Skip duplicate JWT parse in AccessControlResource when SecurityContext is already populated

Open
#5,559 0 comments 0 reactions 1 assignee Claimed by @Yicong-Huang View on GitHub
Dominant language
Scala
Stars
314
Forks
187
Avg merge
1d 21h
Merged PRs (30d)
214

Description

### Task Summary

In `access-control-service/src/main/scala/org/apache/texera/service/resource/AccessControlResource.scala`, when `SecurityContext.getUserPrincipal` is already a `SessionUser` populated by `JwtAuthFilter`, reuse it instead of calling `JwtParser.parseToken` on the `Authorization` header value again. Fall back to the existing query/body token extraction only when `SecurityContext` is unauthenticated.

### Task Type

- [x] Refactor / Cleanup

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.