Skip to content

[Pinot connector] Add support for basic authentication#9541

Merged
ebyhr merged 2 commits intotrinodb:masterfrom
ddcprg:issue_9531
Jan 19, 2022
Merged

[Pinot connector] Add support for basic authentication#9541
ebyhr merged 2 commits intotrinodb:masterfrom
ddcprg:issue_9531

Conversation

@ddcprg
Copy link
Copy Markdown
Member

@ddcprg ddcprg commented Oct 7, 2021

Fixes #9531

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Oct 7, 2021

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 ebyhr requested review from ebyhr and elonazoulay October 7, 2021 06:30
Copy link
Copy Markdown
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

Could you try updating TestingPinotCluster class to enable authentication in tests?

@ddcprg
Copy link
Copy Markdown
Member Author

ddcprg commented Oct 7, 2021

Thanks, I will do

Copy link
Copy Markdown
Member

@Praveen2112 Praveen2112 left a comment

Choose a reason for hiding this comment

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

Just skimmed it

Copy link
Copy Markdown
Member

@Praveen2112 Praveen2112 Oct 7, 2021

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

@ddcprg ddcprg Oct 7, 2021

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ddcprg Reminder.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks, I'll take a look at this one later today

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've now refactored the code to follow a similar pattern to JDBC authentication

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Oct 7, 2021

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.

@ddcprg
Copy link
Copy Markdown
Member Author

ddcprg commented Oct 7, 2021

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

@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Nov 5, 2021

@ddcprg Could you rebase on upstream since #9098 was already merged? Also, please submit CLA if you haven't yet sent it.

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 8, 2021

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.

@ddcprg
Copy link
Copy Markdown
Member Author

ddcprg commented Nov 8, 2021

@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

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 8, 2021

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.

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 8, 2021

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.

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 9, 2021

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
@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 9, 2021

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.

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 9, 2021

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.

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 10, 2021

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.

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 10, 2021

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.

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 10, 2021

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.

@ddcprg
Copy link
Copy Markdown
Member Author

ddcprg commented Nov 12, 2021

@ebyhr I've submitted my CLA now, apologies for the delays

@ddcprg
Copy link
Copy Markdown
Member Author

ddcprg commented Dec 13, 2021

@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

Copy link
Copy Markdown
Member Author

@ddcprg ddcprg Dec 14, 2021

Choose a reason for hiding this comment

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

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

Comment on lines 42 to 46
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please use library to build credential. For instance, Okhttp has Credentials.basic.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rename to PinotPasswordAuthenticationProvider.

@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Jan 13, 2022

@ddcprg By the way, there is #dev channel in Trino community Slack. Please feel free to join the workspace.
https://trino.io/slack.html

@ddcprg
Copy link
Copy Markdown
Member Author

ddcprg commented Jan 17, 2022

@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

@ddcprg ddcprg force-pushed the issue_9531 branch 3 times, most recently from 3499d91 to afdc21b Compare January 17, 2022 18:33
@github-actions github-actions bot added the docs label Jan 17, 2022
Copy link
Copy Markdown
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

We can use airlift's BasicAuthRequestFilter, but follow-up PR is fine.

Please squash commits into two commits. #9541 (comment) meant:

  1. Change table width in docs (= don't add new properties)
  2. Implement basic auth + add new config properties to docs

@ddcprg
Copy link
Copy Markdown
Member Author

ddcprg commented Jan 18, 2022

We can use airlift's BasicAuthRequestFilter, but follow-up PR is fine.

Please squash commits into two commits. #9541 (comment) meant:

  1. Change table width in docs (= don't add new properties)
  2. Implement basic auth + add new config properties to docs

done

@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Jan 18, 2022

Thanks. Please fix commit titles as below (no prefix, no commit body)

  1. Make Pinot configuration table wider
  2. Add basic authentication to Pinot connector

This is our commit message guideline.
https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md#format-git-commit-messages

@ddcprg
Copy link
Copy Markdown
Member Author

ddcprg commented Jan 18, 2022

Thanks. Please fix commit titles as below (no prefix, no commit body)

  1. Make Pinot configuration table wider
  2. Add basic authentication to Pinot connector

This is our commit message guideline. https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md#format-git-commit-messages

Thank you, done

@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Jan 19, 2022

Could you rebase on upstream to resolve conflicts? Sorry, another commit was merged before I merged.

@ebyhr ebyhr merged commit 830ac66 into trinodb:master Jan 19, 2022
@ebyhr
Copy link
Copy Markdown
Member

ebyhr commented Jan 19, 2022

Merged, thanks!

@ebyhr ebyhr mentioned this pull request Jan 19, 2022
@github-actions github-actions bot added this to the 369 milestone Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

[Pinot connector] Add authentication

3 participants