Incoming X-Forwarded-User / X-Auth-Verified STRIPPED from client request (anti-spoofing)
Unauthenticated requests do NOT get these headers
Unit tests: injection, stripping, edge cases
Security contract
Downstream MUST only accept traffic from gateway (NetworkPolicy enforced).
Downstream trusts X-Auth-Verified: true header — if absent, request is unauthenticated.
Review checklist
Anti-spoofing: incoming headers stripped before injection
Wildcard "*" passed as literal, not expanded
Empty claims handled (no empty header values)
## Summary
After JWT validation, gateway injects identity headers so downstream gets audit trail without parsing JWTs.
**Code repo:** `rock/homelab-frontend` — `internal/proxy/proxy.go`
## Headers
```
X-Forwarded-User: rock # sub claim
X-Forwarded-Roles: llm:inference # roles/permissions claim
X-Acting-Service: portfolio-agent # azp claim (service accounts only)
X-Auth-Verified: true # gateway validated JWT
```
## Acceptance Criteria
- [ ] Headers injected after successful JWT validation
- [ ] Incoming `X-Forwarded-User` / `X-Auth-Verified` STRIPPED from client request (anti-spoofing)
- [ ] Unauthenticated requests do NOT get these headers
- [ ] Unit tests: injection, stripping, edge cases
## Security contract
Downstream MUST only accept traffic from gateway (NetworkPolicy enforced).
Downstream trusts `X-Auth-Verified: true` header — if absent, request is unauthenticated.
## Review checklist
- [ ] Anti-spoofing: incoming headers stripped before injection
- [ ] Wildcard "*" passed as literal, not expanded
- [ ] Empty claims handled (no empty header values)
rock
added this to the Phase 3: OAuth2 Token Exchange & Identity Propagation milestone 2026-09-08 04:42:00 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
After JWT validation, gateway injects identity headers so downstream gets audit trail without parsing JWTs.
Code repo:
rock/homelab-frontend—internal/proxy/proxy.goHeaders
Acceptance Criteria
X-Forwarded-User/X-Auth-VerifiedSTRIPPED from client request (anti-spoofing)Security contract
Downstream MUST only accept traffic from gateway (NetworkPolicy enforced).
Downstream trusts
X-Auth-Verified: trueheader — if absent, request is unauthenticated.Review checklist