Skip to content

[KYUUBI #3222][FOLLOWUP] Fixing placeholder and config of user in JDBC Authentication Provider#3288

Closed
bowenliang123 wants to merge 25 commits into
apache:masterfrom
bowenliang123:jdbc-auth-config-update
Closed

[KYUUBI #3222][FOLLOWUP] Fixing placeholder and config of user in JDBC Authentication Provider#3288
bowenliang123 wants to merge 25 commits into
apache:masterfrom
bowenliang123:jdbc-auth-config-update

Conversation

@bowenliang123
Copy link
Copy Markdown
Contributor

@bowenliang123 bowenliang123 commented Aug 20, 2022

Why are the changes needed?

To fix the config name and placeholder with username introduced in #3235 violate this convention as in JDBC driver use user keyword used for connection user rather than username,

  1. change config name from kyuubi.authentication.jdbc.username to kyuubi.authentication.jdbc.user
  2. change placeholder from ${username} to ${user}
  3. update docs and config description related to above changes, and sync the update in jdbc auth docs statement details to config docs.
  4. fix error in throwing AuthenticationException with auth db password. ut added for the fix.
  5. other minor update in docs of custom auth

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

@github-actions github-actions Bot added kind:documentation Documentation is a feature! module:common labels Aug 20, 2022
@bowenliang123
Copy link
Copy Markdown
Contributor Author

bowenliang123 commented Aug 20, 2022

@pan3793 Please have a look and I suggest to merge it to v1.6.0 and master.

Copy link
Copy Markdown
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

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

LGTM

@pan3793 pan3793 added this to the v1.6.0 milestone Aug 20, 2022
Comment thread kyuubi-common/src/main/scala/org/apache/kyuubi/util/JdbcUtils.scala
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 20, 2022

Codecov Report

Merging #3288 (502703f) into master (4ee8171) will increase coverage by 0.05%.
The diff coverage is 92.10%.

@@             Coverage Diff              @@
##             master    #3288      +/-   ##
============================================
+ Coverage     51.37%   51.42%   +0.05%     
  Complexity       13       13              
============================================
  Files           469      469              
  Lines         26229    26237       +8     
  Branches       3630     3629       -1     
============================================
+ Hits          13474    13493      +19     
+ Misses        11469    11464       -5     
+ Partials       1286     1280       -6     
Impacted Files Coverage Δ
...uthentication/JdbcAuthenticationProviderImpl.scala 90.16% <90.32%> (+16.94%) ⬆️
...in/scala/org/apache/kyuubi/config/KyuubiConf.scala 97.05% <100.00%> (ø)
.../main/scala/org/apache/kyuubi/util/JdbcUtils.scala 88.57% <100.00%> (+1.07%) ⬆️
...ache/kyuubi/operation/KyuubiOperationManager.scala 80.82% <0.00%> (-1.37%) ⬇️
...g/apache/kyuubi/operation/BatchJobSubmission.scala 74.40% <0.00%> (ø)
...yuubi/server/metadata/jdbc/JDBCMetadataStore.scala 89.96% <0.00%> (+0.69%) ⬆️
...apache/kyuubi/engine/JpsApplicationOperation.scala 80.64% <0.00%> (+3.22%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bowenliang123 bowenliang123 changed the title [KYUUBI #3222][FOLLOWUP] Fixing placeholder and config with user keyword for JDBC Authentication Provider [KYUUBI #3222][FOLLOWUP] Fixing placeholder and config of user in JDBC Authentication Provider Aug 20, 2022
@bowenliang123
Copy link
Copy Markdown
Contributor Author

@pan3793 UT and docs improved and CI passed. Ready for the merge. Please take a look again.

@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Aug 22, 2022

Thanks, merging to master/1.6

@pan3793 pan3793 closed this in 2b67ab6 Aug 22, 2022
pan3793 pushed a commit that referenced this pull request Aug 22, 2022
…C Authentication Provider

### _Why are the changes needed?_

To fix the config name and placeholder with `username` introduced in #3235 violate this convention as in JDBC driver use `user` keyword used for connection user rather than `username`,

1. change config name from `kyuubi.authentication.jdbc.username` to `kyuubi.authentication.jdbc.user`
2. change placeholder from `${username}` to `${user}`
3. update docs and config description related to above changes, and sync the update in jdbc auth docs statement details to config docs.
4. fix error in throwing AuthenticationException with auth db password. ut added for the fix.
5. other minor update in docs of custom auth

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #3288 from bowenliang123/jdbc-auth-config-update.

Closes #3222

502703f [Bowen Liang] skip map for placeholder value lookup
3733be4 [liangbowen] nit
ab00525 [liangbowen] nit
2301c4f [liangbowen] fix ut of jdbc auth with wrong_password
06f0c1b [liangbowen] remove redundant docs
ec4565b [liangbowen] remove redundant docs
ae1cce2 [liangbowen] fix compilation error of configLog
5d14103 [liangbowen] simplify configLog
6678e65 [liangbowen] reformat
52c1038 [liangbowen] simplify placeholder checking
21c2d5e [liangbowen] check whether placeholders in supported list before conn establishment or authenticate
7db0adf [liangbowen] ut for unknown placeholder
657de6a [liangbowen] nit
736b3f2 [liangbowen] refactoring placeholder value lookup, for preventing setString multiple times with "i+1"
86c8912 [liangbowen] setMaxRows after prepare placeholder, to postpone operation on jdbc conn
115fae5 [liangbowen] increase test code coverage
b45b28c [liangbowen] resultSet returned by executeQuery is never null
e1c0727 [liangbowen] update ut for redactPassword in JdbcUtils
b4a52e2 [liangbowen] fix typo in docs of custom auth
371c2c6 [liangbowen] move redactPassword method to JdbcUtils and add ut.
a4973c5 [liangbowen] reformat code
486e150 [liangbowen] fix error in throwing AuthenticationException with auth db password. add ut for the fix.
efced90 [liangbowen] update settings.md
ef97e35 [liangbowen] add SELECT prefix hint for doc of  kyuubi.authentication.jdbc.query
025f94c [liangbowen] fix username to user in JdbcAuthenticationProviderImpl by 1. use config name `kyuubi.authentication.jdbc.user`, 2. use ${user} placeholder instead of ${username}

Lead-authored-by: liangbowen <liangbowen@gf.com.cn>
Co-authored-by: Bowen Liang <liangbowen@gf.com.cn>
Signed-off-by: Cheng Pan <chengpan@apache.org>
@bowenliang123
Copy link
Copy Markdown
Contributor Author

@zhaomin1423 FYI. This PR has been merged to master/1.6.
The doc changes suggested in #3270 is also applied with it.

@bowenliang123 bowenliang123 deleted the jdbc-auth-config-update branch August 31, 2022 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:documentation Documentation is a feature! module:common

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants