-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feat][broker] PIP 97: Implement for ServerCnx #19409
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
Conversation
|
Looks like |
lhotari
left a comment
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.
Good work @michaeljmarshall
|
@michaeljmarshall is this a real failure? https://github.com/apache/pulsar/actions/runs/4085441211/jobs/7043646144#step:11:1102 |
|
@michaeljmarshall The test class ServerCnxAuthorizationTest is doing extensive mocking of Netty classes, which is a bad solution. The ServerCnxTest has a better solution based on a real class, EmbeddedChannel . Article: https://www.baeldung.com/testing-netty-embedded-channel pulsar/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ServerCnxTest.java Lines 1771 to 1786 in 165ee96
Instead of adding more mocking to ServerCnxAuthorizationTest, I think it's better to refactor it to use EmbeddedChannel. |
|
@lhotari - I completely agree that we should just move the test to the |
|
I can't seem to run the |
|
Looks like those changes made the SQL integration tests pass. I am pushing one more commit to add a test that explicitly covers the bug that made the SQL tests fail 539ad03. |
The missing cert issue gets fixed by running the maven build (for core-modules) once. It copies the certs to the expected location somewhere. |
### Motivation I broke all release branches when I cherry picked 2847dd1 to them. This change takes some of the underlying logic from #19409, without taking the async logic. ### Modifications * Make changes to `ServerCnx` to make tests pass ### Verifying this change Tests are currently failing, so passing tests will show that this solution is correct. ### Documentation - [x] `doc-not-needed`
I broke all release branches when I cherry picked 2847dd1 to them. This change takes some of the underlying logic from apache#19409, without taking the async logic. * Make changes to `ServerCnx` to make tests pass Tests are currently failing, so passing tests will show that this solution is correct. - [x] `doc-not-needed` (cherry picked from commit 8246da2)
I broke all release branches when I cherry picked 2847dd1 to them. This change takes some of the underlying logic from apache#19409, without taking the async logic. * Make changes to `ServerCnx` to make tests pass Tests are currently failing, so passing tests will show that this solution is correct. - [x] `doc-not-needed` (cherry picked from commit 8246da2)
I broke all release branches when I cherry picked 2847dd1 to them. This change takes some of the underlying logic from #19409, without taking the async logic. * Make changes to `ServerCnx` to make tests pass Tests are currently failing, so passing tests will show that this solution is correct. - [x] `doc-not-needed` (cherry picked from commit 8246da2) (cherry picked from commit 15e4198)
I broke all release branches when I cherry picked 2847dd1 to them. This change takes some of the underlying logic from #19409, without taking the async logic. * Make changes to `ServerCnx` to make tests pass Tests are currently failing, so passing tests will show that this solution is correct. - [x] `doc-not-needed` (cherry picked from commit 8246da2) (cherry picked from commit 15e4198) (cherry picked from commit 6132b46)
I broke all release branches when I cherry picked 2847dd1 to them. This change takes some of the underlying logic from #19409, without taking the async logic. * Make changes to `ServerCnx` to make tests pass Tests are currently failing, so passing tests will show that this solution is correct. - [x] `doc-not-needed` (cherry picked from commit 8246da2) (cherry picked from commit 15e4198) (cherry picked from commit 6132b46)
I broke all release branches when I cherry picked 2847dd1 to them. This change takes some of the underlying logic from apache#19409, without taking the async logic. * Make changes to `ServerCnx` to make tests pass Tests are currently failing, so passing tests will show that this solution is correct. - [x] `doc-not-needed` (cherry picked from commit 8246da2) (cherry picked from commit 15e4198) (cherry picked from commit 6132b46)
(cherry picked from commit 2225361)
(cherry picked from commit 2225361)
(cherry picked from commit 2225361)
This reverts commit 557b72d.
This reverts commit aaaadcf.
(cherry picked from commit aa247ad)
Fixes #20236 PIP: #19409 ### Motivation In the `AuthenticationService`, we are currently using the deprecated `authenticate` methods. As a result, we hit the `Not Implemented` exception when using the `AuthenticationProviderOpenID`. This PR updates the implementation so that we're able This solution isn't ideal for two reasons. 1. We are not using the `authenticationHttpRequest` method, which seems like the right method for the WebSocket proxy. However, this is not a viable option, as I documented in #20237. 2. We are calling `.get()` on a future. However, it is expected that the `AuthenticationProvider` not block forever, so I think this is acceptable for now. Please let me know if you disagree. ### Modifications * Replace `authenticate` with `authenticateAsync`. ### Verifying this change This change is a trivial rework / code cleanup without any test coverage. ### Documentation - [x] `doc-not-needed` Note that I do have documentation showing that 3.0.x does not support OIDC in the WebSocket Proxy. The `next` docs don't need that limitation since this PR fixes that and targets 3.1.0. apache/pulsar-site#558 ### Matching PR in forked repository PR in forked repository: skipping for this trivial PR
Fixes apache#20236 PIP: apache#19409 ### Motivation In the `AuthenticationService`, we are currently using the deprecated `authenticate` methods. As a result, we hit the `Not Implemented` exception when using the `AuthenticationProviderOpenID`. This PR updates the implementation so that we're able This solution isn't ideal for two reasons. 1. We are not using the `authenticationHttpRequest` method, which seems like the right method for the WebSocket proxy. However, this is not a viable option, as I documented in apache#20237. 2. We are calling `.get()` on a future. However, it is expected that the `AuthenticationProvider` not block forever, so I think this is acceptable for now. Please let me know if you disagree. ### Modifications * Replace `authenticate` with `authenticateAsync`. ### Verifying this change This change is a trivial rework / code cleanup without any test coverage. ### Documentation - [x] `doc-not-needed` Note that I do have documentation showing that 3.0.x does not support OIDC in the WebSocket Proxy. The `next` docs don't need that limitation since this PR fixes that and targets 3.1.0. apache/pulsar-site#558 ### Matching PR in forked repository PR in forked repository: skipping for this trivial PR (cherry picked from commit 03dc3db)
PIP: #12105
Fixes: #19311
Motivation
Implement asynchronous authentication for the
ServerCnxclass.Modifications
authenticateAsyncmethod instead ofauthenticate. The callbacks are all handled on the context's event loop to ensure thread safety.ServerCnxvalidates proxied authentication data. The issue is described here [Broker] ServerCnx should not respond with Success until verifying originalAuthData #19311. Now, we authenticate the proxy's auth data, then the client's auth data, and then reply with theConnectedcommand.ServerCnxso that it correctly fails authentication when a proxy's original auth method triggers multistaged authentication.Verifying this change
Several new tests are added and some existing tests are updated.
Does this pull request potentially affect one of the following parts:
Documentation
doc-not-neededMatching PR in forked repository
PR in forked repository: michaeljmarshall#23