-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
[SIP-104] API Row Level Security: get rls by username or roles via API #25351
Comments
Created pull request with /security/api.py file updated, read pull request: #25352 |
Please open a "discuss" thread on the dev mailing list ([email protected]) to move this forward. |
@frlm thanks for opening up the SIP and PR. I've worked a fair bit with the RLS feature, so I may be able to help. I think I understand what you're proposing, but I don't fully grasp what problem this is solving. Can you elaborate on why this functionality is needed? Also, who (=what permission/permissions) would be able to call this endpoint? |
Closing this and considering it discarded since it's gone without input or a DISCUSS thread for so long. |
Please make sure you are familiar with the SIP process documented
(here)[https://github.com//issues/5602]. The SIP will be numbered by a committer upon acceptance.
[SIP] Proposal for API Row Level Security: get rls by username or roles via API
Motivation
I have created the following SIP to give the client-side possibility to generate an embedding request by retrieving the row level securities defined on the UI page, example of setting:
Providing either the username of the user or the role already defined on Apache Superset, API returns the list of RLS to be provided to body of endpoint /api/v1/security/guest_token/:
Otherwise, the client making the request must know in advance the settings provided at the user interface level. The following endpoints generate output considering the filter type (Basic / Regular) and the presence or absence of the Group Key. Right now a user without providing an rls but only the default value [ ], can display all the data within the dashboard, in my case I needed to manage the display of the type of data with respect to the user requesting the embedding. The output of request will be list of dictionaries with "clause" and "dataset" as keys, e.g:
If the different rls filters associated with the requested user or role have the same group key, the filters associated with the same dataset will be merged using the OR condition, e.g:
Proposed Change
I created new two endpoints:
that retrieve users, roles, tables and rls from Metadata tables (using the SQLAlchemy package), convert all filters of type Base to Regular and aggregate the filters with respect to the defined group key value. Obviously considering only the row level securities enabled on that specific user or role.
New or Changed Public Interfaces
As mentioned above, I created two new endpoints of type Security, documented within the swagger page:
New dependencies
No additional python package needs to be installed
Migration Plan and Compatibility
No database migrations are necessary, or updates to stored URLs.
The text was updated successfully, but these errors were encountered: