| Type |
New Feature
|
| Priority |
Normal
|
| Assignee | |
| Version |
none
|
| Sprints |
n/a
|
| Customer |
n/a
|
Issue Votes (0)
| Type |
New Feature
|
| Priority |
Normal
|
| Assignee | |
| Version |
none
|
| Sprints |
n/a
|
| Customer |
n/a
|
Problem
I woke up to this problem today when discussing the Bot testing approach over email with Artur. PATs only work for git operations (via Caddy
forward_auth). REST API consumers — CI/CD pipelines, third-party integrations, authorized bots — have no way to authenticate programmatically without simulating browser session login, which is fragile and stateful.Expected Behavior
Any REST API call with
Authorization: Bearer <token>should be validated againstPersonalAccessTokenRepositoryand granted access with the token owner's identity and roles, identical to a session-authenticated user.Current Behavior
Spring Security ignores the
Authorization: Bearerheader on REST endpoints. Only session cookies (JSESSIONID) are recognized. PATs are validated by Caddy only for/git/*routes.Fix
Implement a
PATAuthenticationFilterin Spring Security:Authorization: Bearer <token>from the request headerPersonalAccessTokenRepositorySecurityContextwith the token owner's identity and rolesSessionAuthSecurityConfigbeforeUsernamePasswordAuthenticationFilterEstimate
2-3h
Worklog
PATAuthenticationFilterextendingOncePerRequestFilterSessionAuthSecurityConfigNotes
PersonalAccessTokenRepositoryandPATHashServicealready exist — filter is the missing piece