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

Add originalUser and authenticatedUser as selectors available for resource group selection #24662

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xkrogen
Copy link
Member

@xkrogen xkrogen commented Jan 8, 2025

Description

This PR adds the original user and authenticated user as selectors that can be used in resource group selection, allowing for more flexible selection of resource groups based on additional context about the user's identity.

Additional context and related issues

Currently, resource group selection can take into account the current session user, but doesn't have a way to select based on the original user or authenticated user. In some setups, in may be desirable for resource group selection to be based on these additional metadata, rather than only the current user.

For original user, one sample use case is when SET SESSION AUTHORIZATION is used to change the current user for purposes of gaining access to a different set of resources (for example, a table that is accessible by the impersonated user, but not the original user). In this case, it can be desirable to still perform resource group selection based on the original user. For example, let us say that access to widely used table t_foo is only granted to user u_foo. Many users will impersonate u_foo to get access to t_foo, and if resource group selection is performed on the impersonated user, they will all share the same resource group, potentially causing contention. It may be desirable to instead perform resource group selection based on the original user to avoid such contention.

For authenticated user, a sample use case may be to identify all queries originating from a certain platform or service. If that platform/service has the ability to impersonate other users for authorization purposes, it may still be desirable to execute all queries in a dedicated resource group.

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(X) Release notes are required, with the following suggested text:

## Resource Groups
* Add `originalUser` and `authenticatedUser` as resource group selectors. ({issue}`24662`)

@cla-bot cla-bot bot added the cla-signed label Jan 8, 2025
@github-actions github-actions bot added the docs label Jan 8, 2025
@xkrogen xkrogen requested a review from Copilot January 8, 2025 21:27

Choose a reason for hiding this comment

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

Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.

@xkrogen
Copy link
Member Author

xkrogen commented Jan 8, 2025

cc @findepi @piotrrzysko

@xkrogen xkrogen force-pushed the xkrogen/resourcegroup-selectors-original-authenticated-user branch 3 times, most recently from 5d25e2c to f3dfb32 Compare January 9, 2025 17:19
@xkrogen
Copy link
Member Author

xkrogen commented Jan 9, 2025

Had trouble getting the Oracle Flyway DB migration tests to run on my local so it took a few tries on CI to get that to pass. But it should be ready for review now!

@xkrogen xkrogen force-pushed the xkrogen/resourcegroup-selectors-original-authenticated-user branch from 36d8949 to 9217288 Compare January 9, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant