-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fixes auth for forwarded requests for pull queries #6895
fix: Fixes auth for forwarded requests for pull queries #6895
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a very nit question, otherwise LGTM!
@@ -392,11 +400,24 @@ public static void makeAdminRequest(TestKsqlRestApp restApp, final String sql) { | |||
RestIntegrationTestUtil.makeKsqlRequest(restApp, sql, Optional.empty()); | |||
} | |||
|
|||
public static void makeAdminRequest( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why we have a makeAdminRequest
and makeAdminRequestWithResponse
here? Both of them call the same callee. Could we just have one makeAdminRequest
that always returns (a potential empty list), and its callers can just ignore the returned value or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, just noticed your question. I don't think there's a reason to have two separate methods. I agree with you. I'll do a quick followup PR to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great detective work figuring this out!
@@ -122,6 +129,19 @@ | |||
SerdeFeatures.of() | |||
); | |||
|
|||
private static final String PROPS_JAAS_REALM = "KsqlServer-Props"; | |||
private static final String KSQL_RESOURCE = "ksql-user"; | |||
private static final String USER_WITH_ACCESS = "harry"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a test trying out a user with no access? that will make sure that we haven't accidentally just changed it to allow all users 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have tests elsewhere that test auth for pull queries and check the negative case.
Co-authored-by: Alan Sheinberg <[email protected]>
Description
The PR #6665 made
HARouting
a singleton. Unfortunately, it also kept a reference to the service context rather than using the user-aware context. What this meant is that all forward requests did not provide authentication and failed. This didn't fail in testing because it requires more than two nodes to expose the forwarding failure, since HA makes the request fall back to the fowarder itself. For that reason, I made the routing functional test use auth, which does test the three node case and was able to expose the bug.Testing done
PullQueryRoutingFunctionalTest
with auth.Reviewer checklist