apache / kyuubi

Apache Kyuubi is a distributed and multi-tenant gateway to provide serverless SQL on data warehouses and lakehouses.
https://kyuubi.apache.org/
Apache License 2.0
2.1k stars 915 forks source link

[FEATURE] Pass full username to session #6760

Open blide opened 1 week ago

blide commented 1 week ago

Code of Conduct

Search before asking

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?

github-actions[bot] commented 1 week ago

Hello @blide, Thanks for finding the time to report the issue! We really appreciate the community's efforts to improve Apache Kyuubi.