-
Couldn't load subscription status.
- Fork 4k
sql: admins now have full access to all external connections #155657
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
Conversation
|
In a follow-up will address the issue of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where admin users could not see external connections created by non-admin users when running SHOW EXTERNAL CONNECTIONS. The fix ensures that admins now have full access to all external connections by automatically granting ALL privileges to the admin role for external connection objects.
- Modified privilege cache logic to grant admin users ALL privileges on external connections
- Added comprehensive test coverage to verify admin access and non-admin isolation
- Restructured existing privilege handling code to use a switch statement for better maintainability
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/sql/syntheticprivilegecache/cache.go | Updated privilege handling to grant admin users ALL privileges on external connections and refactored conditional logic into a switch statement |
| pkg/sql/show_external_connection_test.go | Added new test file to verify that admin users can see all external connections while non-admin users cannot see others' connections |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
48f9257 to
5706ec1
Compare
Previously, if a non-admin user were to create an external connection, that connection would not show up in the output of `SHOW EXTERNAL CONNECTIONS` that was run by an admin. This patch fixes this bug so that admins can now see/use all external connections. Fixes: cockroachdb#146773 Release note: Admin users now have full access to all external connections.
5706ec1 to
ae3c866
Compare
|
TFTR! bors r=rafiss |
155411: restore: prevent scatter of non-empty ranges in online restore r=jeffswenson a=kev-cao In conventional restore, we prevent the scattering of non-empty ranges by passing in a max size for the `AdminScatter` request. In online restore, while we expect to almost always be scattering empty ranges, due to the fact that the link phase can retry, it is possible to scatter ranges that contain external SSTs. This breaks our golden rule of only scattering empty ranges. This commit teaches online restore to only ever scatter empty ranges. Fixes: #144599 Release note: None 155653: roachtest: run INSPECT as background job and poll for completion r=spilchen a=spilchen Long-running INSPECT statements (e.g., >3h) have previously failed due to connection resets, despite no server crash. This likely stems from a missed keep-alive or a client timeout, though the exact cause is unclear. This change updates the roachtest to: - Run the INSPECT statement as a background job using a short statement_timeout (5s). - Poll the job table for job completion instead of waiting synchronously. - Report progress at 10% intervals to improve visibility without overwhelming the logs. Fixes #155610 Release note: none Epic: none 155657: sql: admins now have full access to all external connections r=rafiss a=kev-cao Previously, if a non-admin user were to create an external connection, that connection would not show up in the output of `SHOW EXTERNAL CONNECTIONS` that was run by an admin. This patch fixes this bug so that admins can now see/use all external connections. Fixes: #146773 Release note: Admin users now have full access to all external connections. Co-authored-by: Kevin Cao <[email protected]> Co-authored-by: Matt Spilchen <[email protected]>
|
Build failed (retrying...): |
Previously, if a non-admin user were to create an external connection, that connection would not show up in the output of
SHOW EXTERNAL CONNECTIONSthat was run by an admin.This patch fixes this bug so that admins can now see/use all external connections.
Fixes: #146773
Release note: Admin users now have full access to all external connections.