[FEATURE] Make the RangerSparkExtension compatible with spark-connect
- Dominant language
- Scala
- Stars
- 2.4k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
### Search before asking
- [x] I have searched in the [issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no similar issues.
### Describe the feature
Currently the RangerSparkExtension checks for kyuubi.session.user for getting the user name from SparkContext. Need to add a fallback to check for spark.connect.session.user if the above is null
### Motivation
Using spark-connect and Ranger for the RBAC, need this to identify the user.
### Describe the solution
Similar to how we check kyuubi.session.user, we would also check spark.connect.session.user
### Additional context
PR for propagating spark.connect.session.user from SparkConnect - https://github.com/apache/spark/pull/55917/changes
### Are you willing to submit PR?
- [x] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to improve.
- [ ] No. I cannot submit a PR at this time.
Contributor guide
Research direction
Locate the RangerSparkExtension and the existing lookup for kyuubi.session.user. Read how the extension obtains the current user, then add the spark.connect.session.user fallback when the first value is null. Done means Spark Connect sessions can identify the user for Ranger RBAC without changing the existing lookup behavior; run the relevant Ranger and Spark Connect tests if available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala, spark
- Domain
- authorization
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100