Skip to content
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

[feat][proxy] PIP 97: Implement for ProxyConnection #19292

Merged

Conversation

michaeljmarshall
Copy link
Member

@michaeljmarshall michaeljmarshall commented Jan 19, 2023

PIP: #12105

Motivation

Implement asynchronous auth for the proxy connection. This is one of the core PRs for implementing #12105.

Modifications

  • Update ProxyConnection class to asynchronously handle the authentication result. The result is handled on the handler's event loop to ensure correctness.
  • Update ProxyAuthenticationTest class to implement async auth methods and to make authentication asynchronous to test that code path.

Verifying this change

There is an updated test, but it doesn't cover all code paths in this PR.

Documentation

  • doc-not-needed

We do not need to document this portion of PIP 97.

Matching PR in forked repository

PR in forked repository: michaeljmarshall#16

@michaeljmarshall michaeljmarshall self-assigned this Jan 19, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 19, 2023
@michaeljmarshall michaeljmarshall changed the title [feat][sec] PIP 97: Implement for ProxyConnection [feat][proxy] PIP 97: Implement for ProxyConnection Jan 19, 2023
@michaeljmarshall
Copy link
Member Author

These two PRs (one of which is merged) should be sufficient to make these tests pass: #19295 and #19313

remoteAddress, authMethod);
}
state = State.Connecting;
} catch (Exception e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we catch blindly "Exception" here ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote it this way because we are in a callback and if we miss the exception, we will leak the connection forever. If we think we should only catch more specific exceptions, I can update it to catch AuthenticationExcpetion and RuntimeException.

@michaeljmarshall
Copy link
Member Author

The last commit is effectively present in this PR: #19331. I wanted that one to get it's own review since it complicates this PR. Once that is merged, it'll be out of the diff in this PR.

@michaeljmarshall michaeljmarshall merged commit fa6af43 into apache:master Feb 1, 2023
@michaeljmarshall michaeljmarshall deleted the pip-97-proxy-connection branch February 1, 2023 06:56
michaeljmarshall added a commit to michaeljmarshall/pulsar that referenced this pull request Apr 19, 2023
PIP: apache#12105

Implement asynchronous auth for the proxy connection. This is one of the core PRs for implementing apache#12105.

* Update `ProxyConnection` class to asynchronously handle the authentication result. The result is handled on the handler's event loop to ensure correctness.
* Update `ProxyAuthenticationTest` class to implement async auth methods and to make authentication asynchronous to test that code path.

There is an updated test, but it doesn't cover all code paths in this PR.

- [x] `doc-not-needed`

We do not need to document this portion of PIP 97.

PR in forked repository: #16

(cherry picked from commit fa6af43)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants