You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/12/13 07:07:38 UTC

[GitHub] [incubator-kyuubi] bowenliang123 opened a new pull request, #3974: [KYUUBI #3930] [Fix] fix ut in SessionSigningSuite by getting session public key and user sign from LocalProperty

bowenliang123 opened a new pull request, #3974:
URL: https://github.com/apache/incubator-kyuubi/pull/3974

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
     2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   Followed by issue https://github.com/apache/incubator-kyuubi/issues/3930 and pr https://github.com/apache/incubator-kyuubi/pull/3932.
   
   - correct ut in SessionSigningSuite by fetching session public key and user sign via scala scripts instead of `SET` command in SQL , to prevent accidently redacted by `spark.redaction.regex`
   - removed `syncronized` in SignUtils introduced in pr #3932 , with confirming no thread safe problem during the signing and verification
   
   
   ### _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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] bowenliang123 commented on a diff in pull request #3974: [KYUUBI #3930] [Fix] fix ut in SessionSigningSuite by getting session public key and user sign from LocalProperty

Posted by GitBox <gi...@apache.org>.
bowenliang123 commented on code in PR #3974:
URL: https://github.com/apache/incubator-kyuubi/pull/3974#discussion_r1046739874


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/session/SessionSigningSuite.scala:
##########
@@ -68,16 +70,22 @@ class SessionSigningSuite extends WithKyuubiServer with HiveJDBCTestHelper {
   test("KYUUBI #3839 session user sign - check session user sign") {
     withSessionConf()()() {
       withJdbcStatement() { statement =>
-        val rs1 = statement.executeQuery(s"SET $KYUUBI_SESSION_SIGN_PUBLICKEY")
-        assert(rs1.next())
-        assert(rs1.getString("value").nonEmpty)
+        val value = s"SET ${OPERATION_LANGUAGE.key}=scala"
+        statement.executeQuery(value)
 
-        val rs2 = statement.executeQuery(s"SET $KYUUBI_SESSION_USER_SIGN")
+        val rs1 = statement.executeQuery(
+          "spark.sparkContext.getLocalProperty(\"kyuubi.session.sign.publickey\")")
+        assert(rs1.next())
+        val rs2 = statement.executeQuery(
+          s"spark.sparkContext.getLocalProperty(\"kyuubi.session.user.sign\")")

Review Comment:
   Having trouble in changing it to `s"spark.sparkContext.getLocalProperty(\"${KYUUBI_SESSION_USER_SIGN}\")")`, it comes with a compilation error "value $ is not a member of String".



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #3974: [KYUUBI #3930] [Fix] fix ut in SessionSigningSuite by getting session public key and user sign from LocalProperty

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #3974:
URL: https://github.com/apache/incubator-kyuubi/pull/3974#discussion_r1046734811


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/session/SessionSigningSuite.scala:
##########
@@ -68,16 +70,22 @@ class SessionSigningSuite extends WithKyuubiServer with HiveJDBCTestHelper {
   test("KYUUBI #3839 session user sign - check session user sign") {
     withSessionConf()()() {
       withJdbcStatement() { statement =>
-        val rs1 = statement.executeQuery(s"SET $KYUUBI_SESSION_SIGN_PUBLICKEY")
-        assert(rs1.next())
-        assert(rs1.getString("value").nonEmpty)
+        val value = s"SET ${OPERATION_LANGUAGE.key}=scala"
+        statement.executeQuery(value)
 
-        val rs2 = statement.executeQuery(s"SET $KYUUBI_SESSION_USER_SIGN")
+        val rs1 = statement.executeQuery(
+          "spark.sparkContext.getLocalProperty(\"kyuubi.session.sign.publickey\")")

Review Comment:
   KyuubiReservedKeys.KYUUBI_SESSION_SIGN_PUBLICKEY



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you closed pull request #3974: [KYUUBI #3930] [Fix] fix ut in SessionSigningSuite by getting session public key and user sign from LocalProperty

Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #3974: [KYUUBI #3930] [Fix] fix ut in SessionSigningSuite by getting session public key and user sign from LocalProperty
URL: https://github.com/apache/incubator-kyuubi/pull/3974


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] bowenliang123 commented on pull request #3974: [KYUUBI #3930] [Fix] fix ut in SessionSigningSuite by getting session public key and user sign from LocalProperty

Posted by GitBox <gi...@apache.org>.
bowenliang123 commented on PR #3974:
URL: https://github.com/apache/incubator-kyuubi/pull/3974#issuecomment-1347841310

   cc @cfmcgrady @ulysses-you @turboFei 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #3974: [KYUUBI #3930] [Fix] fix ut in SessionSigningSuite by getting session public key and user sign from LocalProperty

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #3974:
URL: https://github.com/apache/incubator-kyuubi/pull/3974#discussion_r1046734968


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/session/SessionSigningSuite.scala:
##########
@@ -68,16 +70,22 @@ class SessionSigningSuite extends WithKyuubiServer with HiveJDBCTestHelper {
   test("KYUUBI #3839 session user sign - check session user sign") {
     withSessionConf()()() {
       withJdbcStatement() { statement =>
-        val rs1 = statement.executeQuery(s"SET $KYUUBI_SESSION_SIGN_PUBLICKEY")
-        assert(rs1.next())
-        assert(rs1.getString("value").nonEmpty)
+        val value = s"SET ${OPERATION_LANGUAGE.key}=scala"
+        statement.executeQuery(value)
 
-        val rs2 = statement.executeQuery(s"SET $KYUUBI_SESSION_USER_SIGN")
+        val rs1 = statement.executeQuery(
+          "spark.sparkContext.getLocalProperty(\"kyuubi.session.sign.publickey\")")
+        assert(rs1.next())
+        val rs2 = statement.executeQuery(
+          s"spark.sparkContext.getLocalProperty(\"kyuubi.session.user.sign\")")

Review Comment:
   KyuubiReservedKeys.KYUUBI_SESSION_USER_SIGN



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] bowenliang123 commented on a diff in pull request #3974: [KYUUBI #3930] [Fix] fix ut in SessionSigningSuite by getting session public key and user sign from LocalProperty

Posted by GitBox <gi...@apache.org>.
bowenliang123 commented on code in PR #3974:
URL: https://github.com/apache/incubator-kyuubi/pull/3974#discussion_r1046745243


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/session/SessionSigningSuite.scala:
##########
@@ -68,16 +70,22 @@ class SessionSigningSuite extends WithKyuubiServer with HiveJDBCTestHelper {
   test("KYUUBI #3839 session user sign - check session user sign") {
     withSessionConf()()() {
       withJdbcStatement() { statement =>
-        val rs1 = statement.executeQuery(s"SET $KYUUBI_SESSION_SIGN_PUBLICKEY")
-        assert(rs1.next())
-        assert(rs1.getString("value").nonEmpty)
+        val value = s"SET ${OPERATION_LANGUAGE.key}=scala"
+        statement.executeQuery(value)
 
-        val rs2 = statement.executeQuery(s"SET $KYUUBI_SESSION_USER_SIGN")
+        val rs1 = statement.executeQuery(
+          "spark.sparkContext.getLocalProperty(\"kyuubi.session.sign.publickey\")")
+        assert(rs1.next())
+        val rs2 = statement.executeQuery(
+          s"spark.sparkContext.getLocalProperty(\"kyuubi.session.user.sign\")")

Review Comment:
   OK, thx for the help. Changing to 
   ```
             s"""
                |spark.sparkContext.getLocalProperty("$KYUUBI_SESSION_USER_SIGN")
                |""".stripMargin
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #3974: [KYUUBI #3930] [Fix] fix ut in SessionSigningSuite by getting session public key and user sign from LocalProperty

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on PR #3974:
URL: https://github.com/apache/incubator-kyuubi/pull/3974#issuecomment-1348091373

   thanks, merging to master


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org