mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +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}")
|
||||
|
||||
|
||||
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."""
|
||||
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()
|
||||
if check:
|
||||
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 create_ldap_external_user_directory_config_content(
|
||||
|
Loading…
Reference in New Issue
Block a user