Merge remote-tracking branch 'origin/named-collections-fix-access' into named-collections-fix-access

This commit is contained in:
kssenii 2023-02-04 22:55:20 +01:00
commit 84ea48b555
4 changed files with 15 additions and 5 deletions

View File

@ -14,6 +14,7 @@ instance = cluster.add_instance(
],
)
@pytest.fixture(scope="module", autouse=True)
def start_cluster():
try:

View File

@ -377,7 +377,7 @@ def test_introspection():
instance.query("GRANT SELECT ON test.table TO A")
instance.query("GRANT CREATE ON *.* TO B WITH GRANT OPTION")
all_access_except_show_named_collections="SHOW, SELECT, INSERT, ALTER, CREATE, DROP, TRUNCATE, OPTIMIZE, BACKUP, KILL QUERY, KILL TRANSACTION, MOVE PARTITION BETWEEN SHARDS, CREATE USER, ALTER USER, DROP USER, CREATE ROLE, ALTER ROLE, DROP ROLE, ROLE ADMIN, CREATE ROW POLICY, ALTER ROW POLICY, DROP ROW POLICY, CREATE QUOTA, ALTER QUOTA, DROP QUOTA, CREATE SETTINGS PROFILE, ALTER SETTINGS PROFILE, DROP SETTINGS PROFILE, SHOW ACCESS, SYSTEM, dictGet, INTROSPECTION, SOURCES, CLUSTER"
all_access_except_show_named_collections = "SHOW, SELECT, INSERT, ALTER, CREATE, DROP, TRUNCATE, OPTIMIZE, BACKUP, KILL QUERY, KILL TRANSACTION, MOVE PARTITION BETWEEN SHARDS, CREATE USER, ALTER USER, DROP USER, CREATE ROLE, ALTER ROLE, DROP ROLE, ROLE ADMIN, CREATE ROW POLICY, ALTER ROW POLICY, DROP ROW POLICY, CREATE QUOTA, ALTER QUOTA, DROP QUOTA, CREATE SETTINGS PROFILE, ALTER SETTINGS PROFILE, DROP SETTINGS PROFILE, SHOW ACCESS, SYSTEM, dictGet, INTROSPECTION, SOURCES, CLUSTER"
assert instance.query("SHOW USERS") == TSV(["A", "B", "default"])
assert instance.query("SHOW CREATE USERS A") == TSV(["CREATE USER A"])

View File

@ -8,17 +8,26 @@ cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance(
"node1",
main_configs=["configs/config.d/remote_servers.xml"],
user_configs=["configs/users.d/allow_introspection_functions.xml", "configs/users.d/users.xml"],
user_configs=[
"configs/users.d/allow_introspection_functions.xml",
"configs/users.d/users.xml",
],
)
node2 = cluster.add_instance(
"node2",
main_configs=["configs/config.d/remote_servers.xml"],
user_configs=["configs/users.d/allow_introspection_functions.xml", "configs/users.d/users.xml"],
user_configs=[
"configs/users.d/allow_introspection_functions.xml",
"configs/users.d/users.xml",
],
)
distributed = cluster.add_instance(
"distributed",
main_configs=["configs/config.d/remote_servers.xml"],
user_configs=["configs/users.d/allow_introspection_functions.xml", "configs/users.d/users.xml"],
user_configs=[
"configs/users.d/allow_introspection_functions.xml",
"configs/users.d/users.xml",
],
stay_alive=True,
)

View File

@ -89,7 +89,7 @@ SHOW ROW POLICIES ['SHOW POLICIES','SHOW CREATE ROW POLICY','SHOW CREATE POLICY'
SHOW QUOTAS ['SHOW CREATE QUOTA'] GLOBAL SHOW ACCESS
SHOW SETTINGS PROFILES ['SHOW PROFILES','SHOW CREATE SETTINGS PROFILE','SHOW CREATE PROFILE'] GLOBAL SHOW ACCESS
SHOW ACCESS [] \N ACCESS MANAGEMENT
SHOW NAMED COLLECTIONS ['SHOW NAMED COLLECTIONS'] \N ACCESS MANAGEMENT
SHOW NAMED COLLECTIONS ['SHOW NAMED COLLECTIONS'] GLOBAL ACCESS MANAGEMENT
ACCESS MANAGEMENT [] \N ALL
SYSTEM SHUTDOWN ['SYSTEM KILL','SHUTDOWN'] GLOBAL SYSTEM
SYSTEM DROP DNS CACHE ['SYSTEM DROP DNS','DROP DNS CACHE','DROP DNS'] GLOBAL SYSTEM DROP CACHE