Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMORO-2692] Support proxy user in terminal #2693

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

link3280
Copy link
Contributor

Why are the changes needed?

Close #2692.

Brief change log

  • Add proxy user parameter to the REST API.
  • Support impersonation in spark terminal.

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before making a pull request

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@github-actions github-actions bot added module:core Core module module:ams-server Ams server module labels Mar 31, 2024
@link3280 link3280 changed the title [AMORO-2692] Support proxy user in spark terminal [AMORO-2692] Support proxy user in terminal Mar 31, 2024
@link3280 link3280 force-pushed the feat/terminal_impersonation branch from 3e2cb05 to bc7fb08 Compare March 31, 2024 07:50
@xieyi888
Copy link
Contributor

xieyi888 commented Apr 1, 2024

I‘m looking forwared to this PR! But I have some questions
It seems ams-server did not include authorization and authentication, How can we use this function on ams terminal?
Do we consider support proxy on spark engine?

@link3280
Copy link
Contributor Author

link3280 commented Apr 1, 2024

@xieyi888 Thanks for your input!

It seems ams-server did not include authorization and authentication, How can we use this function on ams terminal?

Do you mean the kerberos authentication? Ideally, the terminal would use the UGI in TableMetaStore.RuntimeContext, but in fact the UGI cannot cover the usages like Iceberg async tasks. This PR mainly makes the spark user right. For example, the table created would have the proxy user as its owner.

WRT authorization, I think that's the catalog's job and not relevant to the amoro terminal.

Do we consider support proxy on spark engine?

I think it's doable via Kyuubi. But I haven't got the chance to verify it yet.

@baiyangtx
Copy link
Contributor

@link3280 From your PR, it seems that you are calling terminal by REST API? so that you can pass the proxyUser from http parameters. But this is not working for user executing SQL via WebBrowser.

@link3280
Copy link
Contributor Author

link3280 commented Apr 8, 2024

@link3280 From your PR, it seems that you are calling terminal by REST API? so that you can pass the proxyUser from http parameters. But this is not working for user executing SQL via WebBrowser.

That's right. This PR doesn't involve web UI changes.

Comment on lines +301 to +303
rs =
tableMetaStore.doAsImpersonating(
proxyUser, () -> session.executeStatement(catalog, statement));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to check whether to call doAs or doAsImpersonating here, and try not to modify the code of the TableMetastore.

@XBaith
Copy link
Contributor

XBaith commented May 10, 2024

I think it's doable via Kyuubi. But I haven't got the chance to verify it yet.

Hi @link3280, Can you explain more details how to execute SQL statements with configured user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:ams-server Ams server module module:core Core module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Support proxy users in spark terminal
5 participants