pan3793 commented on code in PR #3838:
URL: https://github.com/apache/incubator-kyuubi/pull/3838#discussion_r1036111765
##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/util/AuthZUtils.scala:
##########
@@ -175,4 +194,38 @@ private[authz] object AuthZUtils {
def quote(parts: Seq[String]): String = {
parts.map(quoteIfNeeded).mkString(".")
}
+
+ private def verifyKyuubiSessionUser(spark: SparkContext, user: String): Unit
= {
+ val isVerified = {
+ try {
+ val userPubKeyBase64 =
spark.getLocalProperty(KYUUBI_SESSION_SIGN_PUBLICKEY)
+ val userSign = spark.getLocalProperty(KYUUBI_SESSION_USER_SIGN)
+ if (StringUtils.isAnyBlank(user, userPubKeyBase64, userSign)) {
+ false
+ } else {
+ verifySignWithECDSA(user, userSign, userPubKeyBase64)
+ }
+ } catch {
+ case _: Exception =>
+ false
+ }
+ }
+ if (!isVerified) {
+ throw new AccessControlException(s"Permission denied: user [$user] is
not verified")
Review Comment:
"Permission denied" is not suitable here, it's some kind of "illegal
identifier" or "invalid user identifier"
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]