RSPEED-2435: fix rh-identity health probe path matching with root_path#1147
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughChanges the health-probe skip condition to use path suffix matching instead of exact equality, allowing requests ending with "/readiness" or "/liveness" to be skipped when skip_for_health_probes is enabled. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
29fecd5 to
248a8a5
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/authentication/rh_identity.py`:
- Around line 220-222: The current endswith check in the authentication bypass
(request.url.path.endswith(...)) is too permissive and allows any multi-segment
path that ends with "/readiness" or "/liveness" to skip auth; update the
condition used where
configuration.authentication_configuration.skip_for_health_probes is checked so
it only compares the last path segment (e.g., compute segment =
request.url.path.rstrip("/").split("/")[-1] and check segment in
("readiness","liveness")) before returning NO_AUTH_TUPLE; keep the existing
skip_for_health_probes flag and maintain support for arbitrary root_path
prefixes.
eac834e to
594a21a
Compare
When root_path is set (e.g. /api/lightspeed), the request path becomes /api/lightspeed/liveness instead of /liveness. The exact match fails and health probes get rejected with 401. Match only the final path segment to handle any prefix. Signed-off-by: Major Hayden <major@redhat.com>
594a21a to
961d9c7
Compare
Summary
rh-identityauth plugin whenroot_pathis configuredProblem
When
root_pathis set (e.g./api/lightspeed), request paths become/api/lightspeed/livenessinstead of/liveness. Theskip_for_health_probescheck inrh_identity.pyuses an exact match (in ("/readiness", "/liveness")) which fails on the prefixed paths, causing health probes to get 401 and pods to crash-loop.Fix
Matches only the final path segment — avoids false positives on paths like
/api/v1/conversations/liveness.Only the
rh-identityauth plugin is affected — this is the only auth module used in our deployment.Jira
https://issues.redhat.com/browse/RSPEED-2435