proto(sql): add GetSqlIdentity RPC to v1alpha3 SQLService [UX-1330]#2523
Closed
c-julin wants to merge 1 commit into
Closed
proto(sql): add GetSqlIdentity RPC to v1alpha3 SQLService [UX-1330]#2523c-julin wants to merge 1 commit into
c-julin wants to merge 1 commit into
Conversation
GetSqlIdentity returns the caller's engine username and whether it holds administrative (superuser) privileges, so the UI can gate write/DDL actions (e.g. the create-table wizard) on a real signal rather than assuming a role. Proto + regenerated Go/TS clients and v1alpha3 OpenAPI. Enterprise implements the handler against pg_roles.rolsuper.
Contributor
|
The latest Buf updates on your PR. Results from workflow Buf CI / validate (pull_request).
|
Contributor
Author
|
Superseded by #2524 (renamed branch to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
GetSqlIdentityRPC to the v1alpha3SQLServiceplus regenerated Go/TS clients and v1alpha3 OpenAPI.Gated on
PERMISSION_VIEW/API_REDPANDA_SQL, same as the other SQL RPCs; HTTPGET /v1alpha3/sql/identity.Why
The SQL editor UI needs to distinguish a SQL admin from a viewer to show/hide write actions (e.g. the create-table wizard). There is currently no signal for this — the frontend hardcodes
sqlRole = 'viewer'. The engine (Oxla) is the source of truth: admin ==rolsuper. This RPC surfaces that so the UI can gate the button on a real capability rather than assuming a role. The engine still enforces privileges on execution regardless.Validated against a live Oxla cluster:
SELECT rolname, rolsuper FROM pg_roles WHERE rolname = current_userreturnstfor an admin (oxla) andffor a created viewer.Notes
task proto:generate; unrelated whitespace churn in v1alpha2 OpenAPI examples was reverted (CI usesgit diff -w).Ref UX-1330.