-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8159 from kiendang/client-login-new
Return a new client with SyftClient.login
- Loading branch information
Showing
24 changed files
with
183 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,12 +35,14 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#Local Python Mode\n", | ||
"enclave_node = sy.orchestra.launch(name=\"Enclave\",\n", | ||
" node_type=sy.NodeType.ENCLAVE,\n", | ||
" local_db=True,\n", | ||
" dev_mode=True,\n", | ||
" reset=True)" | ||
"# Local Python Node\n", | ||
"enclave_node = sy.orchestra.launch(\n", | ||
" name=\"Enclave\",\n", | ||
" node_type=sy.NodeType.ENCLAVE,\n", | ||
" local_db=True,\n", | ||
" dev_mode=True,\n", | ||
" reset=True\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
|
@@ -69,14 +71,18 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ca_node = sy.orchestra.launch(name=\"Canada\",\n", | ||
" local_db=True,\n", | ||
" reset=True,\n", | ||
" dev_mode=True)\n", | ||
"it_node = sy.orchestra.launch(name=\"Italy\",\n", | ||
" local_db=True,\n", | ||
" reset=True,\n", | ||
" dev_mode=True) " | ||
"ca_node = sy.orchestra.launch(\n", | ||
" name=\"Canada\",\n", | ||
" local_db=True,\n", | ||
" reset=True,\n", | ||
" dev_mode=True\n", | ||
")\n", | ||
"it_node = sy.orchestra.launch(\n", | ||
" name=\"Italy\",\n", | ||
" local_db=True,\n", | ||
" reset=True,\n", | ||
" dev_mode=True\n", | ||
") " | ||
] | ||
}, | ||
{ | ||
|
@@ -105,11 +111,13 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"gateway_node = sy.orchestra.launch(name=\"gateway\",\n", | ||
" node_type = sy.NodeType.GATEWAY,\n", | ||
" local_db=True,\n", | ||
" reset=True,\n", | ||
" dev_mode=True)" | ||
"gateway_node = sy.orchestra.launch(\n", | ||
" name=\"gateway\",\n", | ||
" node_type = sy.NodeType.GATEWAY,\n", | ||
" local_db=True,\n", | ||
" reset=True,\n", | ||
" dev_mode=True\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
|
@@ -334,7 +342,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#Explore the domains and enclaves connected to the gateway\n", | ||
"# Explore the domains and enclaves connected to the gateway\n", | ||
"ds_gateway_client.domains" | ||
] | ||
}, | ||
|
@@ -345,9 +353,9 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#logs into canada as proxy_client\n", | ||
"# Log into canada as proxy_client\n", | ||
"ds_ca_proxy_client = ds_gateway_client.domains[0]\n", | ||
"ds_ca_proxy_client.login(email=\"[email protected]\" , password=\"changethis\")\n", | ||
"ds_ca_proxy_client = ds_ca_proxy_client.login(email=\"[email protected]\", password=\"changethis\")\n", | ||
"assert ds_ca_proxy_client.name == \"Canada\"\n", | ||
"assert ds_ca_proxy_client.connection.proxy_target_uid == do_ca_client.id\n", | ||
"assert isinstance(ds_ca_proxy_client, DomainClient)" | ||
|
@@ -360,9 +368,9 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#logs into italy as proxy_client\n", | ||
"# Log into italy as proxy_client\n", | ||
"ds_it_proxy_client = ds_gateway_client.domains[1]\n", | ||
"ds_it_proxy_client.login(email=\"[email protected]\" , password=\"changethis\")\n", | ||
"ds_it_proxy_client = ds_it_proxy_client.login(email=\"[email protected]\", password=\"changethis\")\n", | ||
"assert ds_it_proxy_client.name == \"Italy\"\n", | ||
"assert ds_it_proxy_client.connection.proxy_target_uid == do_it_client.id\n", | ||
"assert isinstance(ds_it_proxy_client, DomainClient)" | ||
|
@@ -375,9 +383,11 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Creates and account and logs into enclave as proxy client\n", | ||
"# Create an account and log into enclave as proxy client\n", | ||
"ds_enclave_proxy_client = ds_gateway_client.enclaves[0]\n", | ||
"ds_enclave_proxy_client.login(email=\"[email protected]\" , password=\"changethis\",name=\"Sheldon\", register=True)\n", | ||
"ds_enclave_proxy_client = ds_enclave_proxy_client.login(\n", | ||
" email=\"[email protected]\" , password=\"changethis\", name=\"Sheldon\", register=True\n", | ||
")\n", | ||
"assert ds_enclave_proxy_client.name == \"Enclave\"\n", | ||
"assert ds_enclave_proxy_client.connection.proxy_target_uid == enclave_guest_client.id\n", | ||
"assert isinstance(ds_enclave_proxy_client, EnclaveClient)" | ||
|
@@ -453,11 +463,11 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#Checking result of mock data execution\n", | ||
"# Check result of mock data execution\n", | ||
"mock_result = compute_census_matches(\n", | ||
" canada_census_data=canada_census_data.mock,\n", | ||
" italy_census_data=italy_census_data.mock\n", | ||
" )\n", | ||
" canada_census_data=canada_census_data.mock,\n", | ||
" italy_census_data=italy_census_data.mock,\n", | ||
")\n", | ||
"mock_result" | ||
] | ||
}, | ||
|
@@ -659,14 +669,6 @@ | |
"source": [ | ||
"assert result_ptr.syft_action_data == 813" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "1beca4ac", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.