-
Notifications
You must be signed in to change notification settings - Fork 581
Reset roles by "SET ROLE NONE" #1649
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
The following simulation of an app with the impersonation feature based on row policies could be an OK integration test. Setup: CREATE OR REPLACE TABLE test_table
(
`s` String
)
ENGINE = MergeTree
ORDER BY tuple();
INSERT INTO test_table VALUES ('a'), ('b');
CREATE USER test_user NOT IDENTIFIED;
CREATE ROLE row_a;
CREATE ROLE row_b;
GRANT row_a, row_b TO test_user;
GRANT SELECT ON default.test_table TO test_user;
CREATE ROW POLICY OR REPLACE policy_row_b ON test_table FOR SELECT USING s = 'b' TO row_b;
CREATE ROW POLICY OR REPLACE policy_row_a ON test_table FOR SELECT USING s = 'a' TO row_a; Test:
In Java code, that could be:
|
Properties properties = new Properties(); | ||
properties.setProperty(ClickHouseHttpOption.REMEMBER_LAST_SET_ROLES.getKey(), "true"); | ||
properties.setProperty(ClickHouseHttpOption.CONNECTION_PROVIDER.getKey(), | ||
HttpConnectionProvider.APACHE_HTTP_CLIENT.name()); |
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.
Why we are setting this, it is the default
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.
I've forgot this after testing. Will remove.
Summary
Closes #1647
Checklist
Delete items not relevant to your PR: