Repository navigation
fix: forward cookie header in createServerApiClient for oauth2-proxy - #6750
naveenkumarsp wants to merge 4 commits into
Conversation
|
No linked issues found. Please add the corresponding issues in the pull request description. |
|
@naveenkumarsp can u link the ticket? (if there is nothing exist - create one?) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6750 +/- ##
===========================================
- Coverage 46.42% 30.46% -15.96%
===========================================
Files 178 101 -77
Lines 18694 11773 -6921
===========================================
- Hits 8679 3587 -5092
+ Misses 10015 8186 -1829 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
shahargl
left a comment
There was a problem hiding this comment.
why did u remove the console.log?
|
@naveenkumarsp also frontend tests fails now |
@shahargl - apologies as i had missed this notification. Let me check and update the branch. also enable the console logs which were removed. |
…teServerApiClient
|
@shahargl - i have fixed the issue as well as reverted the console logs.. please review. |
Summary
When using
AUTH_TYPE=OAUTH2PROXY, server-side rendered (SSR) components make internal requests to the Keep backend viacreateServerApiClient().Currently,
createServerApiClient()forwards only identity headers (x-forwarded-user,x-forwarded-email,x-forwarded-groups,x-forwarded-access-token). In deployments where reverse proxies or sidecars independently authenticate inbound backend requests with session validation, internal server-to-server calls fail with401 Unauthorized/302 Redirectbecause the sessioncookieheader is dropped.This causes SSR pages like
/incidentsand/alerts/feed(which preload initial facets using Server Components) to fail during server rendering.Changes
cookieheader increateServerApiClient()whenAUTH_TYPE === AuthType.OAUTH2PROXY.console.logstatements increateServerApiClient.ts.keep-ui/shared/tests/createServerApiClient.test.tscovering header & cookie forwarding behavior.Testing
createServerApiClient()propagates thecookieheader alongside standard OAuth2-proxy identity headers./incidentsand/alerts/feedload initial facets successfully.