3.0.ipv8.attestation.identity.database ====================================== .. py:module:: 3.0.ipv8.attestation.identity.database Classes ------- .. autoapisummary:: 3.0.ipv8.attestation.identity.database.Credential 3.0.ipv8.attestation.identity.database.IdentityDatabase Functions --------- .. autoapisummary:: 3.0.ipv8.attestation.identity.database.to_list Module Contents --------------- .. py:class:: Credential(metadata: 3.0.ipv8.attestation.identity.metadata.Metadata, attestations: set[3.0.ipv8.attestation.identity.attestation.Attestation]) Cache for Metadata <- [Attestation] mappings. .. py:attribute:: metadata .. py:attribute:: attestations .. py:function:: to_list(obj: Any | None) -> list If no results are found in the database, the cursor will return None. This function always returns a list. .. py:class:: IdentityDatabase(file_path: str) Bases: :py:obj:`3.0.ipv8.database.Database` Database to store identity layer data. This database stores: meta information of different pseudonyms, both ours and those of others. This database does not store: commitments and schemes for proving knowledge of data. .. py:attribute:: LATEST_DB_VERSION :value: 1 .. py:method:: insert_token(public_key: 3.0.ipv8.types.PublicKey, token: 3.0.ipv8.attestation.tokentree.token.Token) -> None Inject a Token belonging to a certain public key into this database. .. py:method:: insert_metadata(public_key: 3.0.ipv8.types.PublicKey, metadata: 3.0.ipv8.attestation.identity.metadata.Metadata) -> None Inject Metadata belonging to a certain public key into this database. .. py:method:: insert_attestation(public_key: 3.0.ipv8.types.PublicKey, authority_key: 3.0.ipv8.types.PublicKey, attestation: 3.0.ipv8.attestation.identity.attestation.Attestation) -> None Inject an Attestation made by some authority for a certain public key into this database. .. py:method:: get_tokens_for(public_key: 3.0.ipv8.types.PublicKey) -> set[3.0.ipv8.attestation.tokentree.token.Token] Get all tokens in the tree of a certain public key. .. py:method:: get_metadata_for(public_key: 3.0.ipv8.types.PublicKey) -> set[3.0.ipv8.attestation.identity.metadata.Metadata] Get all known metadata for a certain public key. .. py:method:: get_attestations_for(public_key: 3.0.ipv8.types.PublicKey) -> set[3.0.ipv8.attestation.identity.attestation.Attestation] Get all known attestations (made by others) for a certain public key. .. py:method:: get_attestations_by(public_key: 3.0.ipv8.types.PublicKey) -> set[3.0.ipv8.attestation.identity.attestation.Attestation] Get all attestations made by a certain public key (for others). This is the signing authority. .. py:method:: get_attestations_over(metadata: 3.0.ipv8.attestation.identity.metadata.Metadata) -> set[3.0.ipv8.attestation.identity.attestation.Attestation] Get all known attestations for given metadata. .. py:method:: get_authority(attestation: 3.0.ipv8.attestation.identity.attestation.Attestation) -> bytes Retrieve the authority that created a certain attestation. .. py:method:: get_credential_over(metadata: 3.0.ipv8.attestation.identity.metadata.Metadata) -> Credential Collect all attestations for the given metadata, forming a credential. .. py:method:: get_credentials_for(public_key: 3.0.ipv8.types.PublicKey) -> list[Credential] Get all credentials for a given public key. .. py:method:: get_known_identities() -> list[bytes] List the public keys of all known identity owners. .. py:method:: get_schema(version: int) -> str Return the schema for the database. .. py:method:: check_database(database_version: bytes) -> int Check if we need to upgrade.