From 65c529f169211f64561332fed6e005f4f688e1f8 Mon Sep 17 00:00:00 2001 From: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:48:40 +0530 Subject: [PATCH 1/4] added guest login with empty email and password --- packages/syft/src/syft/client/client.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/syft/src/syft/client/client.py b/packages/syft/src/syft/client/client.py index c6371f487a0..190c1af2404 100644 --- a/packages/syft/src/syft/client/client.py +++ b/packages/syft/src/syft/client/client.py @@ -923,6 +923,13 @@ def login( ) _client = _client_cache + if login_credentials is None: + print( + f"Logged into <{_client.name}: {_client.metadata.node_side_type.capitalize()}-side " + f"{_client.metadata.node_type.capitalize()}> as GUEST" + ) + return _client.guest() + if not _client.authed and login_credentials: _client.login( email=login_credentials.email, From d1fb859fb9f3be5b9490dddeaa6d0608c535917b Mon Sep 17 00:00:00 2001 From: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:05:15 +0530 Subject: [PATCH 2/4] fixed exception handling --- packages/syft/src/syft/service/network/network_service.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/syft/src/syft/service/network/network_service.py b/packages/syft/src/syft/service/network/network_service.py index f3367caab0c..7181027bc7a 100644 --- a/packages/syft/src/syft/service/network/network_service.py +++ b/packages/syft/src/syft/service/network/network_service.py @@ -204,10 +204,9 @@ def add_peer( message="verify_key does not match the remote node's verify_key for add_peer" ) - remote_client = peer.client_with_context(context=context) - random_challenge = secrets.token_bytes(16) - try: + remote_client = peer.client_with_context(context=context) + random_challenge = secrets.token_bytes(16) remote_res = remote_client.api.services.network.ping( challenge=random_challenge ) From 04b6d7427f354b946be1c15a5027269a60b7ce8c Mon Sep 17 00:00:00 2001 From: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:04:01 +0530 Subject: [PATCH 3/4] reverted guest credentials --- packages/syft/src/syft/client/client.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/syft/src/syft/client/client.py b/packages/syft/src/syft/client/client.py index 190c1af2404..c6371f487a0 100644 --- a/packages/syft/src/syft/client/client.py +++ b/packages/syft/src/syft/client/client.py @@ -923,13 +923,6 @@ def login( ) _client = _client_cache - if login_credentials is None: - print( - f"Logged into <{_client.name}: {_client.metadata.node_side_type.capitalize()}-side " - f"{_client.metadata.node_type.capitalize()}> as GUEST" - ) - return _client.guest() - if not _client.authed and login_credentials: _client.login( email=login_credentials.email, From fd814060a070f3c4be918a8281d042dd02de49a3 Mon Sep 17 00:00:00 2001 From: rasswanth-s <43314053+rasswanth-s@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:07:26 +0530 Subject: [PATCH 4/4] added login as guest to the gateway test --- tests/integration/network/gateway_test.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/integration/network/gateway_test.py b/tests/integration/network/gateway_test.py index 3f5034586ad..b58b9cc12fb 100644 --- a/tests/integration/network/gateway_test.py +++ b/tests/integration/network/gateway_test.py @@ -9,9 +9,7 @@ def test_domain_connect_to_gateway(domain_1_port, gateway_port): - gateway_client: GatewayClient = sy.login( - port=gateway_port, email="info@openmined.org", password="changethis" - ) + gateway_client: GatewayClient = sy.login_as_guest(port=gateway_port) domain_client: DomainClient = sy.login( port=domain_1_port, email="info@openmined.org", password="changethis"