[Pinot connector] Add support for basic authentication#9541
[Pinot connector] Add support for basic authentication#9541ebyhr merged 2 commits intotrinodb:masterfrom
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
ebyhr
left a comment
There was a problem hiding this comment.
Could you try updating TestingPinotCluster class to enable authentication in tests?
|
Thanks, I will do |
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotConfig.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotConfig.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I guess we can have a separate config for BasicAuthentation where the userName and password should be non-null and the config should be binded if the authentation method is BASIC.
There was a problem hiding this comment.
No at the moment, I've added username and password to PinotConfig. I'll see if I can extract that into a separate config class and bind it
There was a problem hiding this comment.
In case of JDBC authentication - we split the user name and password and capture them in a different config object - this also allows to implement custom authentication technique in the future.
There was a problem hiding this comment.
thanks, I'll take a look at this one later today
There was a problem hiding this comment.
I've now refactored the code to follow a similar pattern to JDBC authentication
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/AuthenticationFactory.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/AuthenticationMethod.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotConfig.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/client/PinotClient.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/AuthenticationMethod.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotConfig.java
Outdated
Show resolved
Hide resolved
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
|
For the integration test I'll have to wait till #9098 is merged since authentication features were introduced in Pinot 0.7.1 and we are at 0.6.0 in master |
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
|
@ebyhr I'll submit the CLA in the next few days, I still need confirmation from my employer - this shouldn't be a problem. In the meantime I'll add ITs for this functionality |
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestPinotIntegrationSmokeTest.java
Outdated
Show resolved
Hide resolved
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
1 similar comment
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla. |
|
@ebyhr I've submitted my CLA now, apologies for the delays |
|
@ebyhr I can't find an easy way to do the authentication permutations in a single class because of the way tests are structured and I think changing that could be a big refactoring. I can easily add 2 more test classes to test the missing combinations although running the same of test suit for different authentication methods may not be the best thing to do? Otherwise I can leave one test in the abstract class and move the others to one of the other classes |
There was a problem hiding this comment.
I've now called this basic-inline because there could be more than one way to provide basic auth credentials, e.g. via password file. Let me know if you prefer a different name for this, in my opinion the mapping between the type enum and the property name is a bit awkward and the name not great
...t/java/io/trino/plugin/pinot/auth/basic/inline/TestPinotBrokerBasicAuthenticationConfig.java
Outdated
Show resolved
Hide resolved
...va/io/trino/plugin/pinot/auth/basic/inline/TestPinotControllerBasicAuthenticationConfig.java
Outdated
Show resolved
Hide resolved
.../trino-pinot/src/test/java/io/trino/plugin/pinot/auth/TestPinotAuthenticationTypeConfig.java
Outdated
Show resolved
Hide resolved
.../trino-pinot/src/test/java/io/trino/plugin/pinot/auth/TestPinotAuthenticationTypeConfig.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Please use library to build credential. For instance, Okhttp has Credentials.basic.
...n/java/io/trino/plugin/pinot/auth/basic/inline/PinotControllerBasicAuthenticationConfig.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Rename to PinotPasswordAuthenticationProvider.
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestingPinotCluster.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/TestingPinotCluster.java
Outdated
Show resolved
Hide resolved
plugin/trino-pinot/src/test/java/io/trino/plugin/pinot/AbstractPinotIntegrationSmokeTest.java
Outdated
Show resolved
Hide resolved
|
@ddcprg By the way, there is |
|
@ebyhr sure. it's probably easier to discuss over slack... I'll send you a message later today in case there are more changes you'd like me to make |
3499d91 to
afdc21b
Compare
ebyhr
left a comment
There was a problem hiding this comment.
We can use airlift's BasicAuthRequestFilter, but follow-up PR is fine.
Please squash commits into two commits. #9541 (comment) meant:
- Change table width in docs (= don't add new properties)
- Implement basic auth + add new config properties to docs
done |
|
Thanks. Please fix commit titles as below (no prefix, no commit body)
This is our commit message guideline. |
Thank you, done |
|
Could you rebase on upstream to resolve conflicts? Sorry, another commit was merged before I merged. |
|
Merged, thanks! |
Fixes #9531