mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
added additional check
This commit is contained in:
parent
cda8a18fe3
commit
b3f59537ca
@ -84,14 +84,25 @@ def rbac_roles(*roles, node=None):
|
|||||||
node.query(f"DROP ROLE IF EXISTS {role}")
|
node.query(f"DROP ROLE IF EXISTS {role}")
|
||||||
|
|
||||||
|
|
||||||
def verify_ldap_user_exists(server, username, password):
|
# def verify_ldap_user_exists(server, username, password):
|
||||||
|
# """Check that LDAP user is defined on the LDAP server."""
|
||||||
|
# with By("searching LDAP database"):
|
||||||
|
# ldap_node = current().context.cluster.node(server)
|
||||||
|
# r = ldap_node.command(
|
||||||
|
# f"ldapwhoami -H ldap://localhost -D 'cn={user_name},ou=users,dc=company,dc=com' -w {password}"
|
||||||
|
# )
|
||||||
|
# assert r.exitcode == 0, error()
|
||||||
|
|
||||||
|
|
||||||
|
def verify_ldap_user_exists(server, username, password, check=False):
|
||||||
"""Check that LDAP user is defined on the LDAP server."""
|
"""Check that LDAP user is defined on the LDAP server."""
|
||||||
with By("searching LDAP database"):
|
if check:
|
||||||
ldap_node = current().context.cluster.node(server)
|
with By("searching LDAP database"):
|
||||||
r = ldap_node.command(
|
ldap_node = current().context.cluster.node(server)
|
||||||
f"ldapwhoami -H ldap://localhost -D 'cn={user_name},ou=users,dc=company,dc=com' -w {password}"
|
r = ldap_node.command(
|
||||||
)
|
f"ldapwhoami -H ldap://localhost -D 'cn={user_name},ou=users,dc=company,dc=com' -w {password}"
|
||||||
assert r.exitcode == 0, error()
|
)
|
||||||
|
assert r.exitcode == 0, error()
|
||||||
|
|
||||||
|
|
||||||
def create_ldap_external_user_directory_config_content(
|
def create_ldap_external_user_directory_config_content(
|
||||||
|
Loading…
Reference in New Issue
Block a user