apache / apache/kyuubi

[FEATURE] Pass full username to session

Open
#6,760 1 comment 0 reactions 0 assignees View on GitHub
kind:feature priority:major
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 username passed to the session is truncated up to first `/` or `@`. User logged in as `bob/DOMAIN` will produce session with user=bob.
https://github.com/apache/kyuubi/blob/0feacf1776434989c98e1cc305eaff8ad79750f2/kyuubi-common/src/main/scala/org/apache/kyuubi/service/TFrontendService.scala#L147
Therefore there is no way to differentiate users `bob/DOMAIN1` and `bob/DOMAIN2` inside session.
Issue suggests to pass domain part to the session.

### Motivation

When using custom `GroupProvider` and `SessionConfAdvisor` it might required to know user's domain part of username.
In my case it's possible there are `bob/DOMAIN1` and `bob/DOMAIN2`, so I want to differentiate them.

### Describe the solution

Add full username including a domain part to the session config, e.g. `kyuubi.session.full.user` field.

### Additional context

_No response_

### 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

Open the contributing guide

Research direction

Start in kyuubi-common/src/main/scala/org/apache/kyuubi/service/TFrontendService.scala at the referenced line, and trace how the username is passed into the session. Done means the session exposes a full username field such as kyuubi.session.full.user, preserving domain portions so users like bob/DOMAIN1 and bob/DOMAIN2 remain distinguishable.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.