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

Added option to set the method name for Basic authentication #37

Merged
merged 4 commits into from
Oct 11, 2022

Conversation

merlimat
Copy link
Contributor

Motivation

Added option to set the method name for Basic authentication

@merlimat merlimat added the enhancement New feature or request label Oct 11, 2022
@merlimat merlimat added this to the 3.0.0 milestone Oct 11, 2022
Copy link
Contributor

@BewareMyPower BewareMyPower left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Just left a minor comment.

@nodece
Copy link
Member

nodece commented Oct 11, 2022

Do we need to extend the c_Authentication.cc?

@merlimat
Copy link
Contributor Author

Do we need to extend the c_Authentication.cc?

Yes, we can add it later. Just want to get this included in the release and python too.

@merlimat merlimat merged commit 782b4f8 into apache:main Oct 11, 2022
merlimat added a commit that referenced this pull request Oct 11, 2022
* Added option to set the method name for Basic authentication

* Fixes

* Added more tests

* Update lib/auth/AuthBasic.cc

Co-authored-by: Yunze Xu <[email protected]>

Co-authored-by: Yunze Xu <[email protected]>
@merlimat merlimat deleted the auth-basic-method branch October 11, 2022 18:21
BewareMyPower added a commit to BewareMyPower/pulsar-client-python that referenced this pull request Oct 13, 2022
### Motivation

apache/pulsar#17482 supported basic
authentication for Python client, but the `AuthenticationBasic` class
accepts two positional arguments as the username and password. It's not
good for extension. We should accept an auth param string like
`AuthenticationOauth2` so that no changes are needed if the upstream C++
client's implementation changed, like
apache/pulsar-client-cpp#37.

### Modifications

To be compatible with the existing API, change the first two arguments
to keyword arguments. Then, add the 3rd keyword argument to represent
the auth param string.

### Verifications

`test_basic_auth` and `test_invalid_basic_auth` are extended for this
change.
merlimat pushed a commit to apache/pulsar-client-python that referenced this pull request Oct 13, 2022
* Support auth param string for Basic authentication

### Motivation

apache/pulsar#17482 supported basic
authentication for Python client, but the `AuthenticationBasic` class
accepts two positional arguments as the username and password. It's not
good for extension. We should accept an auth param string like
`AuthenticationOauth2` so that no changes are needed if the upstream C++
client's implementation changed, like
apache/pulsar-client-cpp#37.

### Modifications

To be compatible with the existing API, change the first two arguments
to keyword arguments. Then, add the 3rd keyword argument to represent
the auth param string.

### Verifications

`test_basic_auth` and `test_invalid_basic_auth` are extended for this
change.

* Add method argument and related tests

* Add type check for method arg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants