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 definers for views (Attempt 2) #60439

Merged
merged 67 commits into from Feb 28, 2024
Merged

Add definers for views (Attempt 2) #60439

merged 67 commits into from Feb 28, 2024

Conversation

pufit
Copy link
Member

@pufit pufit commented Feb 27, 2024

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Added new syntax which allows to specify definer user in View/Materialized View. This allows to execute selects/inserts from views without explicit grants for underlying tables.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Closes #19228
Original PR: #54901

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

# Conflicts:
#	docs/en/operations/settings/settings.md
#	src/Core/Settings.h
# Conflicts:
#	docs/en/operations/settings/settings.md
#	src/Core/Settings.h
#	src/Processors/Transforms/buildPushingToViewsChain.cpp
# Conflicts:
#	src/Processors/Transforms/buildPushingToViewsChain.cpp
#	src/Storages/StorageMaterializedView.cpp
# Conflicts:
#	docs/en/sql-reference/statements/create/view.md
# Conflicts:
#	docs/en/operations/settings/settings.md
#	src/Core/Settings.h
#	src/Parsers/ASTAlterQuery.cpp
#	src/Processors/Transforms/buildPushingToViewsChain.cpp
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-feature Pull request with new product feature label Feb 27, 2024
@robot-ch-test-poll3
Copy link
Contributor

robot-ch-test-poll3 commented Feb 27, 2024

This is an automated comment for commit e0891b9 with description of existing statuses. It's updated for the latest CI running

⏳ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
A SyncThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Mergeable CheckChecks if all other necessary checks are successful✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Check nameDescriptionStatus
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR⏳ pending

@vitlibar vitlibar self-assigned this Feb 27, 2024
# Conflicts:
#	src/Core/SettingsChangesHistory.h
@pufit pufit merged commit 330a206 into master Feb 28, 2024
17 of 38 checks passed
@pufit pufit deleted the pufit/views-sql-security branch February 28, 2024 00:00
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 28, 2024
@tavplubix
Copy link
Member

@pufit, please pay attention to the CI status

tavplubix added a commit that referenced this pull request Feb 28, 2024
user1="user02884_1_$RANDOM$RANDOM"
user2="user02884_2_$RANDOM$RANDOM"
user3="user02884_3_$RANDOM$RANDOM"
db="db02884_$RANDOM$RANDOM"
Copy link
Member

Choose a reason for hiding this comment

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

Why isn't this using the database that's created for each test? CLICKHOUSE_DATABASE.

Having it's custom database makes things harder to track and clean up (specially since the test is slow and might be killed in local envs).

Copy link
Member

@vitlibar vitlibar Mar 6, 2024

Choose a reason for hiding this comment

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

Also we could use this idea even for objects which are not databases:

user2="user2_02884_${CLICKHOUSE_DATABASE}_$RANDOM"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature Pull request with new product feature pr-synced-to-cloud The PR is synced to the cloud repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RBAC: Stored Object Access Control / DEFINER / SQL SECURITY
6 participants