Skip to content

Commit

Permalink
Handle Client(..., security=False) (#8980)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson authored Jan 10, 2025
1 parent bd863de commit c2ba834
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion distributed/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ def __init__(
if security is None and isinstance(address, str):
security = _maybe_call_security_loader(address)

if security is None:
if security is None or security is False:
security = Security()
elif isinstance(security, dict):
security = Security(**security)
Expand Down
10 changes: 10 additions & 0 deletions distributed/tests/test_tls_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ async def test_security_dict_input_no_security():
assert result == 2


@gen_test()
async def test_security_bool_input_disabled_security():
async with Scheduler(dashboard_address=":0", security=False) as s:
async with Worker(s.address, security=False):
async with Client(s.address, security=False, asynchronous=True) as c:
result = await c.submit(inc, 1)
assert c.security.require_encryption is False
assert result == 2


@gen_test()
async def test_security_dict_input():
conf = tls_config()
Expand Down

0 comments on commit c2ba834

Please sign in to comment.