latest.ipv8.test.REST.test_identity_endpoint

Module Contents

Classes

MockPseudonymFolderManager

Mock the OS file system using a dictionary as to mock files in a folder.

TestIdentityEndpoint

Class for testing the REST API of the IdentityEndpoint.

class latest.ipv8.test.REST.test_identity_endpoint.MockPseudonymFolderManager

Bases: latest.ipv8.attestation.communication_manager.PseudonymFolderManager

Mock the OS file system using a dictionary as to mock files in a folder.

get_or_create_private_key(name: str) latest.ipv8.types.PrivateKey

Generate or load a new key in memory.

remove_pseudonym_file(name: str) None

Remove the given “folder” in the dictionary, i.e., a key.

list_pseudonym_files() list[str]

Retrieve the “folders”, i.e., keys, in the fake file structure.

class latest.ipv8.test.REST.test_identity_endpoint.TestIdentityEndpoint

Bases: latest.ipv8.test.REST.rest_base.RESTTestBase

Class for testing the REST API of the IdentityEndpoint.

async setUp() None

Set up an identity community, memory identity manager and memory pseudonym folder manager.

create_settings() list[latest.ipv8.attestation.identity.community.IdentitySettings]

Create settings for any node.

async create_node(settings: list[latest.ipv8.community.CommunitySettings]) latest.ipv8.test.REST.rest_base.MockRestIPv8

We load each node i with a pseudonym my_peer{i}, which is the default IPv8 my_peer key.

communication_manager(i: int) latest.ipv8.attestation.communication_manager.CommunicationManager

Shortcut to the communication manager of node i.

async introduce_pseudonyms() None

Figure out the ephemeral communities of each node and introduce them to each other.

async wait_for(*args: Any, **kwargs) Any

Fire a make request and keep repeating this request until a non-empty response is returned.

async wait_for_requests(*args: Any, **kwargs) Any

Fire a make request and keep repeating this request until a response with the key “requests” is returned.

async test_list_pseudonyms_empty() None

Check that we do not start with any pseudonyms.

async test_list_schemas() None

Check that the endpoint reports the available schemas correctly.

async test_list_pseudonyms_one() None

Check that a loaded pseudonym is reported as such.

async test_list_pseudonyms_many() None

Check that all loaded pseudonyms are reported as such.

async test_list_public_key_one() None

Check that we retrieve the pseudonym public key correctly.

async test_list_public_key_many() None

Check that we retrieve the pseudonym public key correctly.

async test_list_peers() None

Check if peers are correctly listed.

async test_list_unload() None

Check if a pseudonym stops communicating on unload.

async test_list_credentials_empty() None

Check that we retrieve credentials correctly, if none exist.

async test_request_attestation() None

Check that requesting an attestation works.

async test_request_attestation_metadata() None

Check that requesting an attestation with metadata works.

async test_attest() None

Check that attesting to an attestation request with metadata works.

async test_verify() None

Check that verifying a credential works.

async test_disallow_verify() None

Check that no verification is performed, if not allowed.